EDS4 logo
@eds/react/toggle
v0.0.0

Toggle

A control that allows the user to perform a binary action (on/off).
Prop
Required
Description
Type
label
—

Provide a label for the toggle to make it accessible and valid markup.

string
ariaLabelledBy
—

If composing a custom label, pass in the ID of the custom label that the button should be labelled by.

string
id
—

ID used for the internal label element when label is set.

string
size
—

Size options for the toggle. Defaults to medium.

string
toggled
—

Determines if the toggle should be toggled. Use along with the onClick prop when controlling the state of the toggle. Defaults to false.

boolean
disabled
—

Determines if the toggle should be disabled and prevented from being interacted with. Defaults to false.

boolean
onClick
—

Called when a toggle is clicked/toggled. Use along with the toggled prop when controlling the state of the toggle.

(isToggled: boolean) => void
block
—

Makes the toggle fill its container.