Input API
import { Input } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
autoComplete | string | |
autofocus | boolean | |
children | React.ReactNode | |
clearable | boolean | |
color | string | |
counter | boolean | |
debounce | number | |
defaultValue | string | Starting value of an uncontrolled field (written once, on mount). |
density | 'default' | 'compact' | 'comfortable' | |
description | string | |
descriptionPosition | 'above' | 'below' | Put the description under the field instead of under the label. |
disabled | boolean | |
error | string | An error message to show under the field (marks it invalid). Leave it out to let a surrounding Form manage errors. |
floatingLabel | boolean | |
headless | boolean | |
inputMode | string | Hints at the type of data that might be entered by the user while editing the element or its contents |
label | string | |
max | string | number | |
maxlength | number | |
min | string | number | |
minlength | number | |
name | string | |
onChange | (value: string) => void | Every keystroke, like React's onChange on <input>. With value, the field is controlled. |
onClear | () => void | |
onCommit | (value: string) => void | The edit was committed (blur, or Enter in a single-line field). |
onDebouncedInput | (value: string) => void | |
onInput | (value: string) => void | |
pattern | string | |
placeholder | string | |
radius | 'none' | 'large' | 'full' | string | |
readOnly | boolean | |
required | boolean | |
shape | 'default' | 'square' | 'soft' | |
size | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
spellCheck | boolean | |
step | string | number | |
tone | 'default' | 'brand' | 'success' | 'warning' | 'danger' | |
type | string | |
validation | 'error' | 'success' | 'none' | |
value | string | |
variant | 'classic' | 'surface' | 'soft' | 'outlined' | 'filled' | 'flushed' | 'minimal' | 'contrast' | 'elevated' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Input.Prefix props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Input.Suffix props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Input.Error props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-input>
Input renders the ui-input custom element from @editora/ui-core, which can also be used without React.
Attributes: aria-describedby, aria-description, aria-label, autocomplete, autofocus, clearable, color, counter, data-error, debounce, density, description, disabled, floating-label, headless, inputmode, label, max, maxlength, min, minlength, name, pattern, placeholder, radius, readonly, required, shape, size, spellcheck, step, tone, type, validation, value, variant
Events: change, clear, input