InputGroup
overview
InputGroup is the stable styled forms-input primitive. Behavior is owned by `@uifn/core`; framework packages adapt that behavior and the styled packages add public parts and tokens. Implementation kind: `typed-static-contract`.
anatomy
| Part | Public export | Native basis | Cardinality | Required value | React props | Svelte props | Solid props | |---|---|---|---|---|---|---|---| | `root` | `InputGroupRoot` | `div` | one | — | `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | | `addon` | `InputGroupAddon` | `div` | many | `string` | `value: string`, `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `value: string`, `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `value: string`, `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | | `text` | `InputGroupText` | `span` | many | `string` | `value: string`, `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `value: string`, `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `value: string`, `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | | `control` | `InputGroupControl` | `div` | one | — | `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | | `input` | `InputGroupInput` | `input` | one | — | `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | | `textarea` | `InputGroupTextarea` | `textarea` | one | — | `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | | `button` | `InputGroupButton` | `button` | many | `string` | `value: string`, `native element props`, `className?: string`, `children?: ReactNode`, `asChild?: boolean`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` | `value: string`, `native element props`, `class?: string`, `children snippet`, `render snippet`, `forceMount?: boolean`, `container?: HTMLElement | null`, `bind:ref` | `value: string`, `native element props`, `class?: string`, `children?: JSX.Element`, `render?`, `forceMount?: boolean`, `container?: HTMLElement | null`, `ref` |
state-actions-parts
Controller and context ownership: - Core: `@uifn/core/input-group: InputGroupContract` - State: `InputGroupState` - Actions: `Record<string, never>` - Parts: `InputGroupContractParts` - DOM owner: @uifn/dom owns form-bridges-live-regions - react context: `InputGroupProvider and useInputGroup(inputs); adapter context remains private` - svelte context: `InputGroupProvider; adapter context remains private to compound descendants` - solid context: `InputGroupProvider; adapter context remains private to compound descendants` States: - `valid` (semantic) - `invalid` (semantic) - `disabled` (semantic) Complete transition signatures: - No controller event is declared; native element event props remain available. Controlled callbacks: - No controlled callback is declared; native element event props remain available. Root inputs and defaults: | Input | Type | Required | Reactive | Default | Description | |---|---|---:|---:|---|---| | `disabled` | `boolean` | no | yes | `undefined → false` | Optional reactive disabled input from the canonical InputGroup contract. | | `invalid` | `boolean` | no | yes | `undefined → false` | Optional reactive invalid input from the canonical InputGroup contract. |
controlled-uncontrolled
Control mode: `none`. Controlled inputs: none. Uncontrolled defaults: none. Change events: native events only. Do not switch mode after mount.
accessibility
Profile: `forms-input`. Native semantic basis: Prefer native form controls and preserve labels, descriptions, errors, disabled fieldsets, reset, and validation. Accessible name required: yes; accepted sources: label-element, aria-label, aria-labelledby. WCAG mapping: 1.3.1, 1.3.5, 2.1.1, 2.4.3, 2.4.7, 2.5.8, 3.3.1, 3.3.2, 3.3.3, 4.1.2, 4.1.3. Normative basis: native-html, wai-aria-apg-spinbutton. Final manual accessibility review remains outstanding. Automated and current manual evidence does not include JAWS, which remains explicitly user-deferred.
keyboard-pointer-touch
Keyboard model: `native-input-plus-declared-enhancements`; keys: `Tab`, `Shift+Tab`, `Enter`, `Space`, `ArrowUp`, `ArrowDown`, `Home`, `End`, `composition`. Pointer/touch obligations: native-control-interaction, target-size, file-picker-where-applicable. Focus obligations: visible-input-focus, error-focus-policy, caret-and-selection-preservation.
forms
Participation: `native`; value shape: `native`; reset: `native`; validation: `native`.
direction-locale
RTL contract: Declare logical versus physical direction behavior and mirror only directional semantics. Direction is supplied through DOM `dir`; locale-sensitive labels and formatting stay application-owned unless a primitive input says otherwise.
ssr-hydration
The controller is deterministic and DOM access is adapter-owned. Render the same controlled/default inputs on server and first client render. Portal, presence, root-scope, modality, and tabbability services (form-bridges-live-regions) activate only after the DOM is available.
composition-styling
Use the compound root `InputGroup` or named parts shown above. Import `@uifn/components/styles.css` once, then override tokens or low-specificity part selectors in a later CSS layer. Stable data attributes: - `data-uifn-component="input-group"` on all styled parts; stable. - `data-uifn-part="root | addon | text | control | input | textarea | button"` on all styled parts; stable. - `data-state="valid | invalid | disabled"` on stateful parts; stable semantic state. - `data-disabled="true | false"` on parts whose semantics depend on this input; stable semantic state. - `data-invalid="true | false"` on parts whose semantics depend on this input; stable semantic state. CSS variables: - `--uifn-component-accent` (shared) - `--uifn-component-accent-contrast` (shared) - `--uifn-component-bg` (shared) - `--uifn-component-bg-muted` (shared) - `--uifn-component-border` (shared) - `--uifn-component-border-strong` (shared) - `--uifn-component-danger` (shared) - `--uifn-component-fg` (shared) - `--uifn-component-fg-muted` (shared) - `--uifn-component-radius-lg` (shared) - `--uifn-component-radius-md` (shared) - `--uifn-component-radius-sm` (shared) - `--uifn-component-shadow` (shared) - `--uifn-control-block-size` (shared) - `--uifn-control-gap` (shared)
package-install
Published package version: `0.0.1`; canonical catalog version: `stable-1.0`.
| Framework | Public import | Source-install target |
|---|---|---|
| react | `@uifn/components-react/input-group` | `components/uifn/react/input-group.ts` |
| svelte | `@uifn/components-svelte/input-group` | `components/uifn/svelte/input-group/index.ts` |
| solid | `@uifn/components-solid/input-group` | `components/uifn/solid/input-group.ts` |
#### React · package
```tsx
import * as React from 'react';
import { InputGroupRoot } from "@uifn/components-react/input-group";
export function InputGroupExample() {
return React.createElement(InputGroupRoot, {});
}
```
#### React · source
```tsx
import * as React from 'react';
import { InputGroupRoot } from "./components/uifn/react/input-group.js";
export function InputGroupExample() {
return React.createElement(InputGroupRoot, {});
}
```
#### Svelte · package
```svelte
<script lang="ts">
import { InputGroupRoot } from "@uifn/components-svelte/input-group";
</script>
<InputGroupRoot />
```
#### Svelte · source
```svelte
<script lang="ts">
import { InputGroupRoot } from "./components/uifn/svelte/input-group/index.js";
</script>
<InputGroupRoot />
```
#### Solid · package
```tsx
import { createComponent } from 'solid-js';
import { InputGroupRoot } from "@uifn/components-solid/input-group";
export function InputGroupExample() {
return createComponent(InputGroupRoot, {});
}
```
#### Solid · source
```tsx
import { createComponent } from 'solid-js';
import { InputGroupRoot } from "./components/uifn/solid/input-group.js";
export function InputGroupExample() {
return createComponent(InputGroupRoot, {});
}
```source-install
Use `uifn add input-group --framework <react|svelte|solid>` through `@uifn/registry`. The lockfile records the catalog, generator, template, and output hashes. Source-install files have the same public component contract as package delivery; edit intentionally and let `uifn diff` report local divergence.
known-constraints
Required release channel: `stable-1.0`. Catalog status: `ga-required`. Compatibility certification is still pending external runner/device-lab evidence; this page documents current generated compatibility evidence and is not a complete release certification. Declared exceptions: none. Explicit limitations: - InputGroup owns shared geometry and state styling; the nested native input or textarea owns the submitted form value. - Render one primary control per group unless the application supplies an explicit multi-control accessible name. - This typed static contract exposes semantic state and parts but no controller subscription or action surface. - Apply the forms-input profile specifically to InputGroup; implementation vectors own exact behavior.