Input

Stable
This component has limited functionality on the server side. In Next.js, add "use client" at the top to make it work.

A flexible text input component with labels, validation states, and helper text support.

Import

TypeScript React
import { Input } from "laxod";

Basic Usage

A simple input field with a label.

Basic Input

Input Types

Inputs support all standard HTML input types. Not all of them are fully functional and styled yet tho.

Input Types

Helper Text

Add additional context or instructions with helper text.

Helper Text

Choose a unique username between 3-20 characters

Error State

Display validation errors with the error prop. An error icon appears by default.

Error State

Password must be at least 8 characters

Success State

Show a success state with an optional success icon.

Success State

Username is available

Full Width

Make the input span the full width of its container.

Full Width Input

Disabled State

Disable user interaction with the disabled prop.

Disabled Input

Controlled Input

Control the input value with React state.

Controlled Input

0 characters

Current value: (empty)

Props

PropTypeDefaultDescription
labelstring-Label text displayed above the input
errorstring-Error message to display below the input
helperTextstring-Helper text displayed below the input
fullWidthbooleanfalseMakes the input take full width of container
successbooleanfalseShows success styling
showSuccessIconbooleanfalseShows success icon when success is true
showErrorIconbooleantrueShows error icon when error is present
typestring"text"HTML input type (text, email, password, etc.)
classNamestring""Additional CSS classes to apply
...propsInputHTMLAttributes-All standard HTML input attributes