ComponentsInput

Input

A customizable input component with icon support and password toggle




The Input component creates a customizable text input field with various features like floating labels, left and right icons, and password visibility toggle.

Tip!

Use the secure prop to create a password input with a visibility toggle.

Warning!

The Input component uses the 'use client' directive, ensuring it's only rendered on the client-side. Be mindful of this when using it in your Next.js application.




Props

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the input container
labelstring-Label text for the input
leftIconcomponent-Icon component to display on the left side of the input
rightIconcomponent-Icon component to display on the right side of the input
leftIconOnClickfunction-Function to execute when the left icon is clicked
rightIconOnClickfunction-Function to execute when the right icon is clicked
focusboolean-Whether to show focus styles
secureboolean-Whether the input is for password entry
textSizestring"text-lg"Tailwind CSS class for text size

Info

The component also accepts all standard HTML input attributes as additional props.




Usage Examples

Basic Input

Input with Left Icon

Password Input

Input with Right Icon and Click Handler

Custom Styled Input

Tip!

Combine different props to create inputs that match your design requirements and enhance user interaction.