Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 1.53 KB

checkbox.md

File metadata and controls

61 lines (44 loc) · 1.53 KB

Checkboxes

Bootstrap documentation

Basic usage

{{ bs()->checkbox('age_verification')
       ->description('I am above 18 years old') }}
{{ bs()->checkbox('age_verification')
       ->description('I am checked')
       ->checked() }}
{{ bs()->checkbox('age_verification', 'one liner way to set common stuff', true) }}
{{ bs()->checkbox('age_verification')
       ->description('I am disabled') 
       ->disabled() }}

HTML description

{{ bs()->checkbox('agree_terms')
       ->description('I have read the <a href="#">terms of use</a>') }}

Checkboxes with name representing an array of options

{{ bs()->checkbox('hobbies[]')->id('hobby_ski')->description('Skiing') }}
{{ bs()->checkbox('hobbies[]')->id('hobby_surf')->description('Surfing') }}
{{ bs()->checkbox('hobbies[]')->id('hobby_dive')->description('Diving') }}
{{ bs()->checkbox('frameworks[laravel][is_selected]')->description('Laravel') }}
{{ bs()->checkbox('frameworks[symfony][is_selected]')->description('Symfony') }}
{{ bs()->checkbox('frameworks[cakephp][is_selected]')->description('CakePHP') }}

Wrapped inside a form group

It can be wrapped inside a form group if needed (to show errors for instance).

{{ bs()->formGroup()
       ->label('Terms of Use', true)
       ->control(bs()->checkbox('agree_terms')
                     ->description('I have read the <a href="#">terms of use</a>')) }}