Input

A pill text field with the secondary material and a soft focus halo.

View source
import { Input } from "@logicplanes/kaeso-ui";

Props

  • align
    "start" | "end"

    Text alignment of the value; numbers align to the end with tabular digits.

  • defaultRevealed
    boolean = false

    Starts a password or secret shown instead of masked.

  • description
    ReactNode

    One sentence of help under the label.

  • error
    ReactNode

    The error message, shown under the control in the danger color; it marks the control invalid and is read out with its description.

  • invalid
    boolean

    Shows it as invalid; pair it with a message that says what to fix.

  • label
    ReactNode

    The visible label.

  • layout
    "horizontal" | "vertical"

    The label above the control (vertical) or beside it (horizontal).

  • leadingIcon
    IconSvgElement

    An icon before the text.

  • onClear
    (() => void)

    Called when a search's clear circle is pressed or Escape clears it.

  • optional
    boolean

    Adds “Optional” to the label, for forms where most fields are required.

  • prefix
    ReactNode

    Text before the value: "https://".

  • secret
    boolean

    Masks a key or token behind a reveal circle, sets it in mono when revealed, and keeps it out of autocomplete and password managers.

  • shortcut
    string[]

    A shortcut hint at the end of an empty search, hidden while it has focus.

  • size
    "md" | "sm" | "lg" | "xl"

    The height of the input: 32px in toolbars, 36px by default.

  • suffix
    ReactNode

    Text after the value: "USD", "/ min".

  • trailing
    ReactNode

    Any trailing element (a button, a Kbd).