Keyboard Shortcuts

Toggle dark mode D
Quick navigation Ctrl+K
Collapse/expand section Click header
Show shortcuts ?
Close modal Esc

genX: front-end changes for humans

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.

Fully HATEOAS/DATAOS compliant.

⚑ Live Performance Metrics

Real-time Web Vitals demonstrating genX's high-performance optimization

Performance Score
-
Target: >90
FCP
-
Target: <1.8s
LCP
-
Target: <2.5s
TBT
-
Target: <200ms
CLS
-
Target: <0.1
Note: Metrics are captured during initial page load using the browser's Performance Observer API, then frozen after 5 seconds.

1. Polymorphic Notation - Four Ways, One Result

genX supports 4 notation styles that compile to identical transformations. Choose your preferred style.

Currency Formatting ($1,234.56)

1. Verbose (Beginner)

Explicit attributes

<span fx-format="currency"
      fx-currency="USD"
      fx-decimals="2">
  1234.56
</span>
2. Compact (Expert)

Colon syntax

<span fx-format="currency:USD:2">
  1234.56
</span>
3. JSON (Power User)

JSON configuration

<span fx-opts='{
  "format":"currency",
  "currency":"USD",
  "decimals":2
}'>1234.56</span>
4. CSS Class (Designer)

Class-based config

<span class="fmt-currency-USD-2">
  1234.56
</span>

Two-Way Binding with Debounce

1. Verbose (Beginner)

Explicit attributes

<input type="text"
       bx-model="username"
       bx-debounce="300">
2. Compact (Expert)

Colon syntax

<input type="text"
       bx-model="username:300">
3. JSON (Power User)

JSON configuration

<input type="text"
       bx-model="username"
       bx-opts='{"debounce":300}'>
4. CSS Class (Designer)

Class-based config

<input type="text"
       class="bind-username-300">

ARIA Label

1. Verbose (Beginner)

Explicit attributes

<button ax-enhance="button"
        ax-label="Home">
  🏠
</button>
2. Compact (Expert)

Colon syntax

<button ax-label="Home">
  🏠
</button>
3. JSON (Power User)

JSON configuration

<button ax-opts='{
  "label":"Home"
}'>🏠</button>
4. CSS Class (Designer)

Class-based config

<button class="acc-button-label-Home">
  🏠
</button>

Loading Spinner

1. Verbose (Beginner)

Explicit attributes

<div lx-loading="true"
     lx-strategy="spinner"
     lx-type="dots">
</div>
2. Compact (Expert)

Colon syntax

<div lx-loading="spinner:dots">
</div>
3. JSON (Power User)

JSON configuration

<div lx-opts='{
  "loading":true,
  "strategy":"spinner",
  "type":"dots"
}'></div>
4. CSS Class (Designer)

Class-based config

<div class="loadx-spinner-dots">
</div>

Route Navigation

1. Verbose (Beginner)

Explicit attributes

<a nx-route="/products"
   nx-transition="fade">
  Products
</a>
2. Compact (Expert)

Colon syntax

<a nx-route="/products:fade">
  Products
</a>
3. JSON (Power User)

JSON configuration

<a nx-opts='{
  "route":"/products",
  "transition":"fade"
}'>Products</a>
4. CSS Class (Designer)

Class-based config

<a class="navx-route-products-fade">
  Products
</a>

Draggable Item

1. Verbose (Beginner)

Explicit attributes

<div dx-draggable="true"
     dx-axis="x"
     dx-constrain="parent">
  Drag me
</div>
2. Compact (Expert)

Colon syntax

<div dx-draggable="x:parent">
  Drag me
</div>
3. JSON (Power User)

JSON configuration

<div dx-opts='{
  "draggable":true,
  "axis":"x",
  "constrain":"parent"
}'>Drag me</div>
4. CSS Class (Designer)

Class-based config

<div class="dragx-draggable-x-parent">
  Drag me
</div>

