Skip to content
Pixelbits
Docs / Input
Forms

Input

A single-line text field. Inside a Field it picks up its id, label, description and error automatically. All native input props are passed to the <input>; the ref points at it too.

⌘K

Installation

npm: import
import { Input } from "pixelbits/input";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/input.json

API

<Input>

A single-line text field. Inside a Field it picks up its id, label, description and error automatically. All native input props are passed to the <input>; the ref points at it too.

Example
<Field label="Search">
  <Input start={<SearchIcon />} end={<kbd>⌘K</kbd>} placeholder="Search components" />
</Field>
PropTypeDefaultDescription
size"sm" | "md" | "lg""md"

Height: "sm" 32 px, "md" 40 px, "lg" 48 px.

startReactNode—

Content before the text, usually an icon (e.g. a search glass).

endReactNode—

Content after the text: an icon, a unit, a kbd hint or a small button.

frameClassNamestring—

Classes for the outer frame (the className prop goes to the <input>).

Also accepts every prop of Omit<InputHTMLAttributes<HTMLInputElement>, "size">.