Twelve feature sections. Each has code examples (try instantly), an Init() config reference table, an Async explanation, and a live sandbox form. Open browser console for lifecycle logs.
Toast-style notifications. Auto-dismisses after 4 seconds. 7 themes, 9 positions, customizable width/font/progress bar.
Fnon.Hint.Theme(message, title). Auto-dismisses after 4s.
Pass object as 2nd arg: { position: 'left-top' }. 9
positions available.
Disable the X button or control auto-dismiss timeout.
Control hint dimensions and gap between stacked hints.
Progress bar shows remaining time. Use Init() to set global defaults.
| Option | Default | Type | Description |
|---|---|---|---|
| type | 'Primary' | ThemeName | Theme key (set automatically by shortcut) |
| title | — | string | HTMLElement | Dialog title |
| position | 'right-top' | string | right-top, right-center, right-bottom, left-top, left-center, left-bottom, center-top, center-center, center-bottom |
| timeOut | 4000 | number (ms) | Auto-dismiss after N ms (0 = no dismiss) |
| closable | true | boolean | Show/hide the X button |
| width | '360px' | string | Hint container max-width |
| fontSize | '0.88rem' | string | Hint text size |
| fontFamily | 'Quicksand', sans-serif | string | Font family |
| spacing | '8px' | string | Gap between stacked hints |
| animation | 'slide-left' | string | CSS animation class |
| animationDuration | '0.3s' | string | Enter/exit transition duration |
| progressColor | — | color | Progress bar color (defaults to theme borderColor) |
| svg | — | string | Custom icon SVG HTML |
| svgSize | {w:20,h:20} | object | Icon dimensions in px |
| appendTo | body | selector | Mount container element |
| onClose | — | () => void | Called when hint is dismissed |
| onclosed | — | () => void | Called after hint is fully removed |
Async:
Fnon.Hint.Theme.Async(message, title?) returns a
Promise<void> that resolves when the hint closes
(auto or manual). Useful for sequencing notifications.
Fill in the fields and click Run to see the hint live.
Full-page spinner overlay. 5 spinner types (Orbit, Spin / Infinity, Ripple, Typing). Supports clickToClose, text label, custom color, and Remove/Change controls.
Lightweight CSS-only spinners with
clickToClose: true for dismiss.
Lightweight SVG spinners: Infinity, Ripple, Typing.
Override svgColor and containerSize to
match your brand.
Remove(), Change(text), and Init() for global defaults.
Returns a Promise that resolves when Remove() is called or the spinner is dismissed.
| Option | Default | Type | Description |
|---|---|---|---|
| text | '' | string | Label text below the spinner |
| clickToClose | false | boolean | Click the overlay to dismiss |
| svgColor | '#029eff' | color | Spinner / accent color |
| fontFamily | 'Quicksand', sans-serif | string | Font family for text |
| containerSize | — | string | Spinner box width (e.g. '400px') |
| appendTarget | body | selector | Mount container |
| Spinner types: Orbit, Spin (CSS) • Infinity, Ripple, Typing (SVG) | |||
Async:
Fnon.Wait.Type.Async(text?, opts?) returns
Promise<boolean> (resolves true when
Remove() is called or the spinner is dismissed).
Select a spinner type, configure options, and launch.
Container-bound spinner overlay. Same 5 spinner types as Wait, but rendered inside a specific DOM element instead of full-screen.
First arg is a CSS selector. Spinner appears inside that element.
Override svgColor and svgSize for the
box spinner.
Box.Init sets global defaults.
Box.Async returns a Promise.
| Option | Default | Type | Description |
|---|---|---|---|
| selector | — | string | CSS selector for the target element |
| text | '' | string | Label below the spinner |
| svgColor | '#029eff' | color | Spinner accent color |
| svgSize | — | {w,h} | Spinner SVG dimensions in px |
| fontFamily | 'Quicksand', sans-serif | string | Font family for text |
| containerSize | — | string | Spinner box width |
| Same 5 spinner types as Wait: Orbit, Spin, Infinity, Ripple, Typing | |||
Async:
Fnon.Box.Type.Async(selector, text?, opts?) returns
Promise<boolean> (resolves true when
Box.Remove(selector) is called).
Enter a CSS selector and configure the spinner.
A one-button modal for simple messages. Supports both positional args and a single options object.
Three positional args: message, title, button text.
Access every option by passing a single object.
delButtons: true removes footer.
autoFocus: true highlights the button.
Custom colors, background, shadow, border for the OK button.
.Async returns a Promise. .Init sets
global defaults.
| Option | Default | Type | Description |
|---|---|---|---|
| message | — | string | HTMLElement | VNode | Body content |
| title | — | string | Dialog title |
| btnOkText | 'OK' | string | OK button label |
| width | — | 'sm' | 'lg' | 'xl' | 'fl' | Width mode (360/640/800/full px) |
| closeButton | true | boolean | Show/hide X button |
| showClose | — | boolean | Alias for closeButton |
| delButtons | false | boolean | Remove all footer buttons |
| autoFocus | false | boolean | Auto-focus first matching element |
| autoFocusTag | 'input:not([disabled])' | selector | Focus target selector |
| fontFamily | 'Quicksand', sans-serif | string | CSS font-family |
| animation | 'slide-top' | string | CSS animation class |
| color | '#2b2b2b' | color | Body text color |
| background | 'rgba(0,0,0,0.4)' | color | Overlay background |
| titleColor | — | color | Title text color |
| titleBackground | — | color | Title bar background |
| zIndex | 4000 | number | Overlay z-index |
| showIcon | false | boolean | Show an icon in the body |
| data | — | object | Shared mutable data for lifecycle callbacks |
| focusTrap | true | boolean | Lock Tab focus inside the modal |
| isDark | — | boolean | ()=>boolean | Enable dark mode for body & footer |
| darkBgColor | '#1a202c' | color | Dark mode background color |
| onOpen | — | (el,data)=>void | After modal opens |
| onClose | — | (data)=>void | When modal closes |
| onInit | — | (el,data)=>void | After element built, before DOM append |
| onClosed | — | (data)=>void | After modal fully removed |
Async:
Fnon.Alert.Theme.Async(message, title?, btnOkText?)
returns Promise<void> that resolves when OK is
clicked or the modal is closed.
Configure and launch an Alert modal.
A two-button confirm modal (OK / Cancel). The callback receives
true or false. Supports object args and
async.
message, title, OK text, Cancel text, callback(result).
Pass a single options object for full control.
Custom colors for both OK and Cancel buttons.
.Async resolves true or
false. .Init sets global defaults.
| Option | Default | Type | Description |
|---|---|---|---|
| message | — | string | HTMLElement | VNode | Body content |
| title | — | string | Dialog title |
| btnOkText | 'OK' | string | OK button label |
| btnCancelText | 'Cancel' | string | Cancel button label |
| width | — | 'sm' | 'lg' | 'xl' | 'fl' | Width mode |
| closeButton | true | boolean | Show/hide X button |
| showClose | — | boolean | Alias for closeButton |
| autoFocus | false | boolean | Auto-focus first matching element |
| fontFamily | 'Quicksand', sans-serif | string | CSS font-family |
| color | '#2b2b2b' | color | Body text color |
| btnOkColor | — | color | OK button text color |
| btnOkBackground | — | color | OK button background |
| btnOkShadow | — | string | OK button box-shadow |
| btnCancelColor | — | color | Cancel button text color |
| btnCancelBackground | — | color | Cancel button background |
| focusTrap | true | boolean | Lock Tab focus inside the modal |
| isDark | — | boolean | ()=>boolean | Enable dark mode for body & footer |
| darkBgColor | '#1a202c' | color | Dark mode background color |
Async:
Fnon.Ask.Theme.Async(message, title?, okText?, cancelText?)
returns Promise<boolean> — true on OK,
false on Cancel or close.
Configure and launch a confirmation modal.
The most flexible modal. Custom buttons, full lifecycle hooks, minimize/maximize, drag, and raw options control.
Define buttons with text, style, and callback. Callback receives
close().
Positional shortcut: msg, title, OK, Cancel, callback(close,
html). Return false to stay open.
showMin and showMaxMin add window
controls to the title bar. Minimized modals go to a task bar.
onInit → beforeShow → afterShow → onOpen → onClosing → onClose →
onClosed. All receive (el, data).
Override colors, font, width. All modals are draggable by the title bar.
| Option | Default | Type | Description |
|---|---|---|---|
| message | — | string | HTMLElement | VNode | Body content |
| title | — | string | Dialog title |
| buttons | — | ButtonDef[] | Custom button definitions |
| width | — | 'sm' | 'lg' | 'xl' | 'fl' | Width mode |
| layout | 'hbf' | string | Order of header/body/footer |
| closeButton | true | boolean | Show/hide X button |
| showClose | — | boolean | Alias for closeButton |
| showMin | false | boolean | Show minimize button |
| showMaxMin | false | boolean | Show maximize button |
| delButtons | false | boolean | Remove all footer buttons |
| autoFocus | false | boolean | Auto-focus first input |
| fontFamily | 'Quicksand', sans-serif | string | CSS font-family |
| animation | 'slide-top' | string | CSS animation class |
| data | — | object | Shared mutable data for all lifecycle hooks |
| color | '#2b2b2b' | color | Body text color |
| background | 'rgba(0,0,0,0.4)' | color | Overlay background |
| titleColor | — | color | Title text color |
| titleBackground | — | color | Title bar background |
| zIndex | 4000 | number | Overlay z-index |
| appendTarget | 'body' | string | HTMLElement | Mount container |
| focusTrap | true | boolean | Lock Tab focus inside the modal |
| isDark | — | boolean | ()=>boolean | Enable dark mode for body & footer |
| darkBgColor | '#1a202c' | color | Dark mode background color |
| onInit | — | (el,data)=>void | After element built |
| beforeShow | — | (el,data)=>void | Before DOM append |
| afterShow | — | (el,data)=>void | After DOM append |
| onOpen | — | (el,data)=>void | After modal opens |
| onClosing | — | (el,data)=>void | When modal starts closing |
| onClose | — | (data)=>void | During close animation |
| onClosed | — | (data)=>void | After modal fully removed |
Async:
Fnon.Dialogue.Theme.Async(message, title?, okText?,
cancelText?)
returns Promise<boolean | null> —
true on OK, false on Cancel,
null on close/X.
Configure a modal with the most common options.
Full-width notification bar anchored to top or bottom. Auto-dismisses after 5 seconds. Supports custom buttons and headlines.
One arg: Fnon.Breaking.Theme(headline).
Auto-dismisses after 5s.
headline, message, theme, anchor, buttons, timeout, closable, onClose.
.Async resolves when bar closes.
.Init changes global defaults.
| Option | Default | Type | Description |
|---|---|---|---|
| headline | 'BREAKING' | string | Bold label text |
| message | — | string | HTMLElement | Body content |
| theme | 'Danger' | ThemeName | Color scheme |
| anchor | 'top' | 'top' | 'bottom' | Where the bar attaches |
| timeout | 5000 | number (ms) | Auto-dismiss after N ms |
| closable | true | boolean | Show/hide the X button |
| buttons | — | ButtonDef[] | Action buttons in the bar |
| fontFamily | 'Quicksand', sans-serif | string | Font family |
| appendTarget | 'body' | string | HTMLElement | Mount container |
| onClose | — | () => void | Called when bar closes |
Async:
Fnon.Breaking.Theme.Async(message?, headline?) returns
Promise<void> that resolves when the bar is closed
(auto-dismiss or manual).
Configure a breaking notification bar.
A modal date picker with month/year selector, range mode, optional time picker, and min/max constraints. Returns a Promise.
Click a date → resolves immediately. Toggle dark mode first to test dark theme support.
Click start date, then end date. Promise resolves with
{ start, end }.
Only dates within a range are selectable (minDate /
maxDate).
{
initDate: Date // Initial month to show (default: today)
dateRange: boolean // Enable range mode (default: false)
withTime: boolean // Show time picker after date selection (default: false)
minDate: Date // Earliest selectable date
maxDate: Date // Latest selectable date
title: string // Modal title
isDark: boolean|()=>boolean // Enable dark mode for this instance
}
Async: Always async — returns
Promise<Date | { start: Date; end: Date }>. Rejects
when the modal is closed without selecting. Also available as
Fnon.DP(opts).
Configure and run a DatePicker instance.
Register a custom theme that applies to all modal types and hints.
Registers a purple-themed palette.
Register a custom SVG spinner by name. Creates both Wait.name()
and Box.name() variants.
Registers a spinning star SVG.
Set overlay: false on a Dialogue to hide the dark backdrop
and let users interact with the page behind the modal.
Clicking the modal body brings it to the front.