UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

28 lines (27 loc) 776 B
import { Switch as SwitchPrimitive } from 'radix-ui'; import { ComponentProps } from 'react'; /** * A switch component for toggling between two states. * Built on top of [radix-ui Switch](https://www.radix-ui.com/primitives/docs/components/switch). * * @example * ```tsx * // Basic usage * <Switch checked={isEnabled} onCheckedChange={setIsEnabled} /> * ``` * * @example * ```tsx * // With label * <SideLabel label="Enable notifications"> * <Switch checked={notificationsEnabled} onCheckedChange={setNotificationsEnabled} /> * </SideLabel> * ``` * * @example * ```tsx * // Disabled state * <Switch disabled /> * ``` */ export declare const Switch: ({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) => import("react").JSX.Element;