GitHub

Reference headless

button

interface 2 type 1 function 1
interface Interfaces 2

# ButtonController

Members

disabled
readonly disabled: boolean
id
readonly id: string
loading
readonly loading: boolean
root
readonly root: Attachment

Svelte 5 {@attach}-compatible attachment for the host element.

setDisabled()
setDisabled(disabled): void

###### Parameters

###### disabled

boolean

###### Returns

void

setLoading()
setLoading(loading): void

###### Parameters

###### loading

boolean

###### Returns

void

subscribe()
subscribe(listener): () => void

Subscribe to (loading | disabled) state changes.

###### Parameters

###### listener

(snapshot) => void

###### Returns

() => void

# CreateButtonOptions

Members

disabled?
optional disabled?: boolean
id?
optional id?: string
loading?
optional loading?: boolean
type Type Aliases 1

# Attachment

Attachment = (node) => void | (() => void)

Parameters

node
HTMLElement

Returns

void | (() => void)
function Functions 1

# createButton ( )

createButton(options?): ButtonController

Create a Button controller plus its {@attach}-compatible root.

Parameters

options?
CreateButtonOptions = {}

Returns

ButtonController