Home / File/ switch.tsx — ui Source File

switch.tsx — ui Source File

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

File tsx ComponentRegistry UIPrimitives 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  7458acf2_2798_88f6_90dc_2f4c4a3ef9e7["switch.tsx"]
  1f3630eb_9348_92e5_a98d_b3202f89783c["switch"]
  7458acf2_2798_88f6_90dc_2f4c4a3ef9e7 --> 1f3630eb_9348_92e5_a98d_b3202f89783c
  8ad666ec_1b20_adda_0392_87a60bdb3a68["utils"]
  7458acf2_2798_88f6_90dc_2f4c4a3ef9e7 --> 8ad666ec_1b20_adda_0392_87a60bdb3a68
  style 7458acf2_2798_88f6_90dc_2f4c4a3ef9e7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Switch as SwitchPrimitive } from "@base-ui/react/switch"

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

function Switch({
  className,
  size = "default",
  ...props
}: SwitchPrimitive.Root.Props & {
  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

  • switch
  • 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, UIPrimitives subdomain.
What functions are defined in switch.tsx?
switch.tsx defines 1 function(s): Switch.
What does switch.tsx depend on?
switch.tsx imports 2 module(s): switch, utils.
Where is switch.tsx in the architecture?
switch.tsx is located at apps/v4/registry/bases/base/ui/switch.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/ui).

Analyze Your Own Codebase

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

Try Supermodel Free