Build faster with Premium Chakra UI Components 💎

Learn more
Skip to Content
DocsPlaygroundGuidesBlog
Sponsor

Input

Used to get user input in a text field.

SourceStorybookRecipe

Usage

import { Input } from "@chakra-ui/react"
<Input placeholder="..." />

Examples

Variants

Use the variant prop to change the visual style of the input.

Sizes

Use the size prop to change the size of the input.

Helper Text

Pair the input with the Field component to add helper text.

We'll never share your email.

Error Text

Pair the input with the Field component to add error text.

This field is required

Field

Compose the input with the Field component to add a label, helper text, and error text.

Hook Form

Here's an example of how to integrate the input with react-hook-form.

Left and Right Element

Pair the input with the InputElement component to add an element to the left or right of the input.

https://
⌘K
https://

Addon

Use the InputAddon and Group components to add an addon to the input.

https://
.com

Disabled

Use the disabled prop to disable the input.

Placeholder Style

Use the _placeholder prop to style the placeholder text.

Floating Label

Here's an example of how to build a floating label to the input.

Mask

Here's an example of using the use-mask-input library to mask the input shape.

Props

PropDefaultType
colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent'

The color palette of the component

size 'md'
'lg' | 'md' | 'sm' | 'xs'

The size of the component

variant 'outline'
'outline' | 'filled' | 'flushed'

The variant of the component

Previous

Image

Next

Menu