Input
Displays a form input field or a component that looks like an input field.
Installation
The Input component is part of Slate UI Kit and is available by default.
Usage
Types
The Input component supports all standard HTML input types.
Sizes
Use the size prop to change the size of the input.
With Label
Use the label prop to add a label to the input.
With Help Text
Use the help prop to add help text below the input.
We'll never share your email with anyone else.
Error State
Use the errorMessage prop to show an error message.
Please enter a valid email address
Disabled State
Disable an input by adding the disabled attribute.
Livewire Integration
The Input component automatically detects Livewire and shows loading/error states.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type |
string |
"text" |
The HTML input type. Options: text, email, password, number, tel, url, etc. |
size |
string |
"default" |
The size of the input. Options: sm, default, lg |
disabled |
boolean |
false |
Disable the input |
readonly |
boolean |
false |
Make the input readonly |
required |
boolean |
false |
Make the input required |
autofocus |
boolean |
false |
Autofocus the input |
placeholder |
string |
null |
Placeholder text |
value |
string |
null |
Input value |
name |
string |
null |
Input name attribute |
id |
string |
null |
Input ID attribute |
label |
string |
null |
Label text |
help |
string |
null |
Help text below input |
errorMessage |
string |
null |
Error message to display |
Sizes
- sm - Small input (height: 36px)
- default - Default input (height: 40px)
- lg - Large input (height: 44px)
Accessibility
The Input component includes:
- Proper label association
- ARIA attributes for error states
- Keyboard navigation support
- Focus visible states
- Disabled state handling