laravel-form-components
Inputs
Checkbox Group
On this page
{note} You're browsing the documentation for an old version of laravel-form-components. Consider upgrading your project to v8. Check your version with the following command:
`composer show rawilk/laravel-form-components`
Introduction
The checkbox group allows you to quickly group related checkboxes or radio buttons together in your forms. This is not a replacement for the form-group component, and should be used inside of the form-group component in your forms.
Basic Usage
The most basic usage is like this:
<x-checkbox-group>
checkbox 1
checkbox 2
</x-checkbox-group>
This will output:
<div class="space-y-4">
checkbox 1
checkbox 2
</div>
Inline Groups
By default, the checkbox-group
is designed to stack your checkboxes and radio inputs, but you can display them inline
with each other, by setting the stacked
attribute to false
. This will display the checkboxes in rows of 3 columns.
<x-checkbox-group :stacked="false">
checkbox 1
checkbox 2
</x-checkbox-group>
This will output:
<div class="form-checkbox-group">
checkbox 1
checkbox 2
</div>
If you want a different amount of columns for your groups, you should override the .form-checkbox-group
class in
your stylesheets.