Skip to main content
rule CX Codex

forms — Claude Code rule: forms and setup

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

LicenseRef-Proprietary ★ 7,523 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/forms.md
Open on GitHub

What forms 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.

What it helps with

  • 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 for the agent

  • 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.

How to install forms

Manually: put the files in place

.claude/rules/forms.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about forms

How do I install forms in Claude Code?

Place the rule file at .claude/rules/forms.md.

What does the forms rule do?

It defines form structure, maps input needs to UI components, and sets patterns for option groups, input actions, validation, and disabled states.

How should an invalid field be marked?

Put data-invalid on Field and aria-invalid on its control. Disabled fields use data-disabled together with disabled.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set42

The whole set →
image-generation image-generation generates image assets through the iPolloWork service for slide decks and web pages. Operates directly in chat without opening Image Studio. CX Codex +1 ★ 7,523repo stars ipollowork-template-generation The ipollowork-template-generation skill builds and revises reusable iPolloWork templates for design, presentations, editable PPT, and HyperFrames Video. Use it to validate and save template packages. CX Codex +1 ★ 7,523repo stars styling Rule for consistent React component styling: semantic color tokens instead of raw Tailwind values, built-in component variants, conditional classes via cn(). Prevents improper Tailwind usage and ensures light and dark theme support. CX Codex +1 ★ 7,523repo stars composition Enforces component composition patterns: wraps list items in groups, requires modal titles for accessibility, and swaps custom divs for UI primitives. CX Codex +1 ★ 7,523repo stars agent-first-screenshots The agent-first-screenshots agent drives the live app over CDP and keeps a frame only after structural, pixel and vision checks pass. Built for landing pages, newsletters and decks. CX Codex +1 ★ 7,523repo stars create-plugin create-plugin scaffolds TypeScript plugins for iPolloWork and OpenCode. Sets up tool definitions, runtime hooks, and registers the file in your project configuration. CX Codex +1 ★ 7,523repo stars daytona-dev daytona-dev — a skill for Claude Code and Codex that sets up a Daytona cloud sandbox running an XFCE/noVNC desktop. The iPolloWork Electron app becomes accessible through the browser at port 6080. CX Codex +1 ★ 7,523repo stars base-vs-radix base-vs-radix — an IDE rule that clarifies API differences between shadcn's base components and their Radix counterparts. Covers composition, Select options, value types, and prop naming across multiple components. CX Codex +1 ★ 7,523repo stars

Project sponsors

Companies that keep this analytics open