Button

Displays a button or a component that looks like a button.
# Demo
# Attributes
NameTypeDefaultDetails
classNamestring' 'You can customise by passing tailwind classes.
isOutlinebooleanfalseYou can pass this to create outline button.
isLoadingbooleanfalseYou can pass this to show loading indication.
loadingTextstring' 'You can pass this to show customised loading text.
sizeButtonSizeButtonSize.MDYou can pass size of the button.
childrenstring | ReactNodeRequiredYou can pass button content as children.
onClick(e: any) => voidRequiredYou can get callback when button clicked.
Note: Along with these params you can also pass all default button params.
# Usage
import { NButton, ButtonSize } from 'nayan'; const Button = () => { return ( <div> <NButton size={Size.XS} disabled className="text-text bg-card border border-border mr-2"> Button </NButton> <NButton type="submit" size={ButtonSize.XS} onClick={() => console.log('Button clicked')} className="text-white bg-blue-500 hover:bg-blue-600 border border-blue-600 mr-2"> Button </NButton> <NButton type="reset" size={ButtonSize.SM} onClick={() => console.log('Button clicked')} className="text-white bg-green-500 hover:bg-green-600 border border-green-600 mr-2"> Button </NButton> <NButton size={ButtonSize.MD} isLoading={true} onClick={() => console.log('Button clicked')} className="text-white bg-yellow-500 hover:bg-yellow-600 border border-yellow-600 mr-2"> Button </NButton> <NButton size={ButtonSize.LG} onClick={() => console.log('Button clicked')} className="mr-2"> Button </NButton> <NButton size={ButtonSize.LG} isOutline={true} onClick={() => console.log('Button clicked')} className="mr-2"> Button </NButton> <NButton size={ButtonSize.LG} onClick={() => console.log('Button clicked')} className="text-white bg-purple-500 hover:bg-purple-600 border border-purple-600 rounded-full mr-2"> Button </NButton> </div> ); }; export default Button