Input
An Input component allows users to enter text data. Built on top of heroui-native Input.
Demo
Demo Coming Soon
Input examples will be available soon.
Usage
import { NInput } from '@nayan-ui/react';import { useState } from 'react';const Input = () => {const [email, setEmail] = useState('niranjan.devasani@gmail.com');return (<NInput id="email" type="email" label="Email" placeholder="Enter email" className="mb-3" value={email} onChange={e => setEmail(e.target.value)} />);};export default Input;
Attributes
| Name | Type | Default | Details |
|---|---|---|---|
| label | string | Optional | Label for the input field. |
| description | string | Optional | Description text below the input. |
| errorMessage | string | Optional | Error message to display. |
| multiline | boolean | false | Whether to render as a multiline textarea. |
| isDisabled | boolean | false | Whether the input is disabled. |
| isRequired | boolean | false | Whether the input is required. |
| isInvalid | boolean | false | Whether the input is in an invalid state. |
| value | string | Optional | Controlled input value. |
| onChange | (value: string) => void | Optional | Callback when input value changes. |
| className | string | ' ' | You can customise input by passing tailwind classes. |
| containerClassName | string | ' ' | You can customise container by passing tailwind classes. |
| labelClassName | string | ' ' | You can customise label by passing tailwind classes. |
| descriptionClassName | string | ' ' | You can customise description by passing tailwind classes. |
| errorClassName | string | ' ' | You can customise error by passing tailwind classes. |