Checkbox

                Checkbox::widget([
    'label' =>'Some checkbox',
    'name' => 'my_checkbox',
]);
                
                

Checkbox style

Slider
                Checkbox::widget([
    'label' =>'Some checkbox',
    'name' => 'my_checkbox',
    'style' => Checkbox::STYLE_SLIDER,
]);
                
                
Toggle
                Checkbox::widget([
    'label' =>'Some checkbox',
    'name' => 'my_checkbox',
    'style' => Checkbox::STYLE_TOGGLE,
]);
                
                

Checkbox status

Active
                Checkbox::widget([
    'label' =>'Some checkbox',
    'name' => 'my_checkbox',
    'isActive' => true,
    'style' => Checkbox::STYLE_TOGGLE,
]);
                
                
Disabled
                Checkbox::widget([
    'label' =>'Some checkbox',
    'name' => 'my_checkbox',
    'isDisabled' => true,
    'style' => Checkbox::STYLE_TOGGLE,
]);
                
                
Read only
                Checkbox::widget([
    'label' =>'Some checkbox',
    'name' => 'my_checkbox',
    'isReadOnly' => true,
    'style' => Checkbox::STYLE_TOGGLE,
]);
                
                
Setting Default Description
label string Checkbox label
style Checkbox::STYLE_TOGGLE
Checkbox::STYLE_SLIDER
View style
name null Input name
value null Input value
inputOptions array Additional input options
options array Main container html options
isActive false Checked if true
isDisabled false Disable checkbox
isReadOnly false Ser read-only checkbox