Switch

A block that slides across a cut track and lights, with its state printed beside it.

Component

Switch belongs to the Choices group in the CyberSpec catalog. It uses @ui-sdk/react/switch.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/switch.json

Example

"use client"

import { Switch } from "@/components/ui/switch"

export default function SwitchDemo() {
  return (
    <>
      <Switch label="Optic overlay" defaultChecked />
      <Switch label="Stealth routing" />
      <Switch label="Uplink" disabled />
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/switch-demo.json

Resources

View as Markdown