Inspector Input

Settings row with a label on the left and a plain text field on the right, sharing the family's pill: the whole row is the label, so pressing anywhere puts the caret in the field.

Installation

Adds the component and everything it depends on to your project.

npx shadcn add https://ui.beste.co/component/r-base/inspector-input

New here? Read the installation guide.

Usage

The import and the props worth knowing about, in one place.

import { InspectorInput } from "@/components/beste/component/inspector-input";

// Uncontrolled
<InspectorInput label="Class name" defaultValue="hero-section" placeholder="Optional" />

// Controlled, with a separate commit for expensive work
<InspectorInput
  label="Alt text"
  value={alt}
  onValueChange={setAlt}                                // every keystroke
  onValueCommit={(value) => console.log("persist", value)} // Enter or blur, if it changed
/>

// A number with its unit; spinners are hidden and the value goes monospace
<InspectorInput label="Offset" type="number" suffix="px" defaultValue="24" />

<InspectorInput
  label="Link"
  type="url"
  align="start"          // "end" (default) tucks short values right; "start" suits long ones
  icon={Link2}           // optional leading icon
  tone="outline"         // "muted" (default) | "outline" | "ghost"
  size="sm"              // "sm" | "default" | "lg"
  placeholder="https://"
  value={href}
  onValueChange={setHref}
/>

// Read-only, and taking part in a form
<InspectorInput label="Slug" name="slug" value={slug} onValueChange={setSlug} />
<InspectorInput label="Id" value={block.id} readOnly />

Playground

Turn the props on the right; the snippet under them is what you would write to get what you see.

Usage
import { InspectorInput } from "@/components/beste/component/inspector-input";

<InspectorInput
  label="Class name"
  className="w-72"
  defaultValue="hero-section"
  placeholder="Optional"
/>

Keyboard and gestures

Every one of these is in the component already. They are listed because a props table cannot mention a gesture, so nothing else on this page can tell you they exist.

EnterCommit the value. It does not submit the surrounding form: a settings row is rarely the only field in one.
EscapePut the last committed value back.

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
label*stringLabel rendered on the left, inside the row.
iconLucideIconOptional leading icon shown before the label.
valuestringControlled value. Pair it with `onValueChange`.
defaultValuestringInitial value in uncontrolled mode.
onValueChange(value: string) => voidFires on every keystroke.
onValueCommit(value: string) => voidFires once the edit is finished — Enter, or leaving the field — and only when the value actually changed. Use it for work too expensive to run per keystroke, such as a request or a re-render of something heavy.
placeholderstringGhost text shown while the field is empty.
type"text" | "number" | "email" | "url" | "tel" | "password" | "search""text"Input type. `number` also hides the spinners and switches the on-screen keyboard to a numeric one.
suffixstringMuted unit after the value, e.g. "px", "%", "ms".
align"start" | "end""end"Which end the text sits at. Short values read better tucked against the right, the way the rest of the family shows a value; long ones, a URL say, are easier to follow from the left.
maxLengthnumber
disabledbooleanBlock interaction and dim the row.
readOnlybooleanShow the value but refuse edits.
tone"muted" | "outline" | "ghost""muted"Surface treatment: filled (default), hairline outline, or bare until hover.
size"sm" | "default" | "lg""default"Row height preset.
namestringName of the input, so the row can take part in a form.
idstringId of the input. The row is a `<label>`, so this is only for outside use.
classNamestring
aria-labelstringAccessible name. Falls back to the visible label.

More Inspector components

View all Inspector

Inspector Switch

Settings row with a label on the left and a switch on the right, sharing the family's pill: the label takes the row's spare width, so a press almost anywhere toggles it.

Inspector Select

Settings row that pairs a label with its current choice inside one pill, opening a width-matched dropdown below: option icons, colour swatches, descriptions and grouped sections, on top of the accessible shadcn select.

CustomWhatever you put here

Inspector Row

The family's escape hatch: label on the left, whatever you hand it on the right, and the same surface, metrics and focus ring as every other row, so a control the family does not have yet still looks like it belongs.

Dark Mode

Inspector Segmented

Settings row whose choices sit side by side on the right, with a marker that slides between them: the readable alternative to a switch when the two states deserve names, and the compact one to a select at three or four options.

Inspector Color

Settings row that keeps the label, the colour value and a swatch on one pill; pressing the row opens the OKLCH colour picker below it, which is where the value is edited.

Borders

Inspector Toggles

Settings row holding a set of pills that are each on or off, so any number of them can be on at once: what inspector-segmented is for one choice out of several, this is for several choices at once, and what inspector-switch is for a single flag, this is for a handful that belong together.