Input

A form control for collecting user text input with support for various types, addons and icons.

Overview

The Input component is a flexible form control for collecting user text input. It supports various input types, decorative elements like addons and icons, multiple sizes, and URL state synchronization for preserving input values across page navigation.

Usage

import {
  Input,
  InputAddon,
  InputGroup,
  InputWrapper,
} from "@tilt-legal/cubitt-components/primitives";
<Input type="email" placeholder="Email" />

Examples

Looking for date or time inputs? See the Date Input docs for DateInput, DateInputRoot, and TimeInputRoot.

Basic Input

A simple text input field.

Disabled and Readonly

Input fields that are disabled or readonly.

With Addons

Use InputGroup with InputAddon to attach elements to an input. Each element maintains its own visual boundary.

With Embedded Elements

Use InputWrapper to place elements inside an input. Elements appear embedded within a single field.

File Input

Input for file uploads.

Copy to Clipboard

Input with a copy-to-clipboard button.

Clearable Input

Input with a clear button.

Sizes

Input fields in different sizes.

Inline

Use variant="inline" for inputs that look like text. Useful for editable titles, inline editing, or any context where you want the input to blend with surrounding text.

URL State

Input with URL state synchronization.


API Reference

Input

The main input component for text entry. Built on Base UI Input with additional URL state management capabilities.

PropTypeDefaultDescription
typestring"text"Input type (text, email, password, etc.)
variant"default" | "inline""default"Visual style. Use inline for text-like inputs
size"sm" | "md" | "lg""md"Size of the input (ignored when variant="inline")
placeholderstring-Placeholder text
disabledbooleanfalseWhether the input is disabled
readOnlybooleanfalseWhether the input is read-only
classNamestring-Additional CSS classes

URL State Props

The following props enable URL state management by syncing the input value with URL parameters via TanStack Router search params. When paramName is provided, the input's value will be reflected in the URL.

PropTypeDefaultDescription
paramNamestring-URL parameter name for syncing state with URL. When provided, enables URL state management.
paramValuestring-Controlled value for the URL parameter (syncs with input value).
onUrlValueChange(value: string | null) => void-Callback when URL parameter value changes.
paramClearOnDefaultbooleantrueRemove URL param when value equals default.
paramThrottlenumber-Throttle URL updates in milliseconds.
paramDebouncenumber-Debounce URL updates in milliseconds.

InputAddon

A decorative addon element for the input.

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Size to match input
classNamestring-Additional CSS classes

InputGroup

Container for attaching InputAddon elements to an input. Each element maintains its own visual boundary.

PropTypeDefaultDescription
classNamestring-Additional CSS classes

InputWrapper

Container for placing icons or buttons inside an input. Elements appear embedded within a single field. Size is automatically detected from the Input inside.

PropTypeDefaultDescription
classNamestring-Additional CSS classes

On this page