Lewati ke konten

Toggle - React

Toggle

banner-background
import { Toggle } from '@idds/react';
Small
Medium (checked)
Disabled
Custom Color (#7F56D9)
NameTypeDefaultRequiredDescription
checked?booleanNoWhether the toggle is checked/on (controlled mode).
defaultChecked?booleanfalseNoDefault checked state (for uncontrolled mode).
disabled?booleanfalseNoWhether the toggle is disabled.
color?stringNoCustom color for the toggle when checked (hex, rgb, or named color).
size?'sm' | 'md''md'NoSize variant of the toggle.
onChange?(checked: boolean) => voidNoCallback fired when the toggle state changes.
className?stringNoAdditional CSS class name.
aria-label?stringNoARIA label for accessibility.
aria-describedby?stringNoARIA describedby for accessibility.
id?stringNoHTML id attribute.
name?stringNoHTML name attribute for form submission.
value?stringNoHTML value attribute for form submission.