On this page

InstallationUsageWhat it isAnatomyOrientationA switch for the whole groupWhile it is offOn the title's lineWhat it holdsKeyboard and screen readersAPI ReferenceFieldGroupRulesDecidedOpen questionsOther systems

Field group

Several fields under one title, with a line of help and, when the whole set can be turned on or off, a switch before the title.

Act-as verification

Check who an agent says it acts for.

Issuer URL

Where its tokens come from.

Audience
1<FieldGroup title="Act-as verification" description="Check who an agent says it acts for." switch={{ defaultChecked: true }}>2  <Field title="Issuer URL" description="Where its tokens come from.">3    <Input placeholder="https://login.example.com" />4  </Field>5  <Field title="Audience">6    <Input placeholder="api://dome" />7  </Field>8</FieldGroup>

Installation

import { Field, FieldGroup } from "@catalog-developer/components";

Usage

import { Field, FieldGroup, Input } from "@catalog-developer/components";
<FieldGroup title="Act-as verification" description="Check who an agent says it acts for." switch={{ defaultChecked: true }}>
  <Field title="Issuer URL" description="Where its tokens come from.">
    <Input placeholder="https://login.example.com" />
  </Field>
  <Field title="Audience">
    <Input placeholder="api://dome" />
  </Field>
</FieldGroup>

What it is

Several Fields under one title, or the fields one switch opens. The Fields sit in a fieldset named by the group's title. In the dashboard today there are five, all behind a switch: on an agent's form and its verification settings, and on the gateway form.

Anatomy

Verification Preview

Check who it acts for.

Issuer URL
123456
  1. 1 — Switch. switch. Turns the whole group on or off. 8px before the title.
  2. 2 — Title. 13px medium, a Field title's size.
  3. 3 — Info icon. iconTooltip.
  4. 4 — Badges. badge, one or several, drawn as given (md, 20px, here).
  5. 5 — Description. 13px, in the secondary text color, under the title's text.
  6. 6 — Fields. 12px apart when stacked, starting under the title's text. As rows, a rule between them, and only their titles are indented.

Orientation

vertical, the default, stacks the Fields under the title, each its title over its control. horizontal makes them setting rows, as in a Card: each title beside its control, a rule between rows, each row padding itself. The Fields take the group's orientation unless one names its own. The group draws no box; several groups in one card are on the Card page (Settings groups).

Act-as verification

Check who an agent says it acts for.

Issuer URL

Where its tokens come from.

Audience
Act-as verification

Check who an agent says it acts for.

Issuer URL

Where its tokens come from.

Audience
1<FieldGroup title="Act-as verification" description="Check who an agent says it acts for.">2  <Field title="Issuer URL" description="Where its tokens come from.">3    <Input placeholder="https://login.example.com" />4  </Field>5  <Field title="Audience">6    <Input placeholder="api://dome" />7  </Field>8</FieldGroup>9 10<FieldGroup orientation="horizontal" title="Act-as verification" description="Check who an agent says it acts for.">11  <Field title="Issuer URL" description="Where its tokens come from.">12    <Input placeholder="https://login.example.com" />13  </Field>14  <Field title="Audience">15    <Input placeholder="api://dome" />16  </Field>17</FieldGroup>

A switch for the whole group

switch puts a Switch before the title, named by the title, that turns the group on or off. It takes the Switch's own props (checked and onCheckedChange, or defaultChecked to leave it to itself). It is md unless it names its size, and the Fields start under the title's text, past the switch. Turn this one off.

Act-as verification

Check who an agent says it acts for.

Issuer URL

Where its tokens come from.

Audience
1<FieldGroup title="Act-as verification" description="Check who an agent says it acts for." switch={{ defaultChecked: true }}>2  <Field title="Issuer URL" description="Where its tokens come from.">3    <Input placeholder="https://login.example.com" />4  </Field>5  <Field title="Audience">6    <Input placeholder="api://dome" />7  </Field>8</FieldGroup>

While it is off

off="disable", the default, keeps the Fields on the page, dimmed and out of reach. off="hide" removes them, leaving the title and its switch. Both groups here start off.

Act-as verification

Dimmed while off.

Issuer URL

Where its tokens come from.

Audience
Act-as verification

Hidden while off.

1<FieldGroup title="Act-as verification" description="Dimmed while off." switch={{ defaultChecked: false }} off="disable">2  <Field title="Issuer URL" description="Where its tokens come from.">3    <Input placeholder="https://login.example.com" />4  </Field>5  <Field title="Audience">6    <Input placeholder="api://dome" />7  </Field>8</FieldGroup>9<FieldGroup title="Act-as verification" description="Hidden while off." switch={{ defaultChecked: false }} off="hide">10  <Field title="Issuer URL" description="Where its tokens come from.">11    <Input placeholder="https://login.example.com" />12  </Field>13  <Field title="Audience">14    <Input placeholder="api://dome" />15  </Field>16</FieldGroup>

On the title's line

iconTooltip puts an info icon after the title, and badge one Badge or several after it. description is a line of help under the title. The group draws a badge as it is given: a Badge is 24px unless it names its size, and this one passes md (20px). When the line is full, the badges go under the title.

Sign-in with Dome Preview

Lets people use this agent by signing in.

Allowed emails

Who may sign in.

1<FieldGroup2  title="Sign-in with Dome"3  description="Lets people use this agent by signing in."4  iconTooltip="Each person signs in once per device."5  badge={<Badge color="fuchsia" size="md">Preview</Badge>}6  switch={{ defaultChecked: true }}7>8  <Field title="Allowed emails" description="Who may sign in.">9    <Input placeholder="you@example.com" />10  </Field>11</FieldGroup>

