eds-switch

Explore the Interactive Component

Use the playground below to experiment with the component. Click the button to view the full Storybook deployment for additional examples and configurations.

See It in Use with Code

Check out this practical implementation of component.

Plain HTML

In React

Properties

PropertyAttributeDescriptionTypeDefault
checkedcheckedIndicates whether the switch is checked.booleanfalse
disableddisabledDisables the switch if true.booleanfalse
labelOfflabel-offLabel to display when the switch is OFF.string''
labelOnlabel-onLabel to display when the switch is ON.string''
variantvariantVariant of the switch: ’toggle’ (default) or ‘segmented’ (pill-style buttons)"segmented" | "toggle"'toggle'

Events

EventDescriptionType
uiswitchEmitted when the switch is toggled.CustomEvent<{ value: boolean; }>

Dependencies

Used by

Graph

graph TD;
  eds-table --> eds-switch
  style eds-switch fill:#f9f,stroke:#333,stroke-width:4px

Built with StencilJS