Currency Input
Formatted currency input with symbol addon, automatic thousand separators, and decimal formatting. Supports left/right symbol positioning, customizable separators for international formats, min/max constraints, and a hidden field that stores the raw numeric value for form submission.
Preview & Code
_currency_input.html.erb
███
████████ █████ █████████ █████████
█████ ████████
███ ██████ ████████████████████████████ █████ ████████ ██
█████ █████ █████ ███ ███████
███ ██████ ████████████████████████████ █████ ████████ ██████ ████████ ██████ ███████ ██
█████ █████ ████████
currency_input_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ████████████████ ██████████████
██████ ██████ █ █
██████████████ █ █████ ███████ ████████ █ ██
██████████████████ █ █████ ███████ ████████ ███ ██
█████████████████ █ █████ ███████ ████████ ███ ██
████ █ █████ ███████ ████████ █████████ ██
████ █ █████ ███████ ████████ ████████ █
currency_input_component.rb
█ ██████████████████████ ████
█████ ██████████████████████ █ ███████████████████
█████ █ █████ ██ ██████████
████████████████ █ ███████ █████████████
███████████ ██████ ███████ ██████████ ████████ █████████████████ ████████████████
████████████████████ ███████████████████ █████ █████ ███████ ██████
███████ ██████████ ██████████ ████████████
currency_input_component.html.erb
████ ██████████ █████████████████ ███ ███ ████████████████████████████████████████ ███
██ ██ ███████████████ ██
██████ ████████ ████████████████ ███ ██████████ █████████████ ████
███ ██████ ██
██ ██ █████████ ██
█████ ███████████████████ ████████████████
██ ███ ██
████████
██ ███ ██
currency_input_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ████████████████ ██████████████
██████ ██████ █ █
██████████████ █ █████ ███████ ████████ █ ██
██████████████████ █ █████ ███████ ████████ ███ ██
█████████████████ █ █████ ███████ ████████ ███ ██
████ █ █████ ███████ ████████ █████████ ██
████ █ █████ ███████ ████████ ████████ █
Changelog
- v1.0.0: Initial release with currency formatting, symbol addon, and hidden value field
- Left/right symbol positioning with proper border radius
- Configurable thousand and decimal separators for international formats
- Min/max constraints enforced on blur
- Keystroke filtering to allow only valid numeric input
- Full 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