Sections
Components
- AlertBanner
- AlertDialog
- Alert
- Avatar
- Badge
- Breadcrumb
- Button
- CalendarIcon
- CellLayout
- CellLink
- Checkbox
- Collapse
- ContentSwitcher
- ControlLabel
- DatePicker
- Dialog
- Divider
- Drawer
- EmptyCell
- EmptyState
- Empty
- ErrorOverlay
- FilterBar
- FilterChips
- Flex
- GridLayout
- HumanisedDate
- Icon
- InputDuration
- InputField
- Input
- Label
- Loader
- MoreActions
- NumberInput
- OutsideClickHandler
- PageLoader
- Page
- Popconfirm
- Popover
- ProgressPie
- Progress
- RadioButtonGroup
- RadioGroup
- Radio
- RelativeTime
- Resizable
- SearchInput
- Select
- SkeletonText
- Skeleton
- Space
- SquadAvatarList
- StatusPicker
- Stepper
- Switch
- TableLight
- Tabs
- Tag
- Text
- Textarea
- Toast
- Tooltip
- TriggerSelect
- Upload
import { Switch } from "@/rl-ui";
<Switch defaultChecked />Examples#
Sizes#
import { Switch } from "@/rl-ui";
<>
<Switch size="small" defaultChecked />
<Switch size="medium" defaultChecked />
<Switch size="large" defaultChecked />
</>On / off / disabled#
import { Switch } from "@/rl-ui";
<>
<Switch />
<Switch defaultChecked />
<Switch disabled />
<Switch disabled defaultChecked />
</>API#
| Prop | Type | Default | Description |
|---|---|---|---|
size | "small" | "medium" | "large" | "medium" | Control size. |
checked | boolean | — | Controlled on state. |
defaultChecked | boolean | — | Uncontrolled initial state. |
onCheckedChange | (checked: boolean) => void | — | Change handler. |
disabled | boolean | false | Prevents interaction. |