Live Interactive Demo - All Four Notations Working Together

Type in any of the inputs below to see how all four notation styles produce identical reactive behavior:

1. Verbose (Beginner)

Explicit attributes - most readable

Value: -
<input bx-model="polyDemo1"
       bx-debounce="500">
2. Compact (Expert)

Colon syntax - compact

Value: -
<input bx-model="polyDemo2:500">
3. JSON (Power User)

JSON configuration - flexible

Value: -
<input bx-model="polyDemo3"
       bx-opts='{"debounce":500}'>
πŸ’‘ All three notations produce identical behavior:
  • 500ms debounce delay after typing stops
  • Two-way reactive data binding
  • Automatic DOM synchronization
  • Same performance characteristics
Syntax Precedence (highest to lowest):
  1. bx-debounce attribute (explicit)
  2. bx-opts JSON configuration
  3. bx-model="field:500" colon syntax
πŸ’‘ All four notation styles produce identical behavior

Choose the style that best fits your workflow. genX supports all notations simultaneously in the same project.

fmtX - Number & Date Formatting

Declarative formatting for numbers, currency, dates, and more

0. SmartX - Auto-Detection & Normalization ✨

Automatically detects messy, real-world data and converts it into conventional formats

Input: 555%555%1212 (unconventional separators)
Detected: phone (85% confidence)
Output: (555) 555-1212
Input: USD 1,234.56 dollars (mixed format with text)
Detected: currency (90% confidence)
Output: $1,234.56
Input: 15-Mar-2024 (European date format)
Detected: date (95% confidence)
Output: Mar 15, 2024
Input: 99.5 percent (written out)
Detected: percentage (100% confidence)
Output: 99.5%
Input: +1.555.123.4567 (dots instead of dashes)
Detected: phone (95% confidence)
Output: (555) 123-4567
Input: € 1.234,56 (European number format)
Detected: currency (95% confidence)
Output: €1,234.56

genX Attributes:
<span fx-format="smart" fx-raw="$1,234.56">$1,234.56</span>
πŸ’‘ How it works:

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).

1. Currency Formatting with Input Types

Format numbers as currency from different input types



Input: 2499.99
Output:

genX Attributes:
<span fx-format="currency"
      fx-type="number"
      fx-currency="USD">

2. Percentage with Input Types

Display percentages from decimal (0-1) or percentage (0-100) values



Input: 0.2567
Output:

genX Attributes:
<span fx-format="percent"
      fx-type="decimal"
      fx-decimals="0">

3. Date Formatting with Input Types

Format dates from various input types (ISO, Unix, milliseconds)





Input: 2025-03-15
Output:

genX Attributes:
<time fx-format="date"
      fx-type="iso"
      fx-date-format="long">

4. Relative Time

Show time relative to now (input times are in UTC)



Input (UTC):
Output:

genX Attributes:
<time fx-format="relative"
      fx-type="iso">

5. File Size

Human-readable file sizes (automatic unit switching)



Input (bytes): 1536000
Output:

genX Attributes:
<span fx-format="filesize"
      fx-binary="false"
      fx-decimals="2">

6. Decimal Control

Control decimal precision



Input: 3.14159265
Output: 3.14159265

genX Attributes:
<span fx-format="number"
      fx-decimals="2">

7. Large Numbers

Format with thousands separators

1000000 1000000

genX Attributes:
<span fx-format="number">

8. Compact Numbers

1K, 1M, 1B notation



Input: 1500000
Output:

genX Attributes:
<span fx-format="compact">

9. Phone Numbers

Handles various input formats, outputs to US or international style



Input: 5551234567
Output:

genX Attributes:
<span fx-format="phone"
      fx-phone-format="us">

10. Time Formatting

Format time values with various styles and locales



Input:
Output:

genX Attributes:
<time fx-format="time"
      fx-time-format="short">

11. Duration Formatting

Human-readable durations (converts seconds to hours, minutes, seconds)



