# Fields with input groups

> Fields with input groups

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-field-1).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-field-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-field-1-light-30f55e38055e0558.png
- Registry item: https://reui.io/r/new-york-v4/c-field-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-field-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `field`, `input`, `input-group`

## Files

### `c-field-1.tsx`

```tsx
import {
  Field,
  FieldDescription,
  FieldGroup,
  FieldLabel,
} from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupInput,
  InputGroupText,
} from "@/components/ui/input-group"

export function Pattern() {
  return (
    <div className="mx-auto w-full max-w-xs">
      <FieldGroup>
        <Field>
          <FieldLabel htmlFor="profile-name">
            Full Name <span className="text-destructive">*</span>
          </FieldLabel>
          <Input
            id="profile-name"
            placeholder="Enter your full name"
            required
          />
          <FieldDescription>
            This name will be displayed on your public profile.
          </FieldDescription>
        </Field>
        <Field>
          <FieldLabel htmlFor="profile-username">Username</FieldLabel>
          <InputGroup>
            <InputGroupAddon>
              <InputGroupText>@</InputGroupText>
            </InputGroupAddon>
            <InputGroupInput id="profile-username" placeholder="username" />
          </InputGroup>
          <FieldDescription className="text-success">
            Username is available.
          </FieldDescription>
        </Field>
        <Field data-invalid>
          <FieldLabel htmlFor="profile-email">Email Address</FieldLabel>
          <InputGroup>
            <InputGroupInput id="profile-email" placeholder="email" />
            <InputGroupAddon align="inline-end">
              <InputGroupText>@gmail.com</InputGroupText>
            </InputGroupAddon>
          </InputGroup>
          <FieldDescription>
            Please enter a valid email address.
          </FieldDescription>
        </Field>
      </FieldGroup>
    </div>
  )
}
```
