Tag Input
Text input that creates removable tags/chips as values are entered. Supports validation, max tags limit, and autocomplete suggestions. Tags can be added via Enter key, comma delimiter, or custom delimiter. Hidden inputs are automatically generated for form submission.
Preview & Code
_tag_input.html.erb
███
███ █████ █████████ █████████
█████ █ ██████
███ ██████ ████████████ █████ █████████████ ██████ ███████ ████████████ ████ █ ███████ ██
█████ █ ████ ███████ ████ ███ ████
███ ██████ ████████████ █████ ████████ █████████ █████████ ██ █████ ████████████████ ██████ ████████ ██
█████ █ █████ ██████████ ████ ████████████
tag_input_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ █████████ ████████████ ██████████ ██████████████ ██████████
██████ ██████ █ █
█████ █ █████ ██████ ████████ ██ ██
████████ ███████
█████████ ███████
████████████ █ █████ ██████ ████████ ██ ██
████████████████ █ █████ ████████ ████████ █████ ██
tag_input_component.html.erb
█████
██ ██ ███████████████ ██
██████ ████████████ ███████ ███████████ ██████████████ ███████████████████ ███████████ ██████ ██████████
██ ███ ██
████ ███ ████████████████████ ████████████████ ███
████ ██████████ █████████████████ ███
█████████████████████████████████
██████████████████████████████████████████
tag_input_component.rb
█ ██████████████████████ ████
█████ █████████████████ █ ███████████████████
██████████ █ █
████████████ ███████████████████ █████████████ ████████████████████
███████████████ ██████████████████████ ████████████████ ███████████████████████
█████████████ ████████████████████ ██████████████ █████████████████████
██████████████ █████████████████████ ███████████████ ██████████████████████
████████████ ███████████████████ █████████████ ████████████████████
████████████ ███████████████████ █████████████ ████████████████████
tag_input_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ █████████ ████████████ ██████████ ██████████████ ██████████
██████ ██████ █ █
█████ █ █████ ██████ ████████ ██ ██
████████ ███████
█████████ ███████
████████████ █ █████ ██████ ████████ ██ ██
████████████████ █ █████ ████████ ████████ █████ ██
Changelog
- Initial release with Enter/delimiter tag creation
- Autocomplete suggestions with keyboard navigation
- Email and URL validation modes
- Max tags limit with live counter
- Auto-colored tag chips option
- Hidden inputs for seamless Rails form submission
- 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