Reticle@etched/reticle 0.0.0

Input

Single-line text field. Native <input> attributes and ref pass through.

import { Input } from "@etched/reticle/input";

export function Preview() {
  return <Input aria-label="Search runs" placeholder="Search runs" />;
}

Installation

import { Input, InputArea } from "@etched/reticle/input";

Examples

Sizes

import { Input, type InputSize } from "@etched/reticle/input";

const sizes: InputSize[] = ["sm", "base"];

export function Sizes() {
  return (
    <div className="row">
      {sizes.map((s) => (
        <Input key={s} size={s} aria-label={`Search, ${s}`} placeholder={`Search (${s})`} />
      ))}
    </div>
  );
}

Labels and states

label, description and error wrap the input in a Field.

Shown on the run page.

Site TPE-9 does not exist.
import { Input } from "@etched/reticle/input";

export function LabelsAndStates() {
  return (
    <div className="grid">
      <Input label="Run ID" defaultValue="run_7f3a91c2" />
      <Input label="Owner" placeholder="Name or email" description="Shown on the run page." />
      <Input label="Site" defaultValue="TPE-9" error="Site TPE-9 does not exist." />
      <Input label="Created by" defaultValue="system" disabled />
    </div>
  );
}

Input area

import { InputArea } from "@etched/reticle/input";

export function InputAreas() {
  return (
    <div className="grid">
      <InputArea label="Comment" rows={3} placeholder="Add a comment" />
      <InputArea label="Notes (grows from 2 to 6 rows)" autoResize minRows={2} maxRows={6} placeholder="Type several lines" />
    </div>
  );
}

Character limit

limit shows the count under the field. Past the limit, the count and the field turn red; nothing is cut off.

63 / 140
76 / 60
import { InputArea } from "@etched/reticle/input";

export function CharacterLimit() {
  return (
    <div className="grid">
      <InputArea label="Note to the hiring manager" limit={140} defaultValue="Strong on clock trees; wants to stay close to silicon bring-up." />
      <InputArea
        label="Summary"
        limit={60}
        defaultValue="Led the clock tree rework on the last tape-out, and owned the bring-up plan."
      />
    </div>
  );
}

API reference

InputArea

PropTypeDefaultDescription
labelReactNode–
descriptionReactNode–
errorFieldError–
size"sm" | "base""base"
autoResizeboolean–Grow and shrink with the text, between minRows and maxRows.
minRowsnumber1
maxRowsnumber–
limitnumber–Shows "n / limit" under the field. Typing past it is allowed: the count and the field turn red, so no text is cut off without notice.
classNamestring–

Input

PropTypeDefaultDescription
labelReactNode–
descriptionReactNode–
errorFieldError–
size"sm" | "base""base"
classNamestring–