Skip to content

Input

A single-line text field: a well with the control edge as an inset ring, and the focus wake.

Base UI0.6 kB gzipSource Registry JSON

Input playground

Props

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/input.json

The CLI writes components/ikada/input.tsx and merges the ikada theme into your CSS. Or take it from the package: import { Input } from "@sproutboat/ikada";

Usage

import { Input } from "@/components/ikada/input";

<Input aria-label="Domain" placeholder="robin.sproutboat.app" />

Examples

Default

Give it a name with a Field label, or aria-label when the context already labels it.

Monospace

For ids, keys and hashes.

Invalid

A danger ring and aria-invalid. Prefer the error on a Field, which also announces the message.

Read only

Disabled

Props

InputProps
PropTypeDescription
classNamestringClasses merged onto the root element, after ikada's own.
invalidbooleanMarks the field invalid: danger ring and aria-invalid. Prefer the Field error.
monobooleanMonospace face for ids, keys and hashes.
styleCSSProperties | ((state: InputState) => CSSProperties)Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, InputState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

Also takes every prop of Omit<ComponentProps<typeof BaseInput>, "className">.

Source: src/components/input.tsx