Skip to content

ButtonOptions

Defined in: components/button.ts:5

Options for button.

optional content?: Slot

Defined in: components/button.ts:7

Button content: a string for plain text, or a function for custom markup.


optional icon?: Slot

Defined in: components/button.ts:9

Leading icon/adornment, drawn before the label.


optional click?: (event) => void

Defined in: components/button.ts:11

Click handler.

Event

void


optional disabled?: boolean

Defined in: components/button.ts:13

Disables the button.


optional type?: "button" | "submit" | "reset"

Defined in: components/button.ts:15

Native button behaviour. Defaults to "button".


optional href?: string

Defined in: components/button.ts:17

Render as a link (<a role=button>) pointing here instead of a <button>.


optional ariaLabel?: string

Defined in: components/button.ts:19

Accessible label, when the button has only an icon.


optional attrs?: string

Defined in: components/button.ts:30

Aberdeen attr/style string applied to the button. A button is a surface, so pass surface modifier classes here to restyle it, e.g. ".danger", ".danger .outlined", or ".neutral" for a neutral button. Defaults to a filled .primary surface.

Size is set here too, with .small or .large (medium is the default and needs no class), e.g. ".danger .small". A .small/.large parent (such as a buttonGroup) also sizes its buttons, so you can set it once.