A foundational input component that provides consistent styling across form fields while remaining highly customizable.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/RespondeIA-APP/front/llms.txt
Use this file to discover all available pages before exploring further.
Installation
The Input component uses:- Custom utility functions from
@/lib/utils - Native HTML input element as base
Basic Usage
Input Types
- Email
- Password
- Text
- Number
- File
Real-World Examples
Login Form Email Input
Frommodules/auth/components/LoginForm.tsx:54-62:
Password Input with Toggle
Frommodules/auth/components/LoginForm.tsx:68-76:
Form Integration
Props
HTML input typeCommon options:
text | email | password | number | tel | url | search | date | filePlaceholder text displayed when input is empty
Controlled input value
Change event handler:
(e: React.ChangeEvent<HTMLInputElement>) => voidAdditional CSS classes to apply to the input
Disables the input and applies disabled styles (cursor-not-allowed, 50% opacity)
Makes the input required for form submission
Indicates input validation state for screen readers
HTML id attribute, used to associate with Label component
Accessibility
- Fully extends native HTML input attributes
- Supports
disabledstate with appropriate cursor and opacity - Placeholder text uses
text-muted-foregroundfor sufficient contrast - Works seamlessly with Label component using
idandhtmlFor - Use
aria-invalidandaria-describedbyfor validation feedback - Required inputs should be marked with
requiredattribute
Styling Details
- Width:
w-full(100% of container) - Background: Transparent by default
- Text size: Base (16px) on mobile, small (14px) on desktop (md breakpoint)
- File input: Styled file button with transparent background
- Placeholder: Uses muted foreground color
- Disabled state:
cursor-not-allowedwith 50% opacity
Customization
The Input component accepts any custom classes through theclassName prop:
TypeScript
cn).