Home / Function/ ToggleGroupFontWeightSelector() — ui Function Reference

ToggleGroupFontWeightSelector() — ui Function Reference

Architecture documentation for the ToggleGroupFontWeightSelector() function in toggle-group-font-weight-selector.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  49de9744_5d27_aff0_a119_338c644b5d2d["ToggleGroupFontWeightSelector()"]
  3a4f16fd_6154_2934_05c4_0b83c94ab766["toggle-group-font-weight-selector.tsx"]
  49de9744_5d27_aff0_a119_338c644b5d2d -->|defined in| 3a4f16fd_6154_2934_05c4_0b83c94ab766
  style 49de9744_5d27_aff0_a119_338c644b5d2d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/toggle-group-font-weight-selector.tsx lines 7–62

export function ToggleGroupFontWeightSelector() {
  const [fontWeight, setFontWeight] = React.useState("normal")
  return (
    <Field>
      <FieldLabel>Font Weight</FieldLabel>
      <ToggleGroup
        type="single"
        value={fontWeight}
        onValueChange={(value) => setFontWeight(value)}
        variant="outline"
        spacing={2}
        size="lg"
      >
        <ToggleGroupItem
          value="light"
          aria-label="Light"
          className="flex size-16 flex-col items-center justify-center rounded-xl"
        >
          <span className="text-2xl leading-none font-light">Aa</span>
          <span className="text-muted-foreground text-xs">Light</span>
        </ToggleGroupItem>
        <ToggleGroupItem
          value="normal"
          aria-label="Normal"
          className="flex size-16 flex-col items-center justify-center rounded-xl"
        >
          <span className="text-2xl leading-none font-normal">Aa</span>
          <span className="text-muted-foreground text-xs">Normal</span>
        </ToggleGroupItem>
        <ToggleGroupItem
          value="medium"
          aria-label="Medium"
          className="flex size-16 flex-col items-center justify-center rounded-xl"
        >
          <span className="text-2xl leading-none font-medium">Aa</span>
          <span className="text-muted-foreground text-xs">Medium</span>
        </ToggleGroupItem>
        <ToggleGroupItem
          value="bold"
          aria-label="Bold"
          className="flex size-16 flex-col items-center justify-center rounded-xl"
        >
          <span className="text-2xl leading-none font-bold">Aa</span>
          <span className="text-muted-foreground text-xs">Bold</span>
        </ToggleGroupItem>
      </ToggleGroup>
      <FieldDescription>
        Use{" "}
        <code className="bg-muted rounded-md px-1 py-0.5 font-mono">
          font-{fontWeight}
        </code>{" "}
        to set the font weight.
      </FieldDescription>
    </Field>
  )
}

Subdomains

Frequently Asked Questions

What does ToggleGroupFontWeightSelector() do?
ToggleGroupFontWeightSelector() is a function in the ui codebase, defined in apps/v4/examples/radix/toggle-group-font-weight-selector.tsx.
Where is ToggleGroupFontWeightSelector() defined?
ToggleGroupFontWeightSelector() is defined in apps/v4/examples/radix/toggle-group-font-weight-selector.tsx at line 7.

Analyze Your Own Codebase

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

Try Supermodel Free