Getting Started
Usage
Simple Form Elements
- Yarn
yarn
# Build project (development)
yarn run dev
# Build project (production)
yarn run build
# Watch js and css files
yarn run watch
See index.html and app.js for implementation examples.
const opts = {
// adds namespace to all css classes, if they are not overriden from below
classNamespace: 'simple-',
// class for checkmark icon
classCheckmark: 'checkmark',
// class for radiomark icon
classRadiomark: 'radiomark',
// class of the container of the checkbox element
classCheckboxContainer: 'checkbox-container',
// class of the container of the file input element
classFileContainer: 'file-container',
// class of the container of the radio option element
classRadioContainer: 'radio-container',
// class of the container of the select element
classSelectContainer: 'select-container',
}
init(select, opts)
open(select)
close(select)
clear(select)
destroy(select)
const opts = {
animationSpeed: 250,
animationType: 'ease',
allowClear: false,
closeOnDocumentClick: true,
closeOnOpenAnother: true,
placeholder: null,
showValue: true,
}
'data-placeholder' attribute on select tag also works
- init
- change
- open
- close
- clear
- destroy
init(checkbox, opts)
check(checkbox)
- init
- change
init(radio, opts)
check(radio, opts)
- init
- change
init(file, opts)
clear(file, opts)
const opts = {
allowClear: false,
placeholder: 'No file selected',
}
'data-placeholder' attribute on file tag also works
- init
- change
- clear