# Fieldset

A spined frame grouping several fields under a legend.

[View Fieldset on CyberSpec](https://www.cyberspec.dev/components/sidebar/fieldset)

## Component

Fieldset belongs to the Fields group in the CyberSpec catalog. It uses @ui-sdk/react/field.

## Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/fieldset.json
```

## Example

```tsx
"use client"

import { Fieldset } from "@/components/ui/fieldset"
import { Switch } from "@/components/ui/switch"
import { TextField } from "@/components/ui/text-field"

export default function FieldsetDemo() {
  return (
    <>
      <Fieldset legend="Uplink" description="Where this deck phones home between jobs." code="NODE 3F:A2 // VANTA RELAY">
        <TextField label="Relay host" defaultValue="glasswater-03.relay" autoComplete="off" />
        <TextField label="Channel" prefix="CH" defaultValue="7741" inputMode="numeric" autoComplete="off" />
        <Switch label="Stealth route" defaultChecked />
      </Fieldset>
    </>
  )
}
```

## Install this example

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/fieldset-demo.json
```

## Resources

- [Interactive Fieldset preview](https://www.cyberspec.dev/preview/fieldset)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Fieldset source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/fieldset.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/fieldset.json)
