Input

An Input component is a user interface element that allows users to enter data, such as text, numbers, or selections. It typically includes various types, such as text fields, checkboxes, radio buttons, and dropdowns, providing flexibility for different data types. Input components are essential for forms and interactive applications, enabling users to submit information effectively and efficiently.
# Demo
# Attributes
NameTypeDefaultDetails
classNamestring' 'You can customise by passing tailwind classes.
labelClassNamestring' 'You can customise by passing tailwind classes.
inputClassNamestring' 'You can customise by passing tailwind classes.
idstringinputYou can pass id to create unique identifier.
labelstring' 'You can pass label of the input.
placeholderstring' 'You can pass placeholder of the input.
valuestring' 'You can pass value of the input.
typetext | email | number | date ..etctextYou can pass type of the input.
disabledbooleanfalseYou can pass disabled to set default checkbox state.
onChange(value: string | number) => voidRequiredYou can get callback when input value changed.
# Usage
import { NInput } from 'nayan'; 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;