Input

A single-line text field. Use it for names, emails, tokens, numbers, dates, times, and inline searches.

Installation

pnpm dlx shadcn@latest add https://sprout.tulipfarm.ai/r/input.json

Copies Input and the components it uses (Field) into your app, installs the packages, and adds the styles. Then import it from @/components/ui/input. Needs Tailwind CSS 4 and a components.json from shadcn init.

Scales

md fits dense forms. lg is for sign-in and onboarding. Each scale shows the fields Cloud uses it for.

Medium

32px · settings, dialogs, builders

17/120

Channel ID, like C0123456789.

Large

36px · sign-in and onboarding

States

Empty with a placeholder, filled, read-only, disabled, and invalid, at both scales. Field.Root passes disabled and invalid to the input.

Medium

Read-only. Select it to copy.

Enter a full email address.
Large

Read-only. Select it to copy.

Enter a full email address.

Types

Each native type Cloud uses. Date, time, and number inputs keep the browser picker and take min, max, and step.

Paste a comma-separated list to add many.

Stored encrypted. You can rotate it later.

Minutes, from 1 to 1440.

Tokens before older turns are summarised.

Letters, numbers, and dashes.

Your time zone.

Labels without a field

Pair id with a label's htmlFor and point aria-describedby at help and error text. Inline searches use aria-label.

The part before .atlassian.net.

  • Customers
  • Invoices
  • Purchase orders
  • Suppliers
  • Support tickets

Create workspace

Large inputs in a form. Submit empty to see a field error. The URL acme is taken, so the server error lands on the slug. Inputs are disabled while saving.

4/48

tulip.farm/acme

Inline rename

autoFocus and aria-label for a title edited in place. Enter saves and Escape cancels. The input is read-only while it saves, so focus stays put.

Q3 supplier review

Hidden file chooser

A hidden file input with a ref, opened by a button. tabIndex={-1} and aria-hidden keep it out of focus and the accessibility tree.

PNG, JPEG, or WebP

Compositions

SidebarInput is the sidebar search field. Override data-slot and className to set an Input inside your own bordered group.

  • Overview
  • Agents
  • Workflows
  • Tables
  • Files
  • Settings
/

The group draws the border and focus ring.

Usage

Input usageTSX
import { Field } from "@base-ui/react/field";
import { Input } from "@tulipfarm/sprout/input";

const [name, setName] = useState("");

<Field.Root invalid={!name.trim()}>
  <Field.Label>Agent name</Field.Label>
  <Input
    value={name}
    maxLength={120}
    placeholder="People Ops helper"
    onChange={(event) => setName(event.target.value)}
  />
  <Field.Error match>Enter a name.</Field.Error>
</Field.Root>

<label htmlFor="site">Site ID</label>
<Input id="site" aria-describedby="site-help" />

<Input scale="lg" type="email" placeholder="[email protected]" autoComplete="email" />

Input renders a native input and takes every input prop:value or defaultValue, onChange(or Base UI's onValueChange), ref,required, maxLength, pattern,autoComplete, inputMode, and event handlers such as onKeyDown and onPaste.

Props

scale is "sm" (28px, 12px text), "md" (32px, the default, 14px text), or"lg" (36px, 14px text). Use lg for sign-in and onboarding forms.

type can be any native type. Cloud uses text, email, password, number, url, date, time, datetime-local, and file. A visible file input styles its button to match. A hidden file input (hidden, tabIndex={-1},aria-hidden) can be opened with ref.current.click().

disabled dims the input and blocks edits.readOnly keeps it focusable and selectable, which suits copy fields and saving states. aria-invalid draws a danger border and focus ring. The input sets data-slot="input" anddata-scale; you can pass your own data-slot andclassName to set it inside another control.

With a field

Input is a Base UI Input, so it works inside Base UIField.Root. The field gives it an id, labels it withField.Label, describes it with Field.Descriptionand Field.Error, and passes disabled andinvalid. Without a field, pair id with a label's htmlFor, or use aria-label.

SidebarInput

Sidebar searchTSX
import { SidebarHeader, SidebarInput } from "@tulipfarm/sprout/sidebar";

<SidebarHeader>
  <SidebarInput aria-label="Search sample sidebar" placeholder="Search locally…" />
</SidebarHeader>

SidebarInput is a default-scale Input on the canvas color, withdata-slot="sidebar-input" anddata-sidebar="input".

Accessibility

Every input needs a name: a field label, a label withhtmlFor, or aria-label. Pointaria-describedby at help and error text. A focused input shows a 2px focus ring, red when invalid. Read-only inputs stay in the tab order; disabled ones leave it.

Color changes take 120ms and stop when reduced motion is requested. In forced colors mode the input keeps a system border and a highlight focus ring.

Theme tokens

The border uses --sprout-input, the fill--sprout-surface, text --sprout-text, and the placeholder --sprout-muted. Focus uses--sprout-focus, invalid --sprout-danger, and disabled --sprout-hover. Radius follows--sprout-radius-control. The opt-in TulipFarm theme tints the focus ring through these tokens.