What it holds

Fields, each around any control a Field takes. A group can also hold no Field at all: its title and switch alone, while it has nothing to show.

Act-as verification
Issuer URL
Accept tokens from
1<FieldGroup title="Act-as verification" switch={{ defaultChecked: true }}>2  <Field title="Issuer URL">3    <Input placeholder="https://login.example.com" />4  </Field>5  <Field title="Accept tokens from" htmlFor={null}>6    <CheckboxGroup aria-label="Accept tokens from" defaultValue={["id"]}>7      <Checkbox value="id">ID tokens</Checkbox>8      <Checkbox value="access">Access tokens</Checkbox>9    </CheckboxGroup>10  </Field>11</FieldGroup>

Keyboard and screen readers

This is read from the markup. It has not been tested with a screen reader.

A named group. The Fields sit in a fieldset labelled by the group's title and described by its description.

The switch. It is labelled by the group's title. Tab reaches it before the fields; Space or Enter turns it.

Off. While the switch is off the fieldset is disabled and inert: Tab skips every field in it, a pointer cannot press them, and a screen reader does not read them. With off="hide" the fields are not on the page at all. Nothing moves the focus when the group is turned on.

The info icon. A button, reached by Tab. With a text title it is named after it ("Act-as verification details"); otherwise "Details".

API Reference

FieldGroup

Besides these, every prop of a <div>. In a horizontal group each Field is a card's row (row) without saying so.

PropTypeDefaultDescription
titleReactNode—Names the group. Every group has one.
childrenReactNode—The Fields. None, for a title and switch alone while the group has nothing to show.
orientation"vertical" | "horizontal""vertical"The Fields stacked under the title, or setting rows with a rule between them.
descriptionReactNode—A line of help under the title.
iconTooltipstring | TooltipSettings—An info icon after the title that explains the group on hover or focus.
badgeReactNode—After the title, on its line: one Badge or several, drawn as given.
switchSwitchProps—A switch before the title that turns the group on or off. The Switch's props, without aria-label and aria-labelledby: the title names it. md unless it names its size.
off"disable" | "hide""disable"While the switch is off: the Fields dim and cannot be used, or are removed.

Rules

Decided

Notify the owner
Email
DoThe switch turns on something with fields of its own.
Notify the owner

Once a day at most.

Don’tA switch that is the row's only control, drawn as a group.

A group's switch opens fields

Decided with the form controls: a switch that is a row's only control is not a group; a FieldGroup is for a switch that opens fields. A group whose fields are hidden while it is off still shows its title and switch alone.

The title is a Field title's size

Decided with the form controls: a group's title is 13px medium in both orientations. It leads by its place, not its size.

The group draws no box

Decided with the form controls: the FieldGroup is the group alone, and the Card is its own part.

Open questions

None of these is decided for us.

Off: dim the fields, or hide them?

Open
Ours

Both exist and disable is the default. All five of the dashboard's groups hide. Nothing says when to pick which.

Other systems

None of the pages read has a switch on a group. Primer and Atlassian show or hide fields that depend on a checkbox or a radio; none dims them.

A group that is off for another reason?

Open
Ours

A group is disabled only by its own switch.

Other systems

Base UI's fieldset can be disabled by itself, which disables every control in it.

What is a group's title?

Open
Ours

No rule. Today's titles are phrases: Restrict who can act as this agent, Enable a default OAuth agent.

Other systems

Atlassian: a section of a form gets a concise title, and a short description if it needs one.

Groups inside groups, and columns?

Open
Ours

No rule. No group in the dashboard sits inside another, and none sets its fields in columns.

Other systems

shadcn has a smaller legend for a fieldset inside a fieldset. Atlassian: one column, which is easier to follow, and a second one can be missed with a screen magnifier. Primer: fields stacked by default.

Other systems

Read for this page: shadcn's Field page (its FieldSet, FieldLegend, FieldGroup and FieldSeparator); Base UI's Fieldset page and its source in the Base UI repository; Atlassian's Form pages (examples, usage and code); GitHub Primer's forms pattern and Form control pages; and the list of Shopify Polaris's web components on shopify.dev, which has no group of fields (the React pages now redirect there). shadcn, Base UI and Atlassian name a fieldset by its title; shadcn also puts a description under it. None has a switch on a group built in. What the open questions above cover is left out.

They exposeOursWhy
A form section above the fieldset, with a title and a description; the form itself has a header and a footer (Atlassian)AskNot built.
A rule between fields as its own part, with optional content in it (shadcn)AskNot built: a horizontal group rules its own rows.
Catalog
Foundations
  • Overview
  • Components
  • Tokens
  • Token usage
  • Typography
  • Icons
Atoms
  • Avatar
  • Badge
  • Button
  • Checkbox
  • Color picker
  • Copy button
  • Icon tooltip
  • Inline code
  • Input
  • Hint
  • Kbd
  • Loader
  • Native select
  • Progress bar
  • Progress ring
  • Radio
  • Select
  • Status dot
  • Switch
  • Text link
  • Textarea
  • Tooltip
  • Truncate
Molecules
  • Accordion
  • Activity chart
  • AI elements
  • Alert
  • Button group
  • Card
  • Code block
  • Combobox trigger
  • Command
  • Content table
  • Context switcher
  • Dropdown menu
  • Empty state
  • Field
  • Field group
  • Filter chip
  • Flow
  • Heading
  • Icon picker
  • Icon flow card
  • Metric card
  • Modal
  • Modal confirmation
  • Pagination
  • Popover
  • Scroll area
  • Sidebar
  • Table
  • Tabs
  • Toggle group
LibraryPublished release