Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

Button

Every pressable action, in six variants and three sizes.

import { Button } from '@loidolt/theme-svelte';

Example

Link

Notes

  • With href it renders an <a> and accepts anchor attributes; without one, a <button>. Button-only attributes on a link are a type error rather than silent junk.
  • loading disables the press and announces through a persistently-mounted live region — a region mounted alongside its message is silent in most screen readers.
  • variant="text" replaces the former TextButton.

Props

Generated from the component source, so it cannot drift from the implementation.

Button props
PropTypeDefaultNotes
children required Snippet—
class string—
disabled booleanfalse
href string—Renders an <a> styled as a button.
loading booleanfalse
loadingLabel string'Loading'Announced while loading when there is no visible loadingText.
loadingText string—Visible text swapped in while loading.
ref bindableHTMLButtonElement | HTMLAnchorElement | nullnull
size ControlSize'md'
type never'button'
variant ActionVariant'default'

Plus the attributes of Omit<HTMLAnchorAttributes, 'class' | 'type'>andOmit<HTMLButtonAttributes, 'class'>, forwarded to the root element.