Skip to main content

Input

Text input field with optional label, error state, and form integration.

Preview
Loading preview…

Import

// Web Component
import '@kittl/ui';

// React
import { Input } from '@kittl/ui-react';

Usage

Web Component

<kittl-input label="Name" placeholder="Enter your name"></kittl-input>
<kittl-input label="Email" error="Invalid email address"></kittl-input>
<kittl-input size="s" disabled></kittl-input>

React

<Input label="Name" placeholder="Enter your name" onChange={(e) => console.log(e.detail.value)} />
<Input label="Email" error="Invalid email address" />
<Input size="s" disabled />

Props

PropertyTypeDefaultDescription
size's' | 'm' | 'l''m'Input size
placeholderstringPlaceholder text
labelstringLabel displayed above the input
valuestring''Current value
namestringForm field name
errorstringError message displayed below the input
maxlengthnumberMaximum character count
disabledbooleanfalseDisable the input

Events

EventDetailDescription
change{ value: string }Fired on every input change

React prop: onChange

Form Integration

Input is form-associated. It updates ElementInternals.formValue on every change and can participate in native form submission.

Accessibility

  • role="textbox" set via ElementInternals