Home / Function/ SelectPlan() — ui Function Reference

SelectPlan() — ui Function Reference

Architecture documentation for the SelectPlan() function in select-example.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  2ce33a04_e180_2e50_c25a_6a0db3900721["SelectPlan()"]
  45dbd80e_4241_7e94_2ac4_8c9f125488aa["select-example.tsx"]
  2ce33a04_e180_2e50_c25a_6a0db3900721 -->|defined in| 45dbd80e_4241_7e94_2ac4_8c9f125488aa
  style 2ce33a04_e180_2e50_c25a_6a0db3900721 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/bases/radix/examples/select-example.tsx lines 482–507

function SelectPlan() {
  const [plan, setPlan] = React.useState<string>(plans[0].name)

  const selectedPlan = plans.find((p) => p.name === plan)

  return (
    <Example title="Subscription Plan">
      <Select value={plan} onValueChange={setPlan}>
        <SelectTrigger className="h-auto! w-72">
          <SelectValue>
            {selectedPlan && <SelectPlanItem plan={selectedPlan} />}
          </SelectValue>
        </SelectTrigger>
        <SelectContent>
          <SelectGroup>
            {plans.map((plan) => (
              <SelectItem key={plan.name} value={plan.name}>
                <SelectPlanItem plan={plan} />
              </SelectItem>
            ))}
          </SelectGroup>
        </SelectContent>
      </Select>
    </Example>
  )
}

Subdomains

Frequently Asked Questions

What does SelectPlan() do?
SelectPlan() is a function in the ui codebase, defined in apps/v4/registry/bases/radix/examples/select-example.tsx.
Where is SelectPlan() defined?
SelectPlan() is defined in apps/v4/registry/bases/radix/examples/select-example.tsx at line 482.

Analyze Your Own Codebase

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

Try Supermodel Free