1.9.10 • Published 3 years ago

@humblejs/form v1.9.10

Weekly downloads
8
License
Apache-2.0
Repository
-
Last release
3 years ago

Form

Form elements package contains various UI components for forms.

Demo

Install

yarn add @humblejs/form

Style

Import all the styling

@import '@humblejs/form/dist/css/styles.scss';

or import separately

@import '@humblejs/form/dist/css/form/input.scss';
@import '@humblejs/form/dist/css/form/checkbox.scss';

Usage

You can import all the packages

import Form from '@humblejs/form'

...

<Form.Input />

or you can import separately

import { Input } from '@humblejs/form'

...

<Input />

Input

DescriptionValue
Base component<div>
Base classhjs-form__input
PropsType / DescriptionIs Required?Default
namestringName of the text input elementYES
iconIcon from @humblejs/iconNO
hasErrorboolIf true it adds has-error classNOFALSE

Checkbox

DescriptionValue
Base component<li>
Base classhjs-form__checkbox
NotesMust be inside <ul>
PropsTypeIs Required?Default
namestringName of the text input elementNOnull
valuestringValue for checkboxNOempty
idstringID of input elementYES
onChangefunc(e)e is bool whether checked or notNO
checkedboolChecked or notNOfalse
typestring (checkbox, radio)Type of inputNOcheckbox
iconIcon from @humblejs/iconNOcheck
shapestring (round, square)Shape of checkboxNOround
animationstring (smooth, jelly, rotate, pulse)Animation when user interacts with checkboxNOsmooth
classListArray of stringFor further customising pretty checkboxNO[]