Input
Loading example…
Text field. With start or end the field is drawn by a wrapper, so className then targets that
wrapper (its width, margins) and classNames.input the <input>; without them className stays on
the <input> as before.
Import
Section titled “Import”import { Input } from "@jcsoftdev/ui/forms";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/forms/input.
<Input placeholder="Ej. Marco Salazar" aria-label="Nombre del cliente"/>| Prop | Type | Default | Description |
|---|---|---|---|
size |
"sm" | "md" | "lg" | "xs" |
"md" |
sm is the 30px compact field and md (default) the 38px one: the heights of Button sm and md. xs is the same as sm; lg is the thumb-friendly field. |
variant |
"default" | "bare" |
"default" |
bare drops the border, background and side padding, for a field that sits inside chrome of its own. |
start |
ReactNode |
Content before the text (an icon, a currency symbol, a button). Adds a wrapper that draws the field. | |
end |
ReactNode |
Content after the text (an icon, a unit, a clear or reveal button). Adds a wrapper that draws the field. | |
classNames |
Partial<Record<InputPart, string>> |
Per-part classes merged with cn; consumer classes win. Parts other than input only exist with start or end. |
|
intent |
string |
||
intentKey |
string |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”- Default
- With Value
- Telephone
- Invalid
- Disabled
- Read Only
- Extra Small
- Adornments
- Adornment Invalid
- Bare
Source
Section titled “Source”packages/ui/src/forms/input/input.tsx