Input (seconds): 3661
Output:

genX Attributes:
<span fx-format="duration"
      fx-duration-format="short">

accX - Accessibility Enhancements

Automatic WCAG 2.1 AA compliance and accessibility features

Examples

Live Accessibility Audit

Real-time WCAG compliance verification powered by axe-core

-- /100
Rules Passed
--
Violations
--

Methodology:

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%.

1. Enhanced Buttons

Automatic ARIA attributes

Before: <button>Save</button>

genX Attributes:
<button ax-enhance="button" ax-label="Save your work">

2. Form Accessibility

Auto-linked labels and inputs

Before: Unlinked label and input

genX Attributes:
<label ax-enhance="label">
<input ax-enhance="input">

3. Skip Navigation

Keyboard-only skip links

Before: Regular anchor link Skip to main content

genX Attributes:
<a ax-enhance="skiplink">

4. ARIA Landmarks

Automatic landmark roles

Before: <div> with no role
Navigation content


genX Attributes:
<div ax-enhance="landmark" ax-landmark="navigation">

5. Live Updates

Screen reader announcements

Before: Static text, no announcements
Status: Ready


genX Attributes:
<div ax-enhance="live" ax-live="polite">

6. Focus Indicators

Enhanced focus visibility

Before: Browser default focus ring

genX Attributes:
<button ax-enhance="focus">

7. Form Errors

Accessible error announcements

Before: Error not linked to input
This field is required


genX Attributes:
<input ax-enhance="input" aria-invalid="true">
<div ax-enhance="error" role="alert">

8. Accessible Tooltips

Screen reader friendly tooltips

Before: No tooltip accessible to AT

genX Attributes:
<button ax-enhance="tooltip" ax-tooltip="...">

9. Modal Focus Trap

Accessible modal dialogs

Before: No focus trap, no ARIA dialog

genX Attributes:
<div ax-enhance="dialog">

10. Status Updates

Non-intrusive status messages

Before: Status not announced
5 items saved


genX Attributes:
<div ax-enhance="status" role="status">

bindX - Reactive Data Binding

Two-way data binding with automatic DOM updates

1. Two-Way Binding

Input automatically updates display

Initial: (empty)

Hello, World!


genX Attributes:
<input bx-model="name">
<span bx-bind="name">

2. Number Binding

Numeric input with live updates

Initial: 1

Quantity: 1


genX Attributes:
<input type="number" bx-model="quantity">
<span bx-bind="quantity">

3. Checkbox Binding

Boolean state binding

Initial: unchecked (false)

Status: false


genX Attributes:
<input type="checkbox" bx-model="agreed">
<span bx-bind="agreed">

4. Select Binding

Dropdown selection binding

Initial: Red

Selected: Red


genX Attributes:
<select bx-model="color">
<span bx-bind="color">

5. Radio Binding

Radio button group binding

Initial: (none selected)

Size: -


genX Attributes:
<input type="radio" bx-model="size" value="S">
<span bx-bind="size">

6. Computed Properties

Auto-calculated values

Initial: 10 Γ— 2 = 20

Total: $20


genX Attributes:
<input bx-model="price">
<input bx-model="qty">
<span bx-bind="total" bx-computed="price * qty">

7. Form Binding

Multiple field binding

Initial: (empty)

Full name: - -


genX Attributes:
<input bx-model="firstName">
<span bx-bind="firstName">

8. Textarea Binding

Multi-line text binding

Initial: 0 characters

Characters: 0


genX Attributes:
<textarea bx-model="bio">
<span bx-bind="bio.length">

9. Conditional Binding

Show/hide based on value

Initial: hidden

Additional details shown


genX Attributes:
<input bx-model="showDetails">
<div bx-if="showDetails">

10. Live Validation

Instant feedback

Initial: (empty)

Value:

βœ“ Valid email format

βœ— Invalid email format


genX Attributes:
<input bx-model="email" bx-validate="email">
<span bx-if="email && email.includes('@')">βœ“ Valid</span>

11. Form Validation & State Management

Complete form validation with real-time feedback, multiple validation rules, and form state tracking.

Form State:
Pristine: true
Dirty: false
Valid: false
Invalid: true
✨ Validation Features:
  • Real-time validation - Errors appear as you type
  • 14 built-in rules - required, email, min/max, minLength/maxLength, pattern, url, number, integer, alpha, alphanumeric, phone
  • Custom error messages - bx-error-* attributes
  • Form state tracking - pristine/dirty, valid/invalid
  • CSS classes - bx-error, bx-valid, bx-pristine, bx-dirty on fields and form
  • Multiple rules per field - Space-separated validation rules
Example Code:
<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>

dragX - Drag and Drop

Touch, mouse, and keyboard drag-and-drop with accessibility

1. Basic Drag & Drop

Simple draggable item

Ready
Drag me!
Drop here

genX Attributes:
<div dx-draggable="card" dx-data='{"id":1}'>
<div dx-drop-zone="cardzone" dx-accepts="card">

2. Reorder Items

Drag each item into the zone to build an ordered list

0 of 3 placed
🍎 Apple
🍊 Orange
πŸ‹ Lemon
↓ Drop items here in your preferred order

genX Attributes:
<div dx-draggable="item">
<div dx-drop-zone="itemzone" dx-accepts="item">

3. Type Filtering

Zone only accepts images β€” text snaps back

Try both β€” only πŸ“· accepted
πŸ“· Image
πŸ“ Text
πŸ“· Images only β€” text will be rejected

genX Attributes:
<div dx-draggable="image">
<div dx-draggable="text">  <!-- rejected by zone -->
<div dx-drop-zone="imagezone" dx-accepts="image">

4. Keyboard Dragging

Space + Arrow keys

Ready
Press Space, use arrows
Drop target

genX Attributes:
<div dx-draggable="kbd" tabindex="0">

5. Custom Ghost Image

Custom drag preview

Ready
Custom preview

genX Attributes:
<div dx-draggable="custom" dx-ghost="custom">

6. Axis Constraint

Horizontal-only drag

Ready
← Horizontal only β†’

genX Attributes:
<div dx-draggable="slider" dx-axis="horizontal">

7. Clone Mode

Leave original in place

Ready
Drag to copy
Drop copies here

genX Attributes:
<div dx-draggable="template" dx-clone="true">

8. Revert Animation

Return to start if invalid

Ready
Try dropping outside
Wrong type

genX Attributes:
<div dx-draggable="revert" dx-revert="invalid">

9. Grid Snapping

Snap to 50px grid

Ready
Snaps to grid

genX Attributes:
<div dx-draggable="grid" dx-snap="50">

10. Drag Events

Track drag lifecycle

Ready
Drag to track events

genX Attributes:
<div dx-draggable="tracked">

loadX - Loading States

Declarative loading indicators with zero layout shift

1. Spinner Loader

Circle spinner animation


genX Attributes:
<div lx-strategy="spinner"></div>

2. Skeleton Screen

Content placeholder with shimmer


genX Attributes:
<div lx-strategy="skeleton" lx-rows="3"></div>

3. Progress Bar

Determinate progress indicator


genX Attributes:
<div lx-strategy="progress" lx-value="50"></div>

4. Fade Transition

Smooth opacity fade effect

Loading content...

genX Attributes:
<div lx-strategy="fade">Content</div>

5. Dots Spinner

Alternative spinner style


genX Attributes:
<div lx-strategy="spinner" lx-spinner-type="dots"></div>

6. Custom Duration

Control animation timing

Fast (500ms)
genX Attributes:
<div lx-strategy="spinner" lx-duration="500"></div>

7. All Strategies

Side-by-side comparison

spinner
skeleton
progress
Content
fade

6. tableX - Table Enhancements

Declarative table sorting, pagination, and responsive layouts with tx-* attributes

1. Table-Level Sorting

Make all columns sortable with one declaration. Auto-detects data types. Three-state toggle: ascending β†’ descending β†’ clear.

Name Age Department Hire Date Salary
Alice Johnson32Engineering2022-03-1595000
Bob Smith28Marketing2023-01-1072000
Charlie Brown45Sales2020-07-2288000
Diana Prince29Engineering2023-05-0398000
Eve Martinez38HR2021-11-1876000
Frank Zhang51Engineering2019-02-14105000
Grace Lee26Design2023-08-0168000
Henry Wilson42Sales2020-12-0591000
<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>

2. Column-Level Sorting

Add sorting to specific columns one at a time with tx-sortable on individual headers.

Product Price Actions
Widget A29.99
Widget B19.99
Widget C39.99
<table>
  <thead>
    <tr>
      <th tx-sortable>Product</th>
      <th tx-sortable>Price</th>
      <th>Actions</th> <!-- Not sortable -->
    </tr>
  </thead>
</table>

3. Custom Sort Values

Use data-value attribute to provide sortable values different from display text.

Status Priority
🟒 ActiveLow
πŸ”΄ CriticalHigh
βšͺ InactiveMedium
<td data-value="2">🟒 Active</td>
<td data-value="1">πŸ”΄ Critical</td>
<td data-value="3">βšͺ Inactive</td>

8. uiX - UI Components

Declarative UI component library with ux-* attributes. Pure CSS where possible, with declarative triggers for interactivity.

Atoms

Buttons

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>

Badges

Status badges and labels with color variants

Default Primary Success Warning Danger Info Pill Badge
<span ux-enhance="badge" ux-variant="success">Success</span>
<span ux-enhance="badge" ux-variant="primary" ux-pill="true">Pill</span>

Avatars

User avatars with initials and customizable sizes/colors

SM
JD
LG
XL
SQ
PK
<div ux-enhance="avatar" ux-size="lg" ux-initials="JD">JD</div>
<div ux-enhance="avatar" ux-bg="#ec4899">PK</div>

Spinners (Pure CSS)

Loading indicators - pure CSS, no JavaScript required

<div ux-enhance="spinner"></div>
<div ux-enhance="spinner" ux-size="lg"></div>

Progress Bars

Progress indicators with customizable values

<div ux-enhance="progress" ux-value="75"></div>

Tooltips (Pure CSS)

Hover tooltips - pure CSS, no JavaScript required

Hover me Top tooltip
<span ux-enhance="tooltip" ux-content="Tooltip text">Hover me</span>

Molecules

Alerts

Notification alerts with variants and optional dismiss

Success! Your changes have been saved.
Warning! Please review your input.
Error! Something went wrong.
Info: This is an informational message.
Dismissible alert - click X to close
<div ux-enhance="alert" ux-variant="success">Success!</div>
<div ux-enhance="alert" ux-variant="danger" ux-dismissible="true">Error</div>

Cards

Content cards with header, body, and footer sections

Card Title
This is a basic card with header and body content.
Elevated card with enhanced shadow
Hoverable card - try hovering!
<div ux-enhance="card" ux-elevated="true">
  <div class="ux-card__header">Title</div>
  <div class="ux-card__body">Content</div>
</div>

Accordion

Collapsible content sections with single-open mode

This accordion uses single mode - only one section can be open at a time. Click another section to see it switch.
Features include keyboard navigation, ARIA support, and smooth transitions.
Just add 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>

Tabs

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

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 with Declarative Trigger

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>

Form Elements

Form Inputs

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>

Checkboxes & Switches

Styled checkboxes and toggle switches

<label ux-enhance="checkbox">
  <input type="checkbox"> Option
</label>

<label ux-enhance="switch">
  <input type="checkbox"> Toggle
</label>

Skeleton (Pure CSS)

Loading placeholder animations - pure CSS, no JavaScript

<div ux-enhance="skeleton" style="height: 20px;"></div>