InputGroup
Native control and addon composition with input styling.
All components · Theme builder · Implementation source
Live preview
Install
netscript ui:add input-groupUsage and examples
The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.
import { useState } from 'preact/hooks';
import { Input } from '@app/components/ui/input.tsx';
import { InputGroup } from '@app/components/ui/input-group.tsx';
export function Example() {
const [value, setValue] = useState('standard');
const [open, setOpen] = useState(false);
const [notice, report] = useState('');
return (<><div><InputGroup addon="Order" control={<Input aria-label="Order reference" placeholder="SO–10480" />} /></div><p role="status">{notice}</p></>);
}Props
Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.
| Owner | Prop | Type | Optional | Description |
|---|---|---|---|---|
InputGroupProps | control | ComponentChildren | No | |
InputGroupProps | addon | ComponentChildren | Yes | |
InputGroupProps | text | ComponentChildren | Yes | |
InputGroupProps | align | "inline-start" | "inline-end" | "block-start" | "block-end" | Yes | |
InputGroupProps | state | "rest" | "focus" | "disabled" | "invalid" | Yes | |
InputGroupProps | class | string | Yes |
InputGroupProps extends Omit<JSX.HTMLAttributes<HTMLFieldSetElement>, "class">Keyboard
Presentation component; no component-specific keyboard interactions.
Tokens
Semantic contract roles: surface/card, text/fg.
CSS custom properties referenced directly: --ns-border-width, --ns-card, --ns-control-gap, --ns-control-padding-x, --ns-destructive, --ns-fg, --ns-input-border, --ns-muted-fg, --ns-radius-input, --ns-ring, --ns-space-2, --ns-text-small.
Contract and compatibility
Accessibility pattern: native input group
- Native controls own keyboard/form behavior. Transient focus/hover is CSS/native; data-state also supports deliberate preview. Client visual/controlled updates require an island.
- For invalid state, callers supply aria-invalid and aria-describedby on the native control slot; a fieldset cannot propagate invalid semantics.
Design contract values marked planned are not implementation props. The props above describe what ships today.