Home / File/ radio-group-demo.tsx — ui Source File

radio-group-demo.tsx — ui Source File

Architecture documentation for radio-group-demo.tsx, a tsx file in the ui codebase. 2 imports, 1 dependents.

File tsx DocumentationAtlas SearchAPI 2 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  3d444514_c4a9_b43e_dda5_ca3a0e8413aa["radio-group-demo.tsx"]
  d752035b_6ed3_c6ef_e27c_eef51af9ec8d["label"]
  3d444514_c4a9_b43e_dda5_ca3a0e8413aa --> d752035b_6ed3_c6ef_e27c_eef51af9ec8d
  a3246e53_c55c_1cf0_424d_b2142e1739ab["radio-group"]
  3d444514_c4a9_b43e_dda5_ca3a0e8413aa --> a3246e53_c55c_1cf0_424d_b2142e1739ab
  1c2403dc_4584_9f39_4e98_855a7de18bd1["component-registry.ts"]
  1c2403dc_4584_9f39_4e98_855a7de18bd1 --> 3d444514_c4a9_b43e_dda5_ca3a0e8413aa
  style 3d444514_c4a9_b43e_dda5_ca3a0e8413aa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { Label } from "@/registry/new-york-v4/ui/label"
import {
  RadioGroup,
  RadioGroupItem,
} from "@/registry/new-york-v4/ui/radio-group"

const plans = [
  {
    id: "starter",
    name: "Starter Plan",
    description:
      "Perfect for small businesses getting started with our platform",
    price: "$10",
  },
  {
    id: "pro",
    name: "Pro Plan",
    description: "Advanced features for growing businesses with higher demands",
    price: "$20",
  },
] as const

export function RadioGroupDemo() {
  return (
    <div className="flex flex-col gap-6">
      <RadioGroup defaultValue="comfortable">
        <div className="flex items-center gap-3">
          <RadioGroupItem value="default" id="r1" />
          <Label htmlFor="r1">Default</Label>
        </div>
        <div className="flex items-center gap-3">
          <RadioGroupItem value="comfortable" id="r2" />
          <Label htmlFor="r2">Comfortable</Label>
        </div>
        <div className="flex items-center gap-3">
          <RadioGroupItem value="compact" id="r3" />
          <Label htmlFor="r3">Compact</Label>
        </div>
      </RadioGroup>
      <RadioGroup defaultValue="starter" className="max-w-sm">
        {plans.map((plan) => (
          <Label
            className="hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-4 has-[[data-state=checked]]:border-green-600 has-[[data-state=checked]]:bg-green-50 dark:has-[[data-state=checked]]:border-green-900 dark:has-[[data-state=checked]]:bg-green-950"
            key={plan.id}
          >
            <RadioGroupItem
              value={plan.id}
              id={plan.name}
              className="shadow-none data-[state=checked]:border-green-600 data-[state=checked]:bg-green-600 *:data-[slot=radio-group-indicator]:[&>svg]:fill-white *:data-[slot=radio-group-indicator]:[&>svg]:stroke-white"
            />
            <div className="grid gap-1 font-normal">
              <div className="font-medium">{plan.name}</div>
              <div className="text-muted-foreground leading-snug">
                {plan.description}
              </div>
            </div>
          </Label>
        ))}
      </RadioGroup>
    </div>
  )
}

Subdomains

Functions

Dependencies

  • label
  • radio-group

Frequently Asked Questions

What does radio-group-demo.tsx do?
radio-group-demo.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in radio-group-demo.tsx?
radio-group-demo.tsx defines 1 function(s): RadioGroupDemo.
What does radio-group-demo.tsx depend on?
radio-group-demo.tsx imports 2 module(s): label, radio-group.
What files import radio-group-demo.tsx?
radio-group-demo.tsx is imported by 1 file(s): component-registry.ts.
Where is radio-group-demo.tsx in the architecture?
radio-group-demo.tsx is located at apps/v4/app/(internal)/sink/components/radio-group-demo.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/app/(internal)/sink/components).

Analyze Your Own Codebase

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

Try Supermodel Free