Home / File/ switch.tsx — ui Source File

switch.tsx — ui Source File

Architecture documentation for switch.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  0bb9b01b_fb14_dfa7_83b0_4964ae04fee0["switch.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  0bb9b01b_fb14_dfa7_83b0_4964ae04fee0 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"]
  0bb9b01b_fb14_dfa7_83b0_4964ae04fee0 --> 9c463da6_747b_38dc_586b_cbb4873070b1
  ef4051f4_aeb7_8d0c_a726_0ba96ad80cf6["utils"]
  0bb9b01b_fb14_dfa7_83b0_4964ae04fee0 --> ef4051f4_aeb7_8d0c_a726_0ba96ad80cf6
  style 0bb9b01b_fb14_dfa7_83b0_4964ae04fee0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Switch as SwitchPrimitive } from "radix-ui"

import { cn } from "@/registry/bases/radix/lib/utils"

function Switch({
  className,
  size = "default",
  ...props
}: React.ComponentProps<typeof SwitchPrimitive.Root> & {
  size?: "sm" | "default"
}) {
  return (
    <SwitchPrimitive.Root
      data-slot="switch"
      data-size={size}
      className={cn(
        "cn-switch peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",
        className
      )}
      {...props}
    >
      <SwitchPrimitive.Thumb
        data-slot="switch-thumb"
        className="cn-switch-thumb pointer-events-none block ring-0 transition-transform"
      />
    </SwitchPrimitive.Root>
  )
}

export { Switch }

Subdomains

Functions

Dependencies

  • radix-ui
  • react
  • utils

Frequently Asked Questions

What does switch.tsx do?
switch.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in switch.tsx?
switch.tsx defines 1 function(s): Switch.
What does switch.tsx depend on?
switch.tsx imports 3 module(s): radix-ui, react, utils.
Where is switch.tsx in the architecture?
switch.tsx is located at apps/v4/registry/bases/radix/ui/switch.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/bases/radix/ui).

Analyze Your Own Codebase

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

Try Supermodel Free