Simple button radios
Simple button radios is a simple plugin for transform radio inputs into html buttons for css customize. High performance, keyboard support and preserve original input click/change events.
Getting started
1. Include Simple button radios files to website/app
After that we need to include CSS and JS files to our website/app. In your html file:
2. Add html inputs
This plugin contemplates several label-input formats:
3. Initialize plugin
After load jquery and simple-button-radios js files
Options
Parameter | Type | Default | Description |
---|---|---|---|
buttonClass |
string |
'sbr-default' |
Class attribute value for new html button tag |
checkedIcon |
string |
'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="-725.53 115.775 1451.338 1451.338"><path d="M.141 376.731c-256.717 0-464.713 207.995-464.713 464.713 0 256.72 207.997 464.715 464.713 464.715 256.718 0 464.712-207.995 464.712-464.715 0-256.718-207.994-464.713-464.712-464.713z"/></svg>' |
button inner html when input is checked |
nonCheckedIcon |
string |
'' |
button inner html when input is not checked |
wrapContainer |
string |
'none' |
Values: 'none' or 'input' or 'all'. Wrap with a div label and input, only input or nothing. |
btnAttributes |
object |
{ type : 'button' } |
Add attribute name - value into new html button. Example:btnAttributes: {
|