Input
Terminal-style text input with custom blinking caret and arrow key navigation.
Import
Basic Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
caretChars | string | ' ' | Custom caret character(s) to display |
label | string | — | Label text for the input |
isBlink | boolean | true | Whether the caret should blink |
type | string | 'text' | Input type (text, password, email, number, etc.) |
value | string | — | Controlled input value |
defaultValue | string | — | Default value for uncontrolled input |
placeholder | string | — | Placeholder text |
disabled | boolean | false | Whether the input is disabled |
readOnly | boolean | false | Whether the input is read-only |
onChange | (event: ChangeEvent) => void | — | Change event handler |
onFocus | (event: FocusEvent) => void | — | Focus event handler |
onBlur | (event: FocusEvent) => void | — | Blur event handler |
className | string | — | Additional CSS class names |
ref | React.Ref<HTMLInputElement> | — | Forwarded ref to the input element |
All standard HTML input attributes are also supported.
With Label
Password Input
Password inputs automatically mask the text with bullet characters:
With Placeholder
Enter your email...
Disabled State
Cannot edit
Custom Caret
Customize the caret character for different visual styles:
Caret Blinking
Control whether the caret blinks:
Input Types
Interactive Example
Type something...
Current value: (empty)
Features
- Custom blinking caret: Terminal-style caret that blinks at the cursor position
- Arrow key navigation: Press Up/Down arrows to navigate between inputs
- Password masking: Passwords are displayed as bullet characters
- Controlled/uncontrolled: Works both as controlled and uncontrolled component
Keyboard Navigation
| Key | Action |
|---|---|
Arrow Up | Focus previous focusable element |
Arrow Down | Focus next focusable element |
Arrow Left/Right | Move caret within input |
Accessibility
- Semantic
<input>element with proper labeling - Supports all standard input attributes
- Keyboard accessible with visible focus states
- Works with screen readers
Styling
| Variable | Description |
|---|---|
--theme-border | Input border color |
--theme-background | Input background color |
--theme-text | Input text color |
--theme-focused-border | Border color when focused |