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
  77975737_bffe_b8da_7e97_3c00fd2af213["ToggleGroupFontWeightSelector()"]
  9fc0f706_aa70_76ce_b06c_0b2371ed7fb8["toggle-group-font-weight-selector.tsx"]
  77975737_bffe_b8da_7e97_3c00fd2af213 -->|defined in| 9fc0f706_aa70_76ce_b06c_0b2371ed7fb8
  style 77975737_bffe_b8da_7e97_3c00fd2af213 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/toggle-group-font-weight-selector.tsx lines 7–61

export function ToggleGroupFontWeightSelector() {
  const [fontWeight, setFontWeight] = React.useState("normal")
  return (
    <Field>
      <FieldLabel>Font Weight</FieldLabel>
      <ToggleGroup
        value={[fontWeight]}
        onValueChange={(value) => setFontWeight(value[0])}
        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/base/toggle-group-font-weight-selector.tsx.
Where is ToggleGroupFontWeightSelector() defined?
ToggleGroupFontWeightSelector() is defined in apps/v4/examples/base/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