Input Component

The Input component is a flexible text input field that can be customized for various use cases.

Props

PropTypeDefaultDescription
labelstringundefinedLabel text for the input
size"xs" | "sm" | "md" | "lg" | "xl""md"Sets the size of the input
variant"primary" | "secondary" | "success" | "warning" | "error" | "ghost""primary"Sets the color variant of the input
typestring"text"Sets the type of the input (e.g., 'text', 'password', 'email')
requiredbooleanfalseWhether the input is required
wrapperClassstring""Additional CSS classes for the wrapper element
labelClassstring""Additional CSS classes for the label element
labelTextClassstring""Additional CSS classes for the label text
sxReact.CSSProperties{}Custom styles to be applied to the input wrapper

Usage

import { Input } from 'knoxui-react';

<Input
  label="Username"
  placeholder="Enter your username"
  size="md"
  variant="primary"
/>

Examples

Basic Usage

Sizes

Variants

Types

Required Input