Input
A one-line text field: xs 28, sm 32, md 36 (forms) and lg 40. Built on ui-sdk's Input and InputGroup, so a press on an affix focuses the field, and it wires itself to the Field around it.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { Input } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
clearable
copyable
validation
size
placeholder
prefix
suffix
disabled
readOnly
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Put it in a Field for its label, hint and error. Alone, like a search in a table toolbar, name it with aria-label. |
| Do | Use prefix and suffix for units, like $ before a fee or % after a discount, so the person types only the number. |
| Do | Use validation for a check that takes a moment, like whether an email is already on a contact, and put what to do in the Field's error. The cross alone doesn't say what's wrong. |
| Do | Set copyable on a value people paste elsewhere, like a trust account reference, and clearable on a search or filter. |
| Don't | Use it for several lines of text, like a file note. Use Textarea. |
| Don't | Use it for a date or a one-time code. Use DateInput or DatePicker for a date and CodeInput for a code. |
Props
Also takes every native input prop (type, placeholder, required, readOnly, disabled, ref, onChange…) and ui-sdk's value, defaultValue and onValueChange.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | TextSize | "md" | xs 28, sm 32, md 36 (forms, the default), lg 40. On touch screens the text is 16 px, so iOS doesn't zoom. |
| prefix | ReactNode | — | Muted text before the value, like a currency sign. |
| suffix | ReactNode | — | Muted text after the value, like a percent sign. |
| clearable | boolean | false | Shows a × that empties the field while it holds text. |
| copyable | boolean | false | Shows a button that copies the value. |
| validation | "checking" | "valid" | "invalid" | — | A check run on the value, like whether an email is taken: checking spins at the end of the field, then turns into a tick (valid) or a cross (invalid) that draws itself in. Put the message in the Field's error. |
| className | string | — | Classes for the box around the text, which draws the edge and the states. |
Code
What the playground shows, ready to copy.
import { Input } from "@leap-crm/design-system";
<Input aria-label="Full name" placeholder="Jane Citizen" />






