Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Fieldset with Legend for Ark UI

Address Information, the note We need your address to deliver your order, then Street Address with City beside Postal Code.

Address Information is the caption. Under it: We need your address to deliver your order. Street Address is its own row, placeholder 123 Main St. City and Postal Code share the next row, New York and 90502.

Put it on a few related inputs that need one name. A frame with no legend is a Card. Ark UI in React does not check the postal code.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Use email insteadNo credit card

Anatomy

Field anatomy: root, label, input, description, error

Usage

<FieldSet className="w-full max-w-md">
  <FieldLegend>Address Information</FieldLegend>
  <FieldDescription>
    We need your address to deliver your order.
  </FieldDescription>
  <FieldGroup>
    <Field>
      <FieldLabel>Street Address</FieldLabel>
      <Input placeholder="123 Main St" type="text" />
    </Field>
    <div className="grid grid-cols-2 gap-4">
      <Field>
        <FieldLabel>City</FieldLabel>
        <Input placeholder="New York" type="text" />
      </Field>
      <Field>
        <FieldLabel>Postal Code</FieldLabel>
        <Input placeholder="90502" type="text" />
      </Field>
    </div>
  </FieldGroup>
</FieldSet>

FAQ

What is the Address Information line?

FieldLegend on FieldSet is the caption. variant is left unset, so it uses the default legend style. The legend is announced with each field's own label.

Where is the delivery sentence?

FieldDescription sits under the legend, on the set: We need your address to deliver your order. The inputs have their own labels under that.

How is the street field laid out?

Street Address is a full-width Field in the FieldGroup. type is text, and the placeholder is 123 Main St.

How do City and Postal Code share a row?

They sit in a grid with grid-cols-2 and gap-4. Placeholders are New York and 90502, and both inputs use type text.

How does each label connect?

FieldLabel names the input. Field connects the two for you, with no ids to write. The labels are Street Address, City, and Postal Code.

How wide is the address set?

The set is capped with max-w-md. The legend, the description, and the fields share that width.

API Reference

Field

No extra props in this demo. The rest is on the Field page.

Input

Sets placeholder="123 Main St", type="text", placeholder="New York" and placeholder="90502". The rest is on the Input page.