SwitchFields() — ui Function Reference
Architecture documentation for the SwitchFields() function in field-example.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 97092408_122c_750e_aa3d_cf5df361c401["SwitchFields()"] 0c6bcf2e_fcfc_3202_c84d_ba133cbc5e3f["field-example.tsx"] 97092408_122c_750e_aa3d_cf5df361c401 -->|defined in| 0c6bcf2e_fcfc_3202_c84d_ba133cbc5e3f style 97092408_122c_750e_aa3d_cf5df361c401 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/registry/bases/radix/examples/field-example.tsx lines 627–696
function SwitchFields() {
return (
<Example title="Switch Fields">
<FieldGroup>
<Field orientation="horizontal">
<FieldContent>
<FieldLabel htmlFor="switch-airplane">Airplane Mode</FieldLabel>
<FieldDescription>
Turn on airplane mode to disable all connections.
</FieldDescription>
</FieldContent>
<Switch id="switch-airplane" />
</Field>
<Field orientation="horizontal">
<FieldLabel htmlFor="switch-dark">Dark Mode</FieldLabel>
<Switch id="switch-dark" />
</Field>
<Field orientation="horizontal">
<Switch id="switch-marketing" />
<FieldContent>
<FieldLabel htmlFor="switch-marketing">Marketing Emails</FieldLabel>
<FieldDescription>
Receive emails about new products, features, and more.
</FieldDescription>
</FieldContent>
</Field>
<Field>
<FieldLabel>Privacy Settings</FieldLabel>
<FieldDescription>Manage your privacy preferences.</FieldDescription>
<Field orientation="horizontal">
<Switch id="switch-profile" defaultChecked />
<FieldContent>
<FieldLabel htmlFor="switch-profile" className="font-normal">
Make profile visible to others
</FieldLabel>
</FieldContent>
</Field>
<Field orientation="horizontal">
<Switch id="switch-email" />
<FieldContent>
<FieldLabel htmlFor="switch-email" className="font-normal">
Show email on profile
</FieldLabel>
</FieldContent>
</Field>
</Field>
<Field data-invalid orientation="horizontal">
<FieldContent>
<FieldLabel htmlFor="switch-invalid">Invalid Switch</FieldLabel>
<FieldDescription>
This switch has validation errors.
</FieldDescription>
</FieldContent>
<Switch id="switch-invalid" aria-invalid />
</Field>
<Field data-disabled orientation="horizontal">
<FieldContent>
<FieldLabel htmlFor="switch-disabled-field">
Disabled Switch
</FieldLabel>
<FieldDescription>
This switch is currently disabled.
</FieldDescription>
</FieldContent>
<Switch id="switch-disabled-field" disabled />
</Field>
</FieldGroup>
</Example>
)
}
Domain
Subdomains
Source
Frequently Asked Questions
What does SwitchFields() do?
SwitchFields() is a function in the ui codebase, defined in apps/v4/registry/bases/radix/examples/field-example.tsx.
Where is SwitchFields() defined?
SwitchFields() is defined in apps/v4/registry/bases/radix/examples/field-example.tsx at line 627.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free