Checkbox
Checkbox control
Parameters you can pass
Parameters | Data type | Description |
---|---|---|
name | string | Input name to be used in a form |
value | string | Input value |
id | string | Input ID |
text | string | Text by the checkbox |
class_name | string | Wrapper class (you can pass several of them) |
input_class_name | string | Input class |
text_class_name | string | Text label class (if it was passed) |
checked | bool | It shows if it's checked |
disabled | bool | It shows if it's disabled |
small | bool | It shows if it's smaller than usual |
Unchecked (default)
self.render({ ref: '/tmpl/controls/checkbox.twig' }, {
name: 'checkbox',
class_name: 'checkbox-wrapper-classname',
input_class_name: 'checkbox-input-classname'
});
Checked
self.render({ ref: '/tmpl/controls/checkbox.twig' }, {
name: 'checkbox',
checked: true
});
Disabled
self.render({ ref: '/tmpl/controls/checkbox.twig' }, {
name: 'checkbox',
disabled: true
});
Checked Disabled
self.render({ ref: '/tmpl/controls/checkbox.twig' }, {
name: 'checkbox',
checked: true,
disabled: true
});
Checkbox with text
self.render({ ref: '/tmpl/controls/checkbox.twig' }, {
name: 'checkbox',
text: 'Would you like to sign up for newsletters?',
text_class_name: 'checkbox-text-classname'
});
Small checkbox with text
self.render({ ref: '/tmpl/controls/checkbox.twig' }, {
name: 'checkbox',
text: 'Would you like to sign up for newsletters?',
text_class_name: 'checkbox-text-classname',
small: true
});
Updated 5 months ago