Home / Function/ SwitchDemo() — ui Function Reference

SwitchDemo() — ui Function Reference

Architecture documentation for the SwitchDemo() function in switch-demo.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  f9a42c80_9c5f_2ac1_4408_9a6d8168791e["SwitchDemo()"]
  16e41fc8_2963_c335_f27b_81063e87322c["switch-demo.tsx"]
  f9a42c80_9c5f_2ac1_4408_9a6d8168791e -->|defined in| 16e41fc8_2963_c335_f27b_81063e87322c
  style f9a42c80_9c5f_2ac1_4408_9a6d8168791e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/app/(internal)/sink/components/switch-demo.tsx lines 4–45

export function SwitchDemo() {
  return (
    <div className="flex flex-col gap-6">
      {/* Sizes. */}
      <div className="flex items-center gap-4">
        <div className="flex items-center gap-2">
          <Switch id="switch-demo-sm" size="sm" />
          <Label htmlFor="switch-demo-sm">Small</Label>
        </div>
        <div className="flex items-center gap-2">
          <Switch id="switch-demo-default" />
          <Label htmlFor="switch-demo-default">Default</Label>
        </div>
      </div>
      <div className="flex items-center gap-2">
        <Switch id="switch-demo-airplane-mode" />
        <Label htmlFor="switch-demo-airplane-mode">Airplane Mode</Label>
      </div>
      <div className="flex items-center gap-2">
        <Switch
          id="switch-demo-bluetooth"
          className="data-[state=checked]:bg-blue-500 dark:data-[state=checked]:bg-blue-600"
          defaultChecked
        />
        <Label htmlFor="switch-demo-bluetooth">Bluetooth</Label>
      </div>
      <Label className="flex items-center gap-6 rounded-lg border p-4 has-[[data-state=checked]]:border-blue-600">
        <div className="flex flex-col gap-1">
          <div className="font-medium">Share across devices</div>
          <div className="text-muted-foreground text-sm font-normal">
            Focus is shared across devices, and turns off when you leave the
            app.
          </div>
        </div>
        <Switch
          id="switch-demo-focus-mode"
          className="data-[state=checked]:bg-blue-500 dark:data-[state=checked]:bg-blue-600"
        />
      </Label>
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does SwitchDemo() do?
SwitchDemo() is a function in the ui codebase, defined in apps/v4/app/(internal)/sink/components/switch-demo.tsx.
Where is SwitchDemo() defined?
SwitchDemo() is defined in apps/v4/app/(internal)/sink/components/switch-demo.tsx at line 4.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free