Switch

Designer doc
Switch component is used to toggle between two states.

Example

Default
Disabled
Disabled checked
Custom size
Custom content
Off
View code

References

API

Switch
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
checkedboolean
disabledboolean
Equivalent to button's disabled property.
initialCheckedboolean
keyboardClickKeysstring[][' ']
onBlurFocusEventHandler<HTMLDivElement>
onChange(checked: boolean) => void
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
sizenumber20
    Example
    Example
    References
    References
    API
    API
    Switch
    Switch
Coral is a thoroughly developed design system widely adopted by developers and designers for creating beautiful and user-friendly Sea internal products.

Copyright © 2018-2025 Sea Labs