Button
Triggers an action such as adding to the cart: solid, outline, soft, ghost or link, in primary, neutral, destructive, inverse and the commerce colours buy and checkout.
Parts
| Part | File | Does |
|---|---|---|
| Button | Button.vue | Lets the user trigger an action, such as adding a product to the cart. |
Styling
All of Button’s styles live in button.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- class-variance-authority
- reka-ui
API reference
Lets the user trigger an action, such as adding a product to the cart. Renders a <button>.
Props 6
| Prop | Type | Default | |
|---|---|---|---|
| asChild | boolean | false | |
| |||
| as | AsTag | Component | 'button' | |
| |||
| variant | 'solid' | 'outline' | 'soft' | 'ghost' | 'link' | 'solid' | |
| |||
| color | 'neutral' | 'primary' | 'destructive' | 'buy' | 'checkout' | 'inverse' | 'primary' | |
| |||
| size | 'md' | 'xs' | 'sm' | 'lg' | 'icon-xs' | 'icon-sm' | 'icon-md' | 'icon-lg' | 'md' | |
| |||
| class | ClassValue | — | |
| |||
Data attributes 3
| Data attribute | Values | |
|---|---|---|
| data-color | 'neutral' | 'primary' | 'destructive' | 'buy' | 'checkout' | 'inverse' | |
| ||
| data-size | 'md' | 'xs' | 'sm' | 'lg' | 'icon-xs' | 'icon-sm' | 'icon-md' | 'icon-lg' | |
| ||
| data-variant | 'solid' | 'outline' | 'soft' | 'ghost' | 'link' | |
| ||