Toggle Group
A row of toggle buttons for switching between views, filters, or modes. Supports single-select (radio-like) and multi-select (checkbox-like) modes with full keyboard navigation using arrow keys.
Outline
Bordered buttons in a row with active state fill. Clean and professional.
_toggle_group.html.erb
███
██████ █████ █████████ █ ███████ █████ █████████
██████
███ ██████ ██████████████████████████████████ ██████ █
█ ██████ ██████ ██████ █████ ██
█ ██████ ███████ ██████ ██████ ██
█ ██████ ████████ ██████ ███████ █
██ ██████ ██████ █████ ███████████ ██
toggle_group_controller.js
██████ █ ██████████ █ ████ ████████████████████
██ ████████ ██ ██████████████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ██████████ ████████
██████ ██████ █ █
█████ █ █████ ███████ ████████ ████████ ██
█████████ █ █████ ██████ ████████ ██ █
█
toggle_group_outline_component.rb
█ ██████████████████████ ████
█████ ███████████████████████████ █ ███████████████████
█████ █ █
███ █████ ██████ █████████
███ █████ ████ █████████
███ █████ ██████ ██████████
████████
███ ██████████████████ █████ ████████ █████ ████ ██████ ████ █████ ████ █████████ ██████ ████████████████
toggle_group_outline_component.html.erb
████ ██████████████████████████████
█████████████████████████████████ █████ ███
█████████████████████████████████████ ███████████████████████ ███
██████████ █████████████████ ███
████████████
██████████████████ ███████
██ ███████████ ██ ██████ ██
███████ █████████████
█████████████████████████████████
███████████████████████████████████████ ██████████████████████████████
toggle_group_controller.js
██████ █ ██████████ █ ████ ████████████████████
██ ████████ ██ ██████████████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ██████████ ████████
██████ ██████ █ █
█████ █ █████ ███████ ████████ ████████ ██
█████████ █ █████ ██████ ████████ ██ █
█
Pill
Rounded pill buttons with subtle background on active. Softer aesthetic.
_toggle_group.html.erb
███
██████ █████ █████████ █ ████ █████ █████████
██████
███ ██████ ███████████████████████████████ ██████ █
█ ██████ ██████ ██████ █████ ██
█ ██████ ███████ ██████ ██████ ██
█ ██████ ████████ ██████ ███████ █
██ ██████ ██████ █████ ███████████ ██
toggle_group_controller.js
██████ █ ██████████ █ ████ ████████████████████
██ ████████ ██ ██████████████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ██████████ ████████
██████ ██████ █ █
█████ █ █████ ███████ ████████ ████████ ██
█████████ █ █████ ██████ ████████ ██ █
█
toggle_group_pill_component.rb
█ ██████████████████████ ████
█████ ████████████████████████ █ ███████████████████
█████ █ █
███ █████ ██████ █████████
███ █████ ████ █████████
███ █████ ██████ ██████████
████████
███ ██████████████████ █████ ████████ █████ ████ ██████ ████ █████ ████ █████████ ██████ ████████████████
toggle_group_pill_component.html.erb
████ ██████████████████████████████
█████████████████████████████████ █████ ███
█████████████████████████████████████ ███████████████████████ ███
██████████ █████████████████ ███
████████████
██████████████████ ███████
██ ███████████ ██ ██████ ██
███████ █████████████
█████████████████████████████████
███████████████████████████████████████ ██████████████████████████████
toggle_group_controller.js
██████ █ ██████████ █ ████ ████████████████████
██ ████████ ██ ██████████████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ██████████ ████████
██████ ██████ █ █
█████ █ █████ ███████ ████████ ████████ ██
█████████ █ █████ ██████ ████████ ██ █
█
Changelog
- v1.0.0: Initial release with outline and pill styles
Get Full Access
Unlock the source code for this component and all others. One-time payment for lifetime access.
Get Access Now