logo-icon
STW UI

Button

Buttons allow the user to take actions or make choices.

Usage

svelte
import { Button } from 'stwui';
// OR
import Button from 'stwui/button'; // for tree shaking

With Type

link

With Loading

With Disabled

With Leading & Trailing


With Shape




With Swap



With Size



Button Props

disabled boolean false
htmlType 'button' | 'submit' | 'reset' button
loading boolean false
defaultLoading boolean true
type 'default'| 'primary' | 'danger' | 'ghost' | 'link' | 'text' | 'dark' | undefined
shape 'square' | 'circle' | 'rounded' | 'pill' rounded
size 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'fab' md
disableHover boolean false
ariaLabel string | undefined
href string | undefined

Button Slots

leading <Button.Leading slot="leading" />
icon <Button.Icon slot="icon" />
default
trailing <Button.Trailing slot="trailing" />

Button.Leading Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Button.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Button.Trailing Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Button Class Identifiers

stwui-button
stwui-button-leading-wrapper
stwui-button-icon-wrapper
stwui-button-trailing-wrapper
stwui-button-hover
stwui-button-loader