Skip to content

Input

Text input with three variants, label tooltips, validation state, password toggle, copy-to-clipboard, character count, and a built-in formatting mask that locks the caret past fixed prefixes.

Forms & Inputs·Available inReactVueAngular·View as Markdown

Preview

tsx

Switch the framework picker (top-right of the panel) to render the same demo live in React, Vue, or Angular — same class names, ARIA, and visual output across all three.

Playground

Flip props to see how the component responds. The snippet below updates as you change options.

Installation

Sisyphos UI ships unified packages for React, Vue, and Angular. Pick the one that matches your stack — every framework exports the same component classes, ARIA semantics, and CSS tokens.

$ pnpm add @sisyphos-ui/react

Then import the bundled stylesheet once at app entry: import "@sisyphos-ui/react/styles.css";

Usage

Idiomatic usage in each supported framework
import { Input } from "@sisyphos-ui/react";

export const Email = () => (
  <Input
    label="Email"
    type="email"
    placeholder="name@example.com"
    error
    errorMessage="Please enter a valid email"
  />
);

Error state

Set `error` + `errorMessage` to surface validation feedback.

tsx
Password must be at least 12 characters.

Variants

tsx

With start icon

`startIcon` renders inside the input for search, currency, or context icons.

tsx

Character count

Set `maxLength` + `showCharacterCount` to surface a live counter.

tsx
0 / 30

Label with help

Compose a label with an adjacent `Tooltip` + info glyph when the field needs inline guidance.

tsx
?

Copyable value

Pair a read-only `Input` with an adjacent `Button` that writes the value to the clipboard via `navigator.clipboard.writeText`.

tsx

Sizes

`size` scales the control for dense toolbars or hero forms.

tsx

Real world — search row

Input paired with a Button inside a Card surface.

tsx

API

PropTypeDefaultDescription
variant"standard" | "outlined" | "underline""standard"Visual treatment.
size"sm" | "md" | "lg""md"Field height + typography scale.
radius"sm" | "md" | "lg" | "full"Border radius scale.
labelstringField label rendered above the input.
labelTooltipReactNodeHelp content rendered as a tooltip next to the label.
labelTooltipPosition"top" | "bottom" | "left" | "right""top"Anchors the label tooltip popover.
errorbooleanfalseMarks the field as invalid for styling and ARIA.
errorMessagestringMessage shown below the field when `error` is true.
startIconReactNodeIcon rendered inside the field, before the value.
endIconReactNodeIcon rendered inside the field, after the value.
copyablebooleanfalseRenders a copy-to-clipboard button on the trailing side.
onCopy(value: string) => voidCalled after a successful clipboard copy.
showCharacterCountbooleanfalseShow a `current / max` counter (requires `maxLength`).
fullWidthbooleanfalseStretch the input to its container width.
maskstringMask pattern (`#` digit, `A` letter, `*` alphanumeric, anything else literal). Presets: `tel-tr`, `tel`, `card`, `date`. Caret is locked past the fixed prefix automatically.
onUnmaskedChange(unmaskedValue: string) => voidFires with the raw value when `mask` is set.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README on npm.

Accessibility

Adheres to the Text input WAI-ARIA design pattern.

  • Label is wired via htmlFor / id; tooltip-mode label uses role="tooltip" for the hint popover.
  • aria-invalid mirrors error; the error message is announced with role="alert".
  • Character count and error message are linked through aria-describedby.
  • Password and copy buttons carry descriptive aria-labels (and aria-live="polite" on the copy button).

Keyboard interactions

KeyAction
TabMoves focus to the input.
EnterSubmits the surrounding form.
CtrlthenASelects the entire value (preserved even when a mask prefix is set).
Need more?View on npm →
Was this page helpful?