NOCTA UI

Input

A versatile input component with multiple variants, sizes, icons, and dark mode support

Installation

Install the Input component using the nocta-ui CLI:

npx nocta-ui add input

Then import the component:

import { Input } from '@/components/ui/input';

Examples

Default Input

Input with Label

Input with Helper Text

Choose a unique username between 3-20 characters

Variants

The Input component supports three variants: default, error, and success.

This field is required

Valid input

Sizes

Three size options are available: sm, md, and lg. The default size is md.

Input with Icons

Left Icon

Right Icon

Input States

Disabled State

Read Only State

This field is read-only

Api Reference

PropTypeDefaultDescription
variant'default' | 'error' | 'success''default'Input style variant
size'sm' | 'md' | 'lg''md'Input size
labelstringLabel text displayed above the input
helperTextstringHelper text displayed below the input
errorMessagestringError message (shown when variant is 'error')
leftIconReact.ReactNodeIcon displayed on the left side
rightIconReact.ReactNodeIcon displayed on the right side
classNamestring''Additional CSS classes for the input
containerClassNamestring''Additional CSS classes for the container
disabledbooleanfalseDisable the input
readOnlybooleanfalseMake the input read-only
placeholderstringPlaceholder text
typestring'text'Input type (text, email, password, etc.)

The Input component also accepts all standard HTML input attributes.