button

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

PartFileDoes
ButtonButton.vueLets 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

Button.vue

Lets the user trigger an action, such as adding a product to the cart. Renders a <button>.

Props 6

PropTypeDefault
asChildbooleanfalse
asAsTag | 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'
classClassValue—

Data attributes 3

Data attributeValues
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'

Recipe button 45 groups

Button
State