Input

Displays a form input field or a component that looks like an input field.
# 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.
Note: Along with these params you can also pass all default input params.
# 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;