@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

Prop Type Default Description
size "sm" | "md" | "lg" "md" Input height scale.
leftIcon ReactNode React only. Icon rendered inside the left of the input.
rightIcon ReactNode React only. Icon rendered inside the right of the input.
disabled boolean false Disables the input.
class / className string Additional CSS class.
…rest HTMLInputAttributes All native input attributes (type, placeholder, value, onChange, etc.).

Field props

Props

Prop Type Default Description
label string Label text above the input.
htmlFor string Links label to the input id.
hint string Helper text below the input. Rendered as alert when state is error.
state "idle" | "error" | "success" "idle" Changes colour and icon of the hint text.
required boolean false Shows asterisk on the label.