Input
Components

Input

Single-line text field with optional leading and trailing icons.

Props

InputProps props
PropTypeDefaultDescription
typestring"text"HTML input type attribute.
placeholderstring—Placeholder text when the field is empty.
valuestring—Controlled value.
onChangeChangeEventHandler<HTMLInputElement>—Change handler.
leftIconReactNode—Slot before the text, inside the control border.
rightIconReactNode—Slot after the text, inside the control border.
size"sm" | "md""md"Control height.
invalidboolean—Invalid styling. Defaults to the enclosing Field error state.
disabledboolean—Prevents interaction and applies disabled styling.
readOnlyboolean—Non-editable but focusable.
monoboolean—Monospace font.
containerClassNamestring—Targets the shell (border, height, icons); className targets the <input>.

Usage

Input renders a native <input> inside the shared Control shell, giving it the same border, background, and focus ring as all other form controls. Pass leftIcon or rightIcon to place an icon inside the control border.

Basic

Input

With icons

Input with icons

Invalid

Invalid

Disabled

Disabled

Mono

Mono

Sizes

Input sizes
ImportTSX
import { Input } from "@solarius/onset";
import type { InputProps } from "@solarius/onset";
import { IconSearch, IconUser } from "@tabler/icons-react";

<Input placeholder="Search..." leftIcon={<IconSearch size={13} />} />
<Input placeholder="API key" mono value="sk_live_abc123" readOnly />
<Input placeholder="Small" size="sm" />