BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@nswds/ui/field

Field

nswds-ui/field
FreeComponent

Form field layout primitives — set, group, label, description, error, and separator slots.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/field.json

Source

src/components/field.tsxraw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/field.json · first 6 KB
1'use client'
2
3import { Field as FieldPrimitive } from '@base-ui/react/field'
4import { cva, type VariantProps } from 'class-variance-authority'
5import * as React from 'react'
6
7import { Label } from '@/components/label'
8import { Separator } from '@/components/separator'
9import { cn } from '@/lib/utils'
10
11// ─────────────────────────────────────────────────────────────────────────────
12// Base UI Field
13// ─────────────────────────────────────────────────────────────────────────────
14//
15// `Field`, `FieldLabel`, `FieldDescription`, and `FieldError` wrap Base UI's
16// Field primitive (@base-ui/react/field). Base UI owns the accessible wiring:
17// the label is associated with the control, and any description/error ids are
18// added to the control's `aria-describedby` automatically — no manual
19// `htmlFor` / `aria-describedby` / `aria-invalid` plumbing required. Set
20// `invalid` on `Field` (e.g. from react-hook-form) and the control receives
21// `aria-invalid` and the wrapper gets `data-invalid` for free.
22//
23// Base UI's Field parts must live inside a `Field.Root`. To keep the previous
24// behaviour where a label/description/error could also be used standalone
25// (e.g. a group-level FieldDescription directly inside a FieldSet), FieldLabel/
26// FieldDescription/FieldError opt into the Base UI part only when they detect a
27// surrounding `Field` (via `InsideFieldContext`) and otherwise render the plain
28// element they did before. Inside a Field they gain the automatic association;
29// outside one they are unchanged.
30//
31// `FieldSet` / `FieldLegend` stay native `<fieldset>` / `<legend>` (already
32// accessible for grouping); `FieldGroup` / `FieldContent` / `FieldSeparator` /
33// `FieldTitle` remain layout-only primitives.
34//
35// ─────────────────────────────────────────────────────────────────────────────
36// Typography hierarchy (deliberate, do not collapse to a single size)
37// … truncated

What it pulls in

npm packages

  • @base-ui/react
  • class-variance-authority
  • clsx
  • tailwind-merge

Other registry items

  • https://ui.digital.nsw.gov.au/registry/r/theme.json
  • https://ui.digital.nsw.gov.au/registry/r/label.json
  • https://ui.digital.nsw.gov.au/registry/r/separator.json

Files it writes

  • src/components/field.tsx
  • src/lib/utils.ts

Facts

Registry
@nswds/ui
Type
registry:ui
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-20
Last confirmed
today

Go to the source

ui.digital.nsw.gov.au digitalnsw/nswds-ui on GitHub Raw registry item This item as JSON

More from @nswds/ui

All 46 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Aspect Ratioaspect-ratio@nswds/uiComponentsFree2 deps · 2 files
Badgebadge@nswds/uiComponentsFree4 deps · 2 files
Buttonbutton@nswds/uiComponentsFree4 deps · 2 files
Cardcard@nswds/uiComponentsFree2 deps · 2 files
Collapsiblecollapsible@nswds/uiComponentsFree1 dep
Drawerdrawer@nswds/uiComponentsFree3 deps · 2 files
Expandable Searchexpandable-search@nswds/uiComponentsFree3 deps · 2 files
Footerfooter@nswds/uiComponentsFree3 deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored on what can be checked

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex