# Fieldset

> Fieldset with a legend for grouping related fields.

Registry name: `fieldset`. HTML docs: https://ui.anuragroy.dev/component/fieldset.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/fieldset.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/fieldset.json`.

Registry JSON: https://ui.anuragroy.dev/r/fieldset.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/fieldset.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import {
  Fieldset,
  FieldsetLegend
} from "@/components/ui/fieldset"
```

## Usage

```tsx
import { Fieldset, FieldsetLegend } from "@/components/ui/fieldset"
import {
  TextField,
  TextFieldInput,
  TextFieldLabel,
} from "@/components/ui/text-field"

export function Example() {
  return (
    <Fieldset className="gap-3">
      <FieldsetLegend>Account</FieldsetLegend>
      <TextField name="name">
        <TextFieldLabel>Name</TextFieldLabel>
        <TextFieldInput placeholder="Ada Lovelace" />
      </TextField>
    </Fieldset>
  )
}
```

## API

### Fieldset

Styled `fieldset`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | string | — |  |

### FieldsetLegend

Styled `legend`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | string | — |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/fieldset): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/fieldset.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
