Buttons are interactive elements that allow users to trigger actions with a single click or tap. They're a fundamental part of any user interface, guiding users through tasks and interactions.
To use the Astra Button component, simply add the <astra-button>
tag to your HTML:
<astra-button>Click me!</astra-button>
The Astra Button component offers various customization options:
Choose from different button styles using the variant
attribute:
<astra-button variant="primary">Primary</astra-button>
<astra-button variant="secondary">Secondary</astra-button>
<astra-button variant="transparent">Transparent</astra-button>
<astra-button variant="destructive">Destructive</astra-button>
Adjust the button size with the size
attribute:
<astra-button size="base">Base</astra-button>
<astra-button size="small">Small</astra-button>
<astra-button size="compact">Compact</astra-button>
Modify the button shape using the shape
attribute:
<astra-button shape="default">Default</astra-button>
<astra-button shape="square">Square</astra-button>
<astra-button shape="circle">Circle</astra-button>
The Astra Button component is designed with accessibility in mind:
disabled
attribute to disable the button
when needed.