# forms

This rule standardizes form structure, input groups, option sets, and validation states. Use it when building interfaces with several kinds of controls.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 7523 repo stars
- Author: Devin-AXIS
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Devin-AXIS/iPolloWork/tree/HEAD/.opencode/skills/shadcn/rules/forms.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/forms

## What it does

The rule organizes forms with `FieldGroup` and `Field`, while related controls go inside `FieldSet` with `FieldLegend`. It maps common needs to specific components: text fields use `Input`, predefined choices use `Select`, searchable choices use `Combobox`, and multi-line text uses `Textarea`. Sets with 2–7 choices use `ToggleGroup`.

An `InputGroup` must contain `InputGroupInput` or `InputGroupTextarea`. A button placed in a field belongs in `InputGroupAddon`, rather than being positioned beside a raw input. Validation and disabled styling use two layers: `data-invalid` with `aria-invalid`, or `data-disabled` with `disabled`. Leaving out one side breaks the intended state styling.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/forms.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/forms.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/forms.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/forms.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/forms.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Devin-AXIS/iPolloWork/tree/HEAD/.opencode/skills/shadcn/rules/forms.md

## When to use it
- structure a form with `FieldGroup` and `Field`
- pick controls for search, selection, or OTP input
- replace active button lists with `ToggleGroup`
- place an action button inside an input group
- mark invalid and disabled controls consistently

## Example prompts
- Apply the `forms` rule and build a login form with `FieldGroup` and `Field`.
- Replace these three stateful buttons with a `ToggleGroup`.
- Review the form states and add `data-invalid` with `aria-invalid` for errors, then `data-disabled` with `disabled` for locked controls.

## Similar
- [forms-inputs-checkout](https://affpapa.org/en/nevibecode/skills/forms-inputs-checkout.md) — skill · 616 installs
- [forms-inputs](https://affpapa.org/en/nevibecode/skills/forms-inputs.md) — skill · 581 installs
- [Weavely AI Forms & Surveys](https://affpapa.org/en/nevibecode/mcp/weavely-ai-forms-surveys.md) — MCP server · 2515 installs
- [angular-forms](https://affpapa.org/en/nevibecode/skills/angular-forms.md) — skill · 7200 installs
- [netlify-forms](https://affpapa.org/en/nevibecode/skills/netlify-forms.md) — skill · 3500 installs
- [safe-action-forms](https://affpapa.org/en/nevibecode/skills/safe-action-forms.md) — skill · 1300 installs

From the same set: [devin-axis/ipollowork](https://affpapa.org/en/nevibecode/by/devin-axis/ipollowork.md) — 42 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
