Forms v1.0.0

Checkbox Group

A group of checkbox inputs for selecting multiple options from a list. Supports both form builder mode (with Rails form objects) and standalone usage. Options can include descriptions and can be laid out vertically or horizontally.

Preview & Code

Options

Name Type Default Description
form FormBuilder nil Rails form builder object (for form builder mode)
attribute Symbol nil Model attribute name (for form builder mode)
name String nil Input name attribute (for standalone mode, will append [] for array)
options * Array required Array of options - can be strings, [label, value] pairs, or hashes with :label, :value, and optional :description keys
selected Array [] Array of currently selected values (for standalone mode, auto-detected in form mode)
label String nil Group label text
hint String nil Help text displayed below the group label
layout Symbol :vertical Layout direction: :vertical or :horizontal
required Boolean false Whether at least one selection is required
disabled Boolean false Whether the entire group is disabled
error String nil Manual error message (auto-detected from form object if not provided)
class String "" Additional CSS classes for the container

Changelog v1.0.0

- Initial release with form builder and standalone modes
- Vertical and horizontal layout options
- Support for option descriptions
- Multi-select with array values
- Automatic error detection from Rails form objects
- Dark mode support

Get Full Access

Unlock the source code for this component and all others. One-time payment for lifetime access.

Get Access Now