Input
Input keeps the control native and applies Kikita UI styling through the kuiInput directive.
Import the public input primitives from the package entrypoint.
import {
KuiField,
KuiFieldAffix,
KuiInput,
} from '@kikita-labs/ui';Use kuiInput on native input elements. Use Field only when the control needs label, hint, or error chrome.
<div class="basic-input-example">
<input kuiInput type="email" aria-label="Work email" placeholder="mira@company.dev" />
<input kuiInput aria-label="Project slug" value="kikita-ui" />
<input kuiInput invalid aria-label="Invalid project slug" value="Invalid value" />
</div>Drop kuiFieldAffix inside kui-field for prefix text, suffix text, icons, or trailing actions. It auto-detects its look from the host element (button, kui-icon, or plain text) and kui-field applies shared .kui-input-group chrome automatically — no wrapper div needed.
<kui-field label="Project URL" hint="Affixes are visual field chrome." class="input-group-example">
<span kuiFieldAffix>https://</span>
<input kuiInput aria-label="Project slug" value="kikita-ui" />
<span kuiFieldAffix>.dev</span>
</kui-field>Put [formField] on the same native input as kuiInput. Signal Forms owns the value, required, disabled, touched and validation state; kuiInput adds no constraint or rule.
<kui-field label="Email" hint="Use your work email">
<input kuiInput type="email" autocomplete="email" [formField]="profileForm.email" />
</kui-field> Signal Forms supplies raw validity through the native control invalid property. The Field gates the displayed state on touch, so with [formField] the input follows the Field state instead of treating a raw invalid binding as a manual override.
Set defaults.input once for the application or for a subtree. Each option resolves as local input > defaults.input.<option> > built-in default.
import { provideKikitaUi } from '@kikita-labs/ui';
export const appConfig: ApplicationConfig = {
providers: [
provideKikitaUi({
defaults: {
input: {
/* options below */
},
},
}),
],
};| Name | Type | Default | Description |
|---|---|---|---|
| size | 'xs' | 'sm' | 'md' | 'lg' | — | Component size. Takes precedence over the global defaults.size. |
Set any of these on the component or an ancestor to restyle one part. Each token is optional: when it is not set, the part uses the role or scale token in the default column.
| Name | Type | Default | Description |
|---|---|---|---|
| --kui-input-font-size | CSS custom property | --kui-text-sm-size | Font size |
| --kui-input-height-xs | CSS custom property | --kui-control-height-xs | Height, xs |
| --kui-input-font-size-xs | CSS custom property | --kui-text-xs-size | Font size, xs |
| --kui-input-height-sm | CSS custom property | --kui-control-height-sm | Height, sm |
| --kui-input-height-lg | CSS custom property | --kui-control-height-lg | Height, lg |
| --kui-input-font-size-lg | CSS custom property | --kui-text-base-size | Font size, lg |
Inputs verified against @kikita-labs/ui v2.0.0 public typings.
| Name | Type | Default | Description |
|---|---|---|---|
| size | 'xs' | 'sm' | 'md' | 'lg' | undefined | undefined | Resolved in order: local size, parent Field effective size, defaults.input.size, root defaults.size, then md. The resolved value is written to data-kui-size. |
| invalid | boolean | false | Marks a standalone input (or one outside a Field error state) invalid: sets data-kui-invalid and aria-invalid="true". With [formField] the Field state wins and this binding is not a manual override. |
| id | string | undefined | undefined | Inside a Field, omitted uses the Field generated control id; outside, no id is added. An explicit id can leave the Field label for attribute pointing elsewhere. |
| KuiInputOptions | interface | - | Shape of defaults.input: size. |
Keep native input semantics. Add labels through Field or native label elements.
- Keep the native
inputsemantics; do not add an ARIA role. - Give every input an accessible name through a
kui-fieldlabel, a nativelabeloraria-label. A placeholder alone is not a label. - Inside a Field the input uses the generated control id and references only the rendered hint and error through
aria-describedby; a visible error isrole="alert". aria-invalidis omitted while valid; when invalid the directive setsaria-invalid="true"anddata-kui-invalid.- Keep
disabledandreadonlydistinct: a read-only input stays focusable. Required semantics come from native HTML or Signal Forms, not the Field marker. - Decorative affix icons use
aria-hidden="true". - Interactive field actions must be native buttons with accessible names.
kuiInputadds no keyboard handlers: Tab focus, editing and type-specific keys stay native.
Consumer-visible changes of @kikita-labs/ui 2.0 for Input.
- The directive class is
KuiInput; theDirectivesuffix is gone. - The default size moved to
provideKuiDefaults({ input: { size } }); the oldprovideKikitaUi({ input })shape is deprecated. - Input height and font size per size now have geometry tokens (
--kui-input-height-*,--kui-input-font-size-*). - A Field size only styles descendant inputs without
data-kui-size, so an input with an explicitsizekeeps it inside a differently sized Field. - With
[formField],kuiInputfollows the Field's touch-gated invalid state.