Input
A native input enhancer with Signal Forms, direct class ownership, token-driven states and zero wrapper semantics.
GET STARTED
Import
Import the standalone directive from its granular entry point.
NATIVE FIRST
Basic input
neuralInput enhances the real input. Labels, browser validation, autofill, form submission and native events remain intact.
Start and end icons
NeuralInputGroup places decorative icons at logical start and end while the projected control remains the real native input.
Native text types
Text, email, password, search, telephone and URL retain their browser-specific behavior and mobile keyboards.
Visual sizes
inputSize controls visual density without hijacking the native HTML size attribute.
Visual variants
Outlined is explicit; filled creates a quieter surface while preserving the same focus and validation contract.
Native states
Readonly values remain selectable and submitted. Disabled controls leave form submission. Invalid state is exposed only when the application declares it.
Angular Forms integration
The directive stays on the native control, so it needs no custom ControlValueAccessor. Template-driven Forms, Reactive Forms and Signal Forms all bind through Angular's own native input accessors.
Fluid width
The default follows native inline sizing. Fluid fills its available container and can also inherit from Neural Field.
Unstyled and direct classes
There is no inputClass: the host is already the native input. Normal class bindings work directly, while unstyled removes every NeuralNg visual class.
INPUT
Accessibility
Native semantics are the foundation; NeuralInput never replaces the browser's control contract.
Accessible naming
Use a native label, Neural Field label or another valid accessible name. Placeholder text is never a label replacement.
Hints and errors
Connect hints and correction text with aria-describedby. Apply aria-invalid="true" only when an error should be announced.
Input purpose
Correct type, autocomplete, inputmode and enterkeyhint values improve autofill, cognition and mobile keyboard choice.
State semantics
Disabled
Unavailable, unfocusable and excluded from form submission.
Readonly
Focusable, selectable and included in form submission.
Required
Use the native required attribute and a visible indication.
Focus
Focus-visible treatment remains keyboard discoverable and respects reduced motion.
INPUT
API
A deliberately small directive API layered on the complete native HTMLInputElement contract.
Directive
NeuralInputinput[neuralInput]exportAs: neuralInput
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| inputSize | NeuralInputSize | 'medium' | Visual size; native HTML size remains untouched. |
| variant | NeuralInputVariant | 'outlined' | Outlined or filled token treatment. |
| fluid | boolean | false | Fills the available inline width. |
| unstyled | boolean | false | Removes NeuralNg visual classes. |
InputGroup
Optional visual composition around the unchanged native input.
startIconstring | null Logical leading icon classes. Default: null
endIconstring | null Logical trailing icon classes. Default: null
fluidboolean Fills the available inline width. Default: false
unstyledboolean Removes group visual classes. Default: false
inputGroupClassstring Additive group-root classes. Default: ''
iconClassstring Additive classes shared by both icons. Default: ''
Methods
focus(options?: FocusOptions) => voidFocuses the native input.
select() => voidSelects the native input value.
Native API remains public
Attributes such as type, name, value, autocomplete, inputmode, minlength, maxlength, pattern, required, readonly and disabled stay on the input. Listen to native input, change, focus and blur events without NeuralNg aliases.
INPUT
Design tokens
Every styled state is token-driven; structural behavior remains stable in custom themes.
Design tokens
Override tokens locally, at a product boundary or through a generated Neural theme.
--neural-input-widthControl inline size.
--neural-input-min-heightControl minimum block size.
--neural-input-paddingControl internal spacing.
--neural-input-small-min-heightSmall minimum block size.
--neural-input-small-paddingSmall internal spacing.
--neural-input-small-font-sizeSmall font size.
--neural-input-large-min-heightLarge minimum block size.
--neural-input-large-paddingLarge internal spacing.
--neural-input-large-font-sizeLarge font size.
--neural-input-colorControl foreground color.
--neural-input-color-hoverHovered control foreground color.
--neural-input-color-focusFocused control foreground color.
--neural-input-color-invalidInvalid control foreground color.
--neural-input-caret-colorControl text caret color.
--neural-input-backgroundControl background surface.
--neural-input-background-hoverHovered control background surface.
--neural-input-background-focusFocused control background surface.
--neural-input-background-readonlyReadonly control background surface.
--neural-input-filled-backgroundFilled background surface.
--neural-input-filled-background-hoverHovered filled background surface.
--neural-input-filled-background-focusFocused filled background surface.
--neural-input-filled-border-colorFilled border color.
--neural-input-filled-border-color-hoverHovered filled border color.
--neural-input-filled-border-color-focusFocused filled border color.
--neural-input-borderControl border shorthand.
--neural-input-border-color-hoverHovered control border color.
--neural-input-border-color-focusFocused control border color.
--neural-input-border-color-invalidInvalid control border color.
--neural-input-radiusControl corner radius.
--neural-input-shadowControl box shadow.
--neural-input-shadow-hoverHovered control box shadow.
--neural-input-shadow-focusFocused control box shadow.
--neural-input-shadow-invalidInvalid control box shadow.
--neural-input-font-familyControl font family.
--neural-input-font-sizeControl font size.
--neural-input-font-weightControl font weight.
--neural-input-line-heightControl line height.
--neural-input-placeholder-colorPlaceholder foreground color.
--neural-input-placeholder-opacityPlaceholder opacity.
--neural-input-focus-ringControl keyboard focus ring.
--neural-input-focus-ring-offsetControl focus ring offset.
--neural-input-disabled-opacityDisabled opacity.
--neural-input-transitionControl CSS transition.