Skip to main content

Input

A text input. Input.Search adds a clear button and a search action; Input.TextArea is the multi-line variant.

import { Input } from '@jbpark/ui-kit';

<Input placeholder="Basic input" />
<Input.Search placeholder="Search..." onSearch={value => console.log(value)} />
<Input.TextArea placeholder="Text area" rows={3} />;
Last search: none

Input

A thin wrapper with no props beyond React.ComponentPropsWithRef<'input'>.

PropTypeDefault
allowClearbooleantrue
onChange(e: ChangeEvent<HTMLInputElement> | { target: { value: string } }) => void-
onSearch(value: string) => void-

onSearch fires on pressing Enter or clicking the search button. Also accepts the rest of React.ComponentPropsWithRef<'input'>.

Input.TextArea

A thin wrapper with no props beyond React.ComponentPropsWithRef<'textarea'>.