@usevyre/react@usevyre/vue

Input

Text input with optional left/right icon slots and three size variants. Pair with Field for a labelled form control with validation states, or use Textarea for multi-line input.


Basic

import { Input } from "@usevyre/react";

<Input placeholder="Enter your email" type="email" />
<Input placeholder="With left icon" leftIcon={<SearchIcon />} />
<Input placeholder="With right icon" rightIcon={<EyeIcon />} />
<Input placeholder="Disabled" disabled />

With Field wrapper

Wrap any input with Field to get a label, hint text, and validation state styling.

We'll never share it.
Minimum 8 characters.
import { Field, Input } from "@usevyre/react";

<Field label="Email" htmlFor="email" hint="We'll never share it.">
  <Input id="email" type="email" placeholder="you@example.com" />
</Field>

<Field label="Password" htmlFor="pwd" state="error" hint="Minimum 8 characters.">
  <Input id="pwd" type="password" />
</Field>

Textarea

import { Textarea } from "@usevyre/react";

<Textarea placeholder="Add a description..." rows={4} />

Input props

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Input height scale.
leftIconReactNodeReact only. Icon rendered inside the left of the input.
rightIconReactNodeReact only. Icon rendered inside the right of the input.
disabledbooleanfalseDisables the input.
class / classNamestringAdditional CSS class.
…restHTMLInputAttributesAll native input attributes (type, placeholder, value, onChange, etc.).

Field props

Props

PropTypeDefaultDescription
labelstringLabel text above the input.
htmlForstringLinks label to the input id.
hintstringHelper text below the input. Rendered as alert when state is error.
state"idle" | "error" | "success""idle"Changes colour and icon of the hint text.
requiredbooleanfalseShows asterisk on the label.