Skip to content

Latest commit

 

History

History
133 lines (112 loc) · 3.07 KB

File metadata and controls

133 lines (112 loc) · 3.07 KB

import { ComponentLinks, InteractiveCodeblock, PropsTable, Codeblock, } from "@/components/index";

Input

The Input component is a text field used to get input from the user.

Imports

import {
  Input,
  InputBase,
  InputPrefix,
  InputSuffix,
  useInputProps,
  useInputState,
  InputWrapper,
} from "@adaptui/react-tailwind";

<Nextra.Callout> A complex component that supports customization as per the composition guide. </Nextra.Callout>

Usage

<InteractiveCodeblock children={({ spreadProps }) => <Input placeholder="Search" ${spreadProps}/>} booleanProps={["disabled", "invalid", "loading"]} themeProps={{ variant: "input.variant", size: "input.size" }} />

Input Variants

Variants can be set using the variant prop. The default variant is outline. The available variants are: outline subtle underline & ghost

<Codeblock live code={`

`} />

Input sizes

Sizes can be set using the size prop. The default size is md. The available sizes are: sm md lg xl

<Codeblock live code={`

`} />

Input Prefix/Suffix

You can append or prepend any element inside Input. By default we don't give spacing to the elements so you have to add spacing as needed.

Prefix is positioned absolutely within the input.

<Codeblock live code={`

} /> } /> } suffix={} />
`} />

API Reference

<PropsTable data={[ { name: "size", themeKey: "input.size", default: "md" }, { name: "variant", themeKey: "input.variant", default: "outline" }, { name: "disabled", type: "boolean", description: "If true, the Input will be disabled.", default: "false", }, { name: "invalid", type: "boolean", description: "True, if the value of the input is invalid.", default: "false", }, { name: "loading", type: "boolean", description: "True, if the input is loading.", default: "false", }, { name: "prefix", type: "React.ReactNode", description: "Prefix for the Input", }, { name: "suffix", type: "React.ReactNode", description: "Suffix for the Input", }, { name: "spinner", type: "React.ReactNode", description: "Spinner component to display when loading.", },

]} />