Skip to components
DEVELOPER REFERENCE · v4.0.0

ToggleButton API

Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.

ToggleButton9 props1 callbacks0 methods

Props9

ToggleButton props
NameTypeDescription
roundedOptionalboolean | undefinedPill-shaped corners for any button variant.
hrefOptionalstring | undefinedRender navigation with native anchor semantics.
targetOptional
h.JSX.Signalish<h.JSX.HTMLAttributeAnchorTarget | undefined>Inspect type
Browsing context used when a button renders a link, for example _blank.
relOptionalstring | undefinedLink relationship tokens, such as noopener, when the button has an href.
busyOptionalboolean | undefinedShow progress and block activation until cleared, preserving variant colors.
classNameOptionalstring | undefinedAdditional CSS classes applied to the component root.
variantOptional"link" | "ghost" | "solid" | "default" | "primary" | "secondary" | "danger" | "danger-outline" | undefinedSelects the visual action style without changing the action behavior.
sizeOptional"default" | "compact" | undefinedVisual size of this component; numeric icon/avatar sizes are in pixels, while controls use the declared named sizes.
pressedRequiredbooleanControlled pressed state of the toggle button.

Events and callbacks1

ToggleButton events and callbacks
NameTypeDescription
onPressedChangeRequired
(value: boolean) => voidInspect type
Receives the new pressed state when the toggle is activated.

Methods0

No component-specific imperative methods. Use props and callbacks to control this component.

Inherited HTML props and events328