跳到正文
Linasan UI

Switch 开关

开 / 关。StatusSwitch 在旁边显示状态文字。

正常

安装

pnpm dlx shadcn@latest add https://docs.linasan.cn/r/switch.json

第一次装本站的组件前先在项目里执行一次 shadcn init,详见 安装。

用法

import { StatusSwitch, Switch } from '@/components/ui/switch';

<StatusSwitch checked={user.enabled} onCheckedChange={toggle} />

属性

属性

类型

本页目录