fma-ds

Field

Layout primitives for building form fields. Pairs with Label, Input, and friends.

FormscustomizedMITChangelogRegistry JSON

Overview

  • `Field`: the field wrapper.
  • `FieldSet`/`FieldLegend`: for grouping.
  • `FieldLabel`/`FieldDescription`/`FieldError`: the usual label + hint + error stack.
  • `FieldSeparator`: splits a group.
  • `FieldHelp`: an ⓘ button beside a label or column header that opens help in a popover (touch and keyboard, unlike a tooltip); its required label names the subject.
  • `choiceCardClassName`: the choice-card surface shared by CheckboxCard and RadioCard; hover uses accent. With react-aria the control is the card, instead of shadcn's FieldLabel wrapping a Field, which would nest labels.

Installation

  1. 1

    Register the @fma-ds namespace in components.json (once)

    components.json
    {  "registries": {    "@fma-ds": "https://ds.fmartinsandre.dev.br/r/{name}.json"  }}
  2. 2

    Add the item

    pnpm dlx shadcn@latest add @fma-ds/field

    Files land in components/fma-ds/field.tsx; npm and registry dependencies are installed along with them.

Dependencies

npm
class-variance-authority@^0.7.1cn@^0.5.0lucide-react@^1.61.0react-aria-components@^1.22.1