sigilUI

Input

A styled text input that reads border, radius, and focus tokens from your token file.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { Input } from "@sigil-ui/components";

Usage

<Input placeholder="Enter your email" />

With label

Pair with a <label> or the Label component for accessibility:

Live preview Interactive
import { Input, Label, Stack } from "@sigil-ui/components";

<Stack gap={8}>
  <Label htmlFor="name">Full name</Label>
  <Input id="name" placeholder="Lina Torres" />
</Stack>

With icons

Use iconLeft and iconRight to render elements inside the input.

import { Search, Eye } from "lucide-react";

<Input iconLeft={<Search className="size-4" />} placeholder="Search..." />
<Input iconRight={<Eye className="size-4" />} placeholder="Password" type="password" />

Error state

Pass a string to error to show both the error styling and an error message. Pass true for styling only.

Live preview Interactive
<Input error="Please enter a valid email address" placeholder="you@example.com" />
<Input error={true} placeholder="Error styling, no message" />

Disabled

Live preview Interactive
<Input disabled placeholder="Disabled input" />

Token integration

Input reads these CSS variables from your token file:

CSS VariableUsed for
--s-backgroundInput background
--s-textInput text color
--s-text-mutedPlaceholder color
--s-borderDefault border
--s-border-styleBorder style
--s-primaryFocus border and ring
--s-errorError state border and message
--s-radius-inputBorder radius
--s-duration-fastFocus transition

Props

PropTypeDefaultDescription
errorstring | boolean—Error state. String shows a message below the input.
iconLeftReactNode—Icon or element on the left
iconRightReactNode—Icon or element on the right
disabledbooleanfalseDisable interactions
classNamestring—Additional CSS classes

Plus all standard <input> HTML attributes (type, placeholder, value, onChange, etc.).

Accessibility

  • Uses native <input> element
  • Pair with <label> using matching htmlFor/id for screen reader support
  • Error state adds aria-invalid="true"
  • Error message renders with role="alert"
  • Disabled state uses the native disabled attribute