TODO
Button
The button component is used to trigger an action or event when clicked. It can be used to submit a form, navigate to a different page, or to trigger a function. In order to differentiate between an anchor
element or a button
element, the href
is used.
Preview
Extends base props from: HTMLButtonAttributes | HTMLAnchorAttributes
Name Type Default
variant The variant of the button
ButtonVariant
'default'
color The color of the button
ButtonColor
'primary'
href The URL to navigate to when the button is clicked. It will use an anchor as an element for the component
string
-
Type Value(s)
ButtonVariant 'condensed' | 'default' | 'expanded'
ButtonColor 'primary' | 'secondary' | 'muted' | 'destructive'
Usage
As a button
Simply import the component and use it in your app, without the href
property.
As an anchor
Simply import the component and use it in your app, with the href
property. If used in SvelteKit, internal links are also supported.
Previous
Bottom sheetNext
Checkbox