Skip to content
bahtuiv0.6.0

<baht-button>

Design-system button. Variants + sizes via attributes; content via children or label.

Variants

PrimarySecondaryGhostDanger
<baht-button variant="primary">Primary</baht-button>
<baht-button variant="secondary">Secondary</baht-button>
<baht-button variant="ghost">Ghost</baht-button>
<baht-button variant="danger">Danger</baht-button>

Sizes

SmallMediumLarge
<baht-button size="sm">Small</baht-button>
<baht-button size="md">Medium</baht-button>
<baht-button size="lg">Large</baht-button>

With icon

CopyExportImportAdd field

Curated icon set: copy, check, download, upload, plus, external, close, play. Icons inherit the button color.

<baht-button icon="copy" variant="secondary">Copy</baht-button>
<baht-button icon="download">Export</baht-button>
<baht-button icon="upload" variant="ghost">Import</baht-button>
<baht-button icon="plus">Add field</baht-button>

Icon-only (needs label for a11y)

label becomes the aria-label. Required, since there is no visible text.

<baht-button icon="close" icon-only="true" label="Close" variant="ghost"></baht-button>
<baht-button icon="copy" icon-only="true" label="Copy" variant="secondary"></baht-button>
<baht-button icon="plus" icon-only="true" label="Add"></baht-button>

Disabled

Can’t touch this
<baht-button disabled="true">Can’t touch this</baht-button>
NameTypeDefaultDescription
variantButtonVariant'primary'Visual style (primary | secondary | ghost | danger)
sizeButtonSize'md'Button size (sm | md | lg)
disabledbooleanfalseDisable
type'button' | 'submit''button'Native button type (button | submit)
labelstring''Text alternative to children / a11y name for icon-only
iconIconName | ''''Optional leading icon (copy | check | download | upload | plus | external | close | play)
icon-onlybooleanfalseSquare icon button; set label for the accessible name
EventdetailDescription
nameCustomEvent
clickMouseEventNative click
SlotDescription
(default)Button content