base-ui-svelte

Button

A clickable button that supports native and polymorphic rendering.

View as Markdown

Variants (class names)

Sizes

States

API Reference

Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.

Button

A button component that can be used to trigger actions. Renders a <button> element.

Props

disabled boolean false
Description

Whether the control ignores user interaction.

Type
boolean
Default
false
focusableWhenDisabled boolean false
Description

Whether the control remains focusable when disabled.

Type
boolean
Default
false
render string —
Name
render
Description

HTML element tag to render. Defaults to button.

Type
string
type 'button' | 'submit' | 'reset' —
Name
type
Description

Defaults to button. Set submit explicitly for form submit buttons.

Type
'button' | 'submit' | 'reset' | undefined
children snippet —
Description

Content rendered inside the part.

Type
Snippet<[{ disabled: boolean }]>

Data attributes

AttributeDescription
data-disabledPresent when the button is disabled.