Skip to main content
Version: Next

Input API

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

Props​

PropTypeDescription
autoCompletestring
autofocusboolean
childrenReact.ReactNode
clearableboolean
colorstring
counterboolean
debouncenumber
defaultValuestringStarting value of an uncontrolled field (written once, on mount).
density'default' | 'compact' | 'comfortable'
descriptionstring
descriptionPosition'above' | 'below'Put the description under the field instead of under the label.
disabledboolean
errorstringAn error message to show under the field (marks it invalid). Leave it out to let a surrounding Form manage errors.
floatingLabelboolean
headlessboolean
inputModestringHints at the type of data that might be entered by the user while editing the element or its contents
labelstring
maxstring | number
maxlengthnumber
minstring | number
minlengthnumber
namestring
onChange(value: string) => voidEvery keystroke, like React's onChange on <input>. With value, the field is controlled.
onClear() => void
onCommit(value: string) => voidThe edit was committed (blur, or Enter in a single-line field).
onDebouncedInput(value: string) => void
onInput(value: string) => void
patternstring
placeholderstring
radius'none' | 'large' | 'full' | string
readOnlyboolean
requiredboolean
shape'default' | 'square' | 'soft'
size'sm' | 'md' | 'lg' | '1' | '2' | '3'
spellCheckboolean
stepstring | number
tone'default' | 'brand' | 'success' | 'warning' | 'danger'
typestring
validation'error' | 'success' | 'none'
valuestring
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