Button Component โ Astro
Semantic button component with variants using theme variables
Button Component
Semantic button component with variants using theme variables.
Button Variants
Live Examples
All buttons:
- Use semantic theme variables
- Have hover and focus states
- Support disabled state
- Are keyboard accessible
Usage
astro astro
<!-- Using component -->
---
import Button from '../../components/Button.astro';
---
<Button>Click me</Button>
<!-- Using classes -->
<button class="btn">Default</button>
<button class="btn btn-primary">Primary</button>
<button class="btn btn-success">Success</button>
<button class="btn btn-warning">Warning</button>
<button class="btn btn-error">Error</button>
<button class="btn btn-info">Info</button>
<button class="btn btn-outline">Outline</button> Button Variants
btn- Default button stylebtn-primary- Primary action buttonbtn-success- Success/positive actionbtn-warning- Warning actionbtn-error- Error/destructive actionbtn-info- Informational actionbtn-outline- Outlined button style
Disabled State
Live Example
Svelte & Vanilla: Svelte ยท Vanilla: same HTML and BEM as in Usage above.