Business wants percentages shown with 2 decimals instead of 3? With traditional approaches, you're modifying database schemas, backend APIs, and frontend code - all fragile, all breaking things. Over and over again.
genx.software keeps display logic where it belongs: in the display layer. Your database stores raw numbers. Your backend passes them through. Your HTML template handles formatting (or any other purely front-end concern) with attributes like data-fmtx="decimal:2", data-accx="aria-label:{{statusText}} skip-if-empty", data-bindx="value:user.email validate:email".
One attribute change in your HTML template; the most robust part of your stack. No migrations, no backend deploys, no breakage. Just a few k of JavaScript reading your declarative intent and executing it at lightning speed.
Real-time Web Vitals demonstrating genX's high-performance optimization
genX serves raw values and formats them on the client, so for a frame or two the raw value can flash before it is rewritten (871580000000 → $871.58B). The opt-in cloak hides fx-format elements until genX formats them, and fails open: if genX never finishes, elements reveal their raw value rather than staying blank.
window.genxConfig = {
cloak: true, // default false
cloakTimeoutMs: 1500 // fail-open reveal if genX never finishes
};
Every formatted value above appeared already styled instead of flashing raw; that is the cloak at work.
Replay a page load with the cloak on or off. With it off, the raw values flash red before formatting (FOUC). With it on, the space is reserved and only the finished value ever appears.
genX supports 4 notation styles that compile to identical transformations. Choose your preferred style.
Explicit attributes
<span fx-format="currency"
fx-currency="USD"
fx-decimals="2">
1234.56
</span>
Colon syntax
<span fx-format="currency:USD:2"> 1234.56 </span>
JSON configuration
<span fx-opts='{
"format":"currency",
"currency":"USD",
"decimals":2
}'>1234.56</span>
Class-based config
<span class="fmt-currency-USD-2"> 1234.56 </span>
Explicit attributes
<input type="text"
bx-model="username"
bx-debounce="300">
Colon syntax
<input type="text"
bx-model="username:300">
JSON configuration
<input type="text"
bx-model="username"
bx-opts='{"debounce":300}'>
Class-based config
<input type="text"
class="bind-username-300">
Explicit attributes
<button ax-enhance="button"
ax-label="Home">
๐
</button>
Colon syntax
<button ax-label="Home"> ๐ </button>
JSON configuration
<button ax-opts='{
"label":"Home"
}'>๐ </button>
Class-based config
<button class="acc-button-label-Home"> ๐ </button>
Explicit attributes
<div lx-loading="true"
lx-strategy="spinner"
lx-type="dots">
</div>
Colon syntax
<div lx-loading="spinner:dots"> </div>
JSON configuration
<div lx-opts='{
"loading":true,
"strategy":"spinner",
"type":"dots"
}'></div>
Class-based config
<div class="loadx-spinner-dots"> </div>
Explicit attributes
<div dx-draggable="true"
dx-axis="x"
dx-constrain="parent">
Drag me
</div>
Colon syntax
<div dx-draggable="x:parent"> Drag me </div>
JSON configuration
<div dx-opts='{
"draggable":true,
"axis":"x",
"constrain":"parent"
}'>Drag me</div>
Class-based config
<div class="dragx-draggable-x-parent"> Drag me </div>
Type in any of the inputs below to see how all four notation styles produce identical reactive behavior:
Explicit attributes - most readable
<input bx-model="polyDemo1"
bx-debounce="500">
Colon syntax - compact
<input bx-model="polyDemo2:500">
JSON configuration - flexible
<input bx-model="polyDemo3"
bx-opts='{"debounce":500}'>
bx-debounce attribute (explicit)bx-opts JSON configurationbx-model="field:500" colon syntaxChoose the style that best fits your workflow. genX supports all notations simultaneously in the same project.
Declarative formatting for numbers, currency, dates, and more
Automatically detects messy, real-world data and converts it into conventional formats
555%555%1212 (unconventional separators)USD 1,234.56 dollars (mixed format with text)15-Mar-2024 (European date format)99.5 percent (written out)+1.555.123.4567 (dots instead of dashes)โฌ 1.234,56 (European number format)<span fx-format="smart" fx-raw="$1,234.56">$1,234.56</span>
SmartX uses pattern matching with confidence scoring to detect data types. It automatically delegates to the appropriate formatter (currency, phone, date, etc.) with ~0.5-1ms execution time (~0.01ms with caching).
Format numbers as currency from different input types
<span fx-format="currency" fx-type="number" fx-currency="USD">
Display percentages from decimal (0-1) or percentage (0-100) values
<span fx-format="percent"
fx-type="decimal"
fx-decimals="0">
Format dates from various input types (ISO, Unix, milliseconds)
<time fx-format="date"
fx-type="iso"
fx-date-format="long">
Show time relative to now (input times are in UTC)
<time fx-format="relative"
fx-type="iso">
Human-readable file sizes (automatic unit switching)
<span fx-format="filesize"
fx-binary="false"
fx-decimals="2">
Control decimal precision
<span fx-format="number"
fx-decimals="2">
Format with thousands separators
<span fx-format="number">
1K, 1M, 1B notation
<span fx-format="compact">
Handles various input formats, outputs to US or international style
<span fx-format="phone"
fx-phone-format="us">
Format time values with various styles and locales
<time fx-format="time"
fx-time-format="short">
Human-readable durations (converts seconds to hours, minutes, seconds)
<span fx-format="duration"
fx-duration-format="short">
Automatic WCAG 2.1 AA compliance and accessibility features
Real-time WCAG compliance verification powered by axe-core
Audited using axe-core, the industry-standard accessibility engine used by Microsoft, Google, and the US government. This page dogfoods accX; all accessibility compliance is achieved using accX attributes, not raw ARIA.
Note: The sole color-contrast violation reported above is axe-core's own attribution link, not a genX component. All genX accX-enhanced elements pass WCAG 2.1 AA at 100%.
Automatic ARIA attributes
<button ax-enhance="button" ax-label="Save your work">
Auto-linked labels and inputs
<label ax-enhance="label"> <input ax-enhance="input">
Keyboard-only skip links
Automatic landmark roles
<div ax-enhance="landmark" ax-landmark="navigation">
Screen reader announcements
<div ax-enhance="live" ax-live="polite">
Enhanced focus visibility
<button ax-enhance="focus">
Accessible error announcements
<input ax-enhance="input" aria-invalid="true"> <div ax-enhance="error" role="alert">
Screen reader friendly tooltips
<button ax-enhance="tooltip" ax-tooltip="...">
Accessible modal dialogs
<div ax-enhance="dialog">
Non-intrusive status messages
<div ax-enhance="status" role="status">
Two-way data binding with automatic DOM updates
Input automatically updates display
Hello, World!
<input bx-model="name"> <span bx-bind="name">
Numeric input with live updates
Quantity: 1
<input type="number" bx-model="quantity"> <span bx-bind="quantity">
Boolean state binding
Status: false
<input type="checkbox" bx-model="agreed"> <span bx-bind="agreed">
Dropdown selection binding
Selected: Red
<select bx-model="color"> <span bx-bind="color">
Radio button group binding
Size: -
<input type="radio" bx-model="size" value="S"> <span bx-bind="size">
Auto-calculated values
Total: $20
<input bx-model="price"> <input bx-model="qty"> <span bx-bind="total" bx-computed="price * qty">
Multiple field binding
Full name: - -
<input bx-model="firstName"> <span bx-bind="firstName">
Multi-line text binding
Characters: 0
<textarea bx-model="bio"> <span bx-bind="bio.length">
Show/hide based on value
Additional details shown
<input bx-model="showDetails"> <div bx-if="showDetails">
Instant feedback
Value:
โ Valid email format
โ Invalid email format
<input bx-model="email" bx-validate="email">
<span bx-if="email && email.includes('@')">โ Valid</span>
Complete form validation with real-time feedback, multiple validation rules, and form state tracking.
<form bx-form>
<input bx-model="email"
bx-validate="required email"
bx-error-required="Email is required"
bx-error-email="Invalid email">
<input bx-model="username"
bx-validate="required minLength:3 alphanumeric">
<button type="submit">Submit</button>
</form>
Touch, mouse, and keyboard drag-and-drop with accessibility
Simple draggable item
<div dx-draggable="card" dx-data='{"id":1}'>
<div dx-drop-zone="cardzone" dx-accepts="card">
Drag each item into the zone to build an ordered list
<div dx-draggable="item"> <div dx-drop-zone="itemzone" dx-accepts="item">
Zone only accepts images; text snaps back
<div dx-draggable="image"> <div dx-draggable="text"> <!-- rejected by zone --> <div dx-drop-zone="imagezone" dx-accepts="image">
Space + Arrow keys
<div dx-draggable="kbd" tabindex="0">
Custom drag preview
<div dx-draggable="custom" dx-ghost="custom">
Horizontal-only drag
<div dx-draggable="slider" dx-axis="horizontal">
Leave original in place
<div dx-draggable="template" dx-clone="true">
Return to start if invalid
<div dx-draggable="revert" dx-revert="invalid">
Snap to 50px grid
<div dx-draggable="grid" dx-snap="50">
Track drag lifecycle
<div dx-draggable="tracked">
Declarative loading indicators with zero layout shift
Circle spinner animation
<div lx-strategy="spinner"></div>
Content placeholder with shimmer
<div lx-strategy="skeleton" lx-rows="3"></div>
Determinate progress indicator
<div lx-strategy="progress" lx-value="50"></div>
Smooth opacity fade effect
<div lx-strategy="fade">Content</div>
Alternative spinner style
<div lx-strategy="spinner" lx-spinner-type="dots"></div>
Control animation timing
<div lx-strategy="spinner" lx-duration="500"></div>
Side-by-side comparison
Declarative table sorting, pagination, and responsive layouts with tx-* attributes
Make all columns sortable with one declaration. Auto-detects data types. Three-state toggle: ascending โ descending โ clear.
| Name | Age | Department | Hire Date | Salary |
|---|---|---|---|---|
| Alice Johnson | 32 | Engineering | 2022-03-15 | 95000 |
| Bob Smith | 28 | Marketing | 2023-01-10 | 72000 |
| Charlie Brown | 45 | Sales | 2020-07-22 | 88000 |
| Diana Prince | 29 | Engineering | 2023-05-03 | 98000 |
| Eve Martinez | 38 | HR | 2021-11-18 | 76000 |
| Frank Zhang | 51 | Engineering | 2019-02-14 | 105000 |
| Grace Lee | 26 | Design | 2023-08-01 | 68000 |
| Henry Wilson | 42 | Sales | 2020-12-05 | 91000 |
<table tx-sortable>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Department</th>
<th>Hire Date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<!-- Table rows -->
</tbody>
</table>
Add sorting to specific columns one at a time with tx-sortable on individual headers.
| Product | Price | Actions |
|---|---|---|
| Widget A | 29.99 | |
| Widget B | 19.99 | |
| Widget C | 39.99 |
<table>
<thead>
<tr>
<th tx-sortable>Product</th>
<th tx-sortable>Price</th>
<th>Actions</th> <!-- Not sortable -->
</tr>
</thead>
</table>
Use data-value attribute to provide sortable values different from display text.
| Status | Priority |
|---|---|
| ๐ข Active | Low |
| ๐ด Critical | High |
| โช Inactive | Medium |
<td data-value="2">๐ข Active</td> <td data-value="1">๐ด Critical</td> <td data-value="3">โช Inactive</td>
Declarative UI component library with ux-* attributes. Pure CSS where possible, with declarative triggers for interactivity.
Styled buttons with variants and sizes using ux-variant and ux-size
<button ux-enhance="button" ux-variant="primary">Primary</button> <button ux-enhance="button" ux-variant="primary" ux-size="lg">Large</button> <button ux-enhance="button" ux-bg="#ec4899">Custom Color</button>
Status badges and labels with color variants
<span ux-enhance="badge" ux-variant="success">Success</span> <span ux-enhance="badge" ux-variant="primary" ux-pill="true">Pill</span>
User avatars with initials and customizable sizes/colors
<div ux-enhance="avatar" ux-size="lg" ux-initials="JD">JD</div> <div ux-enhance="avatar" ux-bg="#ec4899">PK</div>
Loading indicators - pure CSS, no JavaScript required
<div ux-enhance="spinner"></div> <div ux-enhance="spinner" ux-size="lg"></div>
Progress indicators with customizable values
<div ux-enhance="progress" ux-value="75"></div>
Hover tooltips - pure CSS, no JavaScript required
<span ux-enhance="tooltip" ux-content="Tooltip text">Hover me</span>
Notification alerts with variants and optional dismiss
<div ux-enhance="alert" ux-variant="success">Success!</div> <div ux-enhance="alert" ux-variant="danger" ux-dismissible="true">Error</div>
Content cards with header, body, and footer sections
<div ux-enhance="card" ux-elevated="true"> <div class="ux-card__header">Title</div> <div class="ux-card__body">Content</div> </div>
Collapsible content sections with single-open mode
ux-enhance="accordion" and structure your content with the appropriate classes.
<div ux-enhance="accordion" ux-single="true">
<div class="ux-accordion__item" data-accordion-item>
<button class="ux-accordion__header" data-accordion-header>...</button>
<div class="ux-accordion__content" data-accordion-content>...</div>
</div>
</div>
Tab navigation with keyboard support and ARIA
This is the Overview tab content. Tabs support arrow key navigation.
Features include: pure declarative setup, ARIA labels, keyboard navigation, and smooth transitions.
Free and open source! MIT License.
<div ux-enhance="tabs">
<div class="ux-tabs__list" role="tablist">
<button class="ux-tabs__tab">Tab 1</button>
</div>
<div class="ux-tabs__panel">Content 1</div>
</div>
Dropdown menus with keyboard navigation
<div ux-enhance="dropdown">
<button data-dropdown-trigger>Options โผ</button>
<div class="ux-dropdown__menu" data-dropdown-menu>
<button class="ux-dropdown__item">Edit</button>
</div>
</div>
Modal dialog using ux-opens declarative trigger - no custom JavaScript required!
<!-- Declarative HTML trigger - no custom JavaScript required -->
<button ux-opens="#my-modal">Open Modal</button>
<!-- Modal -->
<div ux-enhance="modal" id="my-modal">
<div class="ux-modal__content">
<button ux-closes>×</button>
<p>Modal content</p>
</div>
</div>
Styled form inputs with validation states
<input ux-enhance="input" type="text" placeholder="Enter text"> <input ux-enhance="input" ux-error="true" placeholder="Error"> <textarea ux-enhance="textarea"></textarea>
Styled checkboxes and toggle switches
<label ux-enhance="checkbox"> <input type="checkbox"> Option </label> <label ux-enhance="switch"> <input type="checkbox"> Toggle </label>
Loading placeholder animations - pure CSS, no JavaScript
<div ux-enhance="skeleton" style="height: 20px;"></div>