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

Extends HTML element attributes.

PropertyTypeDefaultDescription
disabledbooleanfalseWhether the control ignores user interaction.
focusableWhenDisabledbooleanfalseWhether the control remains focusable when disabled.
renderstringHTML element tag to render. Defaults to `button`.
type'button' | 'submit' | 'reset' | undefinedDefaults to `button`. Set `submit` explicitly for form submit buttons.
childrenSnippet<[{ disabled: boolean }]>Content rendered inside the part.
Data attributeDescription
data-disabledPresent when the part is disabled.