Quick Start
Licence
All widgets are released under the Unlicense. Free to use in personal and commercial projects without attribution.
Use at your own risk. The author takes no responsibility for any damages or issues arising from the use of this software.
Download FormWidgets
Download the CSS and JavaScript files for offline use.
Include CSS & JS
Add the widget stylesheet and script to your HTML page.
<script src="<c:url value='/form-widgets/js/form-widgets.js'/>"></script>
Add HTML
Use class names on standard HTML elements for auto-initialization.
<input type="text" class="fw-currency" data-symbol="£">
<input type="text" class="fw-phone" data-pattern="+44 ## #### ####">
Initialize
Call autoInit() to activate all widgets, or init() for specific elements.
FormWidgets.autoInit();
// Or init a specific widget
FormWidgets.init('#myDate', 'DatePicker', {
displayFormat: 'DD/MM/YYYY'
});
Support this Project?
Want to support this project or simply say thanks.
Widgets
Key Features
Full Keyboard Navigation
Arrow keys, Enter, Escape, Tab — every widget is fully operable without a mouse.
ARIA Accessible
Complete ARIA attributes and screen reader support throughout.
CSS Custom Properties
Full dark mode support via CSS variables. Easily theme to match your design system.
International
Multiple date formats, currency symbols, and phone number patterns for global use.
No Dependencies
Zero runtime dependencies. Only Font Awesome for icons.
Mobile Friendly
Smart popup positioning and native fallbacks on mobile devices.
Data Attributes
Configure any widget via HTML data-* attributes — no JavaScript required.
Pattern Placeholders
Fields show their expected format (e.g. DD/MM/YYYY) as a placeholder when empty.
Browser Support
| Browser | Version | Support | Notes |
|---|---|---|---|
| Chrome | Latest | Full | Recommended browser for testing |
| Edge | Latest | Full | Chromium-based, full support |
| Firefox | Latest | Full | All features supported |
| Safari | Latest | Full | All features supported |
| Mobile Browsers | Modern | Full | Native select used on mobile for SelectField |