pure-button

Simple CSS for buttons.

Default Buttons

To create a Pure Button, use the <pure-button></pure-button> web component. If you add a href to the component, it will automatically become a <a>. Or if you use the as property to manually set the base element (such as an <input>).

A Pure Button A Pure Button A Pure Button

<pure-button href="#">A Pure Button</pure-button>
<pure-button>A Pure Button</pure-button>
<pure-button as="input" type="submit">A Pure Button</pure-button>

Disabled Buttons

To mark a button as disabled, add the disabled property alongside pure-button. Alternatively, add the "disabled" attribute directly to your button.

A Pure Button A Pure Button A Pure Button

<pure-button href="#" disabled>A Pure Button</pure-button>
<pure-button disabled>A Pure Button</pure-button>
<pure-button as="input" type="submit" disabled>A Pure Button</pure-button>

Properties

PropertyAttributeDescriptionTypeDefault
asasHTML element to use as basisstringundefined
colorcolorBackground colorstringundefined
disableddisabledIs disabled?booleanundefined
hrefhrefDisplays button as linkstringundefined
targettargetSpecifies where to display the linked URL. Only applies when an href is provided. Special keywords: "_blank", "_self", "_parent", "_top".stringundefined
typetypeThe button or input type (usually submit)"button" \| "reset" \| "submit"undefined
valuevalueOptional prop for input to show textstringundefined

Built with StencilJS