Field group
RequiredLayout wrapper for one logical field.
divFields & selection
Composable labels, hints, text controls, and style helpers for consistent form fields.
FieldGroupFieldLabelFieldLegendFieldHintTextInputTextAreafieldGroupStylesfieldLabelStylesfieldLegendStylesfieldHintStylesinputStylesConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
We will never share it.
This JSX stays synchronized with the controls and uses only public package APIs.
'use client';
import { useId } from 'react';
import { FieldGroup, FieldHint, FieldLabel, TextInput } from '@ai-created/ui';
export function Example() {
const hintId = useId();
return (
<FieldGroup>
<FieldLabel htmlFor="example-field">{"Email"}</FieldLabel>
<TextInput
id="example-field"
aria-describedby={hintId}
placeholder="Enter a value"
/>
<FieldHint id={hintId}>{"We will never share it."}</FieldHint>
</FieldGroup>
);
}
import { FieldGroup, FieldLabel, FieldHint, TextInput, TextArea } from '@ai-created/ui';Client boundary
'use client' to the file that owns this interactive state.Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Layout wrapper for one logical field.
divVisible name associated to the control.
labelNative input or textarea.
input / textareaOptional help or validation message associated by id.
pOptional uppercase group caption; not a semantic legend.
spanThe Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Forms/Field
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish a nested field component with input and textarea instance swaps plus state properties.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| Control | instance-swap | TextInput | TextInput or TextArea child | TextInput, TextArea |
| LabelRequired | text | Label | FieldLabel children | No additional constraint |
| Hint or error | text | None | FieldHint children | No additional constraint |
| Disabled | boolean | false | disabled on the native control | No additional constraint |
| Invalid | boolean | false | aria-invalid on the native control plus semantic hint content | No additional constraint |
| Required | boolean | false | required on the native control and a localized label indicator | No additional constraint |
Vertical field composition root.
FieldGroupVisible native label.
FieldLabelTextInput, TextArea, or an equivalent labelled control.
TextInput, TextArea, or styled custom controlDescription, requirement, or validation message.
FieldHintOverflow: Allow wrap, never truncate.
Every field needs an unambiguous name.
Overflow: Move extended help outside the field.
Immediate guidance should be scannable.
Overflow: Use a counter or explicit maximum for constrained data.
Input size communicates expected content.
Translatable: Label, Placeholder, Hint, Validation message
Fill its form column.
No internal breakpoint
Accountable owner
Design systems form foundations owner
Canonical source: src/components/Field.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
FieldGroup sibling gap
8px
Label, legend, and hint exterior margin
0px
Input padding
16px horizontal / 12px vertical
Input radius
6px
Input border
1px
--color-surface2Control background.
--color-control-border / --color-control-border-strongContrast-safe default and hover boundaries.
--color-accentFocused border.
--color-text / --color-text2 / --color-text3Value, label/help, and placeholder hierarchy.
--radius-mdControl radius.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { FieldGroup, FieldLabel, FieldHint, TextInput, TextArea } from '@ai-created/ui';Client Component required
<FieldGroup>
<FieldLabel htmlFor="email">Email</FieldLabel>
<TextInput id="email" type="email" aria-describedby="email-hint" />
<FieldHint id="email-hint">We will never share it.</FieldHint>
</FieldGroup>These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| FieldGroup | HTMLAttributes<HTMLDivElement> | undefined | Groups a label, control, and hint with one 8px sibling gap. |
| FieldLabel | LabelHTMLAttributes<HTMLLabelElement> | undefined | Native label without exterior spacing. |
| FieldLegend | HTMLAttributes<HTMLSpanElement> | undefined | Visual legend text without exterior spacing; not a semantic fieldset legend. |
| FieldHint | HTMLAttributes<HTMLParagraphElement> | undefined | Supporting or validation text without exterior spacing. |
| TextInput | InputHTMLAttributes<HTMLInputElement> | undefined | Native text input. |
| TextArea | TextareaHTMLAttributes<HTMLTextAreaElement> | undefined | Native textarea. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.