primitives/@mihcm/ui·v0.21.0·stable
Switch
Controlled on/off toggle. role="switch" with aria-checked driven by checked.
Live preview
Adjust the controls on the right; the preview and code update in real time.
example.tsxtsx
import { Switch } from '@mihcm/ui/Switch';
export function Example() {
return (
<Switch
size="md"
tone="accent"
></Switch>
);
}Install
Both paths are valid. CLI ships the source into your repo (you own it). Install pins via npm.
npx @mihcm/cli add SwitchCopies the source into
components/ds/Switch.tsx. You own the file. Use --out to override the directory or --force to overwrite.