VibeFox JS UI — Help
Overview
VibeFox JS UI is a library of more than 60 user interface components for web applications: buttons, form fields, pickers, lists, navigation, dialogs and windows, notifications, layout containers, and large ready-made components such as a Kanban board, a chat with an AI prompt, a file manager, a spreadsheet, an image editor, a query builder, a signature pad and QR / barcode generators. It is plain JavaScript with no dependencies and works with or without a framework.
Every component is created with one call, create<Name>(target, options) (for example createSelect, createDialog, createKanban), and controlled through the same methods as every VibeFox JS library: setOptions, on, getState, setState, setTheme, destroy; value components add getValue / setValue.
Key features
- Form controls: input with masks, number input, select with search and tags, autocomplete with async sources, checkbox, switch, radio group, segmented control, slider, rating, one-time code input; date, time, date-time and color pickers; file upload with chunks and retries; list box, transfer list, tree.
- Native forms: the controls submit their values with a
<form>, take part in its validation and reset; a form builder with rules. - Navigation: tabs, accordion, menus and context menus, toolbar, breadcrumb, pagination, stepper and wizard, command palette.
- Overlays: dialogs and movable, resizable windows, drawer, toasts, tooltips, popovers, onboarding tour.
- Layout: splitter, dock layout with panels you move between zones, tile dashboard layout with drag, resize and breakpoints.
- Data display: cards, avatars, chips, badges, progress bar, spinner, skeleton, carousel.
- Large components: Kanban board, chat and AI prompt (streaming answers from your model), file manager over your backend, spreadsheet with formulas and Excel files, image editor, query builder (SQL, text, filter functions), signature pad, QR, Data Matrix and linear barcodes.
- Three looks (filled, outline, ghost) and three sizes for every component, every color and size as a CSS variable, themes, right-to-left layout, WCAG 2.2 AA keyboard access, names and announcements, and a menu alternative to every drag and drop.
Requirements
- A current web browser.
- No runtime dependencies. The components make no network requests of their own: uploads, file manager operations, autocomplete sources and AI answers go to the URLs or functions you give.
- Node.js is not needed in the browser. The ES module can be imported in Node (no DOM is touched at import):
encodeBarcodeandapplyMaskrun on a server.
Installation
Files of the library
VibeFox JS UI is a separate product with its own files. The whole JavaScript of the library is one file and the styles are one CSS file: a page needs exactly these two. The other files are optional.
| File | What it is |
|---|---|
vibefox-js-ui.global.js | The library for a classic <script> tag; defines one global variable, VibeFoxJSUi. Minified: vibefox-js-ui.global.min.js. |
vibefox-js-ui.esm.js | The same code as an ES module. Minified: vibefox-js-ui.esm.min.js. |
vibefox-js-ui.css | All styles of the library, inside @layer vfjs; includes the themes light, dark and high-contrast. Minified: vibefox-js-ui.min.css. |
vibefox-js-themes.css | Optional theme pack: 18 ready-made themes (see Theming and styling). Minified: vibefox-js-themes.min.css. |
locales/vibefox-js-ui.<lang>.js | Optional language files, one for each language except English (see Localization and RTL). The same language as an ES module: .esm.js; as plain strings: .json. |
vibefox-js-ui.d.ts | TypeScript declarations (also vibefox-js-ui.esm.d.ts). |
*.js.map | Source maps. |
vibefox-js-ui-react.js, vibefox-js-ui-vue.js, vibefox-js-ui-svelte.js, vibefox-js-ui-jquery.js | Optional framework wrappers (each with its .d.ts). |
vibefox-js-ui-angular | Optional Angular package (Angular Package Format). |
vibefox-js-ui-wc.js | Optional Web Components wrapper (custom elements). |
Script tag
Link the CSS file and the script. The global variable VibeFoxJSUi holds every export of the library. This also works from a file opened from disk (file://).
<link rel="stylesheet" href="vibefox-js-ui.css">
<script src="vibefox-js-ui.global.js"></script>
<script>
const select = VibeFoxJSUi.createSelect('#app', { options: items });
</script>
ES module
Import the ES module file and link the CSS file. Browsers load modules only over http(s), not from file://.
<link rel="stylesheet" href="vibefox-js-ui.css">
<script type="module">
import { createSelect } from './vibefox-js-ui.esm.js';
const select = createSelect('#app', { options: items });
</script>
npm
The library is also prepared as an npm package named @vibefox/js-ui. Install it from the package folder (or its packed .tgz file) that you received, then import it by name. Bundlers take the CSS through the @vibefox/js-ui/css export.
npm install ./vibefox-js-ui
import { createSelect } from '@vibefox/js-ui';
import '@vibefox/js-ui/css';
Exports of the package: @vibefox/js-ui (ES module), @vibefox/js-ui/min, @vibefox/js-ui/global, @vibefox/js-ui/global.min, @vibefox/js-ui/css, @vibefox/js-ui/min.css, @vibefox/js-ui/themes, @vibefox/js-ui/themes.min.css, @vibefox/js-ui/locales/<lang>, @vibefox/js-ui/locales/<lang>.json. TypeScript finds the declarations by itself.
Framework wrappers
The wrappers are small separate files; the library works without them. Each wrapper needs only VibeFox JS UI and its framework (a peer dependency). The wrappers do not load CSS: link vibefox-js-ui.css yourself.
| Framework | File | npm package | Supported versions |
|---|---|---|---|
| React | vibefox-js-ui-react.js | @vibefox/js-ui-react | React 16.8 and newer |
| Vue 3 | vibefox-js-ui-vue.js | @vibefox/js-ui-vue | Vue 3.3 and newer |
| Angular | vibefox-js-ui-angular | @vibefox/js-ui-angular | Angular 17 and newer |
| Svelte | vibefox-js-ui-svelte.js | @vibefox/js-ui-svelte | Svelte 3, 4 and 5 |
| jQuery | vibefox-js-ui-jquery.js | @vibefox/js-ui-jquery | jQuery 1.12 to 4.x |
| Web Components | vibefox-js-ui-wc.js | @vibefox/js-ui-wc | no framework |
The ES module wrappers import the library as @vibefox/js-ui. Without npm, map that name to vibefox-js-ui.esm.js in your bundler settings or in an import map. The jQuery wrapper takes the library from the global VibeFoxJSUi.
Common rules of all wrappers: props / inputs are the options of the library (changed ones go to setData or one setOptions call); events are framework events with the same payload object as on(); the instance is available for every method; on the server (SSR) an empty container is rendered and the instance is created in the browser only. The look options of VibeFox JS UI are called variant and size in the wrappers too. Components with content (Dialog, Drawer, Popover, Tooltip, Tabs, Accordion, Splitter, DockLayout, TileLayout, Toolbar, Card, Carousel, Stepper, Wizard) take framework children as slots: the default slot is the content, named slots fill the content of tabs, panels, steps or tiles by their id.
Web Components
Load vibefox-js-ui-wc.js after the library file. It defines one element per component from the global VibeFoxJSUi: <vfjs-button>, <vfjs-select>, <vfjs-date-picker>, <vfjs-dialog>, <vfjs-kanban> and so on (the component name in kebab-case). Attributes are options in kebab-case (JSON for objects and arrays), properties are options, the methods of the component are methods of the element, events are CustomEvents named after the component, such as vfjsselect:<event> or vfjsdatepicker:<event>, with the payload in detail. The element uses the light DOM, so the CSS of the library and your page CSS apply as usual.
<link rel="stylesheet" href="vibefox-js-ui.css">
<script src="vibefox-js-ui.global.js"></script>
<script type="module" src="vibefox-js-ui-wc.js"></script>
<vfjs-select id="g" placeholder="Country" name="country"></vfjs-select>
<script>
const el = document.getElementById('g');
el.options = [{ value: 'de', label: 'Germany' }, { value: 'fr', label: 'France' }];
el.addEventListener('vfjsselect:valueChange', (e) => console.log(e.detail.value));
</script>
With a bundler: import * as lib from '@vibefox/js-ui'; import { define } from '@vibefox/js-ui-wc'; define(lib);
Wrapper names follow the component: React VibeFoxJSSelectReact, VibeFoxJSDialogReact …; Vue VibeFoxJSSelectVue …; Angular VibeFoxJSSelectComponent with the selector vfjs-select-ng (NgModule: VibeFoxJSUiModule); Svelte actions vfjsSelect …; jQuery $(el).vfjsSelect(…); Web Components <vfjs-select>.
Quick start
Plain HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="vibefox-js-ui.css">
<script src="vibefox-js-ui.global.js"></script>
</head>
<body>
<form id="order">
<label for="country">Country</label> <div id="country"></div>
<label for="date">Delivery date</label> <div id="date"></div>
<div id="send"></div>
</form>
<div id="toasts"></div>
<script>
const { createSelect, createDatePicker, createButton, createToast } = VibeFoxJSUi;
createSelect('#country', { options: [{ value: 'de', label: 'Germany' }, { value: 'fr', label: 'France' }], searchable: true });
createDatePicker('#date', { min: new Date() });
const toast = createToast('#toasts', { position: 'bottom-right' });
createButton('#send', { label: 'Order', on: { click: () => toast.success('Order sent') } });
</script>
</body>
</html>
A <label for="…"> that points at the mount element names the control for screen readers; the option label does the same without a visible label.
React
import { useState } from 'react';
import { VibeFoxJSSelectReact, VibeFoxJSDialogReact, VibeFoxJSButtonReact } from '@vibefox/js-ui-react';
import '@vibefox/js-ui/css';
export function Settings() {
const [lang, setLang] = useState('en');
const [open, setOpen] = useState(false);
return (
<>
<VibeFoxJSSelectReact label="Language" value={lang} options={[{ value: 'en', label: 'English' }, { value: 'de', label: 'Deutsch' }]}
onValueChange={(e) => setLang(e.value)} />
<VibeFoxJSButtonReact label="About" onClick={() => setOpen(true)} />
{open && <VibeFoxJSDialogReact title="About" onClose={() => setOpen(false)}><p>Version 1.0</p></VibeFoxJSDialogReact>}
</>
);
}
Vue 3
<script setup>
import { ref } from 'vue';
import { VibeFoxJSSelectVue, VibeFoxJSSliderVue } from '@vibefox/js-ui-vue';
import '@vibefox/js-ui/css';
const lang = ref('en');
const volume = ref(40);
</script>
<template>
<VibeFoxJSSelectVue v-model="lang" label="Language" :options="[{ value: 'en', label: 'English' }, { value: 'de', label: 'Deutsch' }]" />
<VibeFoxJSSliderVue v-model="volume" label="Volume" :min="0" :max="100" />
</template>
v-model is the value of value components (value; checked for check boxes and switches).
Angular
import { Component } from '@angular/core';
import { VibeFoxJSSelectComponent, VibeFoxJSTabsComponent } from '@vibefox/js-ui-angular';
@Component({
selector: 'app-root',
standalone: true,
imports: [VibeFoxJSSelectComponent, VibeFoxJSTabsComponent],
template: `
<vfjs-select-ng label="Language" [options]="langs" [value]="lang" (valueChange)="lang = $event.value"></vfjs-select-ng>
<vfjs-tabs-ng [tabs]="[{ id: 'a', label: 'General' }, { id: 'b', label: 'Advanced' }]">
<ng-template vfjsUiSlot="a">General settings</ng-template>
<ng-template vfjsUiSlot="b">Advanced settings</ng-template>
</vfjs-tabs-ng>`,
})
export class AppComponent {
langs = [{ value: 'en', label: 'English' }, { value: 'de', label: 'Deutsch' }];
lang = 'en';
}
Link vibefox-js-ui.css in angular.json (styles) or in index.html. For NgModule applications import VibeFoxJSUiModule.
Svelte
<script>
import { vfjsSwitch } from '@vibefox/js-ui-svelte';
let dark = false;
</script>
<div use:vfjsSwitch={{ label: 'Dark mode', checked: dark }}
on:vfjsswitch:valueChange={(e) => (dark = e.detail.checked)}></div>
jQuery
<script src="jquery.min.js"></script>
<link rel="stylesheet" href="vibefox-js-ui.css">
<script src="vibefox-js-ui.global.js"></script>
<script src="vibefox-js-ui-jquery.js"></script>
<script>
$('#rating').vfjsRating({ value: 3, max: 5 })
.on('vfjsrating:valueChange', (e, payload) => console.log(payload.value));
$('#rating').vfjsRating('setValue', 4);
</script>
Core concepts
Components
Each component has a factory create<Name>(target, options) and a class VibeFoxJS<Name> (new VibeFoxJSSelect(target, options) is the same). The target is an element or a selector. Components that float above the page — Dialog, Drawer, Toast, Menu, CommandPalette, Tour — put their layer into <body>. Mount them on document.body (or 'body', document): the page element is not changed, the component uses a hidden placeholder of its own at the end of <body> (its el), and destroy() removes it. An ordinary mount element stays hidden while the component lives and is shown again by destroy(). Tooltip and Popover attach to the mount element as their anchor.
const select = VibeFoxJSUi.createSelect('#app', { options: [{ value: 1, label: 'One' }, { value: 2, label: 'Two' }], value: 1 });
select.setValue(2);
console.log(select.getValue());
select.setOptions({ disabled: true, placeholder: 'Pick one' });
select.destroy();
Events
Every event handler receives one payload object. Subscribe in the options (on: { valueChange: fn }) or later with on, once and off; on('*', (event, payload) => …) receives every event. Value components emit valueChange; popups emit open and close; events whose payload has preventDefault() (Kanban drops, Chat sends, FileManager actions …) can be cancelled.
const slider = VibeFoxJSUi.createSlider('#app2', { min: 0, max: 100, value: 20, label: 'Volume' });
slider.on('valueChange', (e) => console.log('dragging', e.value));
slider.on('slideEnd', (e) => console.log('released', e.value));
Every VibeFox JS component emits ready, dataChange, optionsChange, themeChange and destroy.
State snapshots
getState() returns a JSON-safe snapshot of what the user changed (a value, the active tab, splitter sizes, a dock or tile layout, a Kanban board's column order, a file manager's folder and view …); setState(state) restores it.
const tabs = VibeFoxJSUi.createTabs('#app2', { tabs: [{ id: 'a', label: 'A', content: 'First' }, { id: 'b', label: 'B', content: 'Second' }] });
tabs.setActive('b');
localStorage.setItem('tabs', JSON.stringify(tabs.getState())); // { active: 'b', order: ['a', 'b'] }
tabs.setState(JSON.parse(localStorage.getItem('tabs')));
Content
Options that hold content (content of dialogs, tabs, panels, tiles, cards …) take a text / HTML string, a DOM Node or a renderer (host) => void that fills the element. Text options (labels, titles) are text. HTML strings are your markup: do not pass untrusted HTML.
Buttons
Button
const save = VibeFoxJSUi.createButton('#app', { label: 'Save', icon: 'check', variant: 'primary' });
save.on('click', async () => { save.setLoading(true); await new Promise((r) => setTimeout(r, 300)); save.setLoading(false); });
Options: label, variant ('primary', 'secondary', 'danger', 'filled', 'outline', 'ghost'), size, icon, iconRight, loading, disabled, block (full width). Methods: setLabel(), setLoading(), setDisabled(), focus(). Event: click. A button without variant shows the primary look and has the classes vfjs-ui-btn--primary vfjs-ui-btn--default (under a container with data-vfjs-ui-variant: the class of that look, for example vfjs-ui-btn--outline, plus vfjs-ui-btn--default), so your CSS for .vfjs-ui-btn--primary reaches it too.
Icons
Options such as icon, iconRight, prefix and suffix take the name of a built-in icon or your own SVG / HTML / text. VibeFoxJSUi.listIcons() returns the names of every built-in icon (sorted; the TypeScript type is UiIconName). Names are written with hyphens ('chevron-down', 'align-start'); lower camelCase works too ('alignLeft' = 'align-left'); any other value is shown as it is (text or SVG).
console.log(VibeFoxJSUi.listIcons()); // ['align-center', 'align-end', 'align-left', …, 'zoom-out']
Built-in icons: align-start, align-center, align-end, align-left (= align-start), align-right (= align-end), arrow-up, arrow-down (also arrowdown), arrow-left, arrow-right, arrow-up-right, chevron-up, chevron-down, chevron-left, chevron-right, chevrons-left, chevrons-right, check, check2, close, plus, minus, dots, grip, search, calendar, clock, phone, user, folder, folder-plus, file, image, paperclip, clipboard, copy, scissors, trash, pencil, download, upload, send, reply, retry, undo, redo, eye, info, success, warning, error, star, heart, circle, square, smile, sparkle, spinner, play, pause, stop, grid, list, sliders, expand, shrink, move, resize, swap, pointer, zoom-in, zoom-out, bold, italic, underline, strike, type, text-color, brush, eraser, fill, blur, crop, rotate-cw, rotate-ccw, flip-h, flip-v, eyedropper.
ButtonGroup and SplitButton
const align = VibeFoxJSUi.createButtonGroup('#app', { label: 'Alignment', selection: 'single', required: true, value: 'left',
items: [{ id: 'left', icon: 'alignLeft', title: 'Left' }, { id: 'center', label: 'Center' }, { id: 'right', label: 'Right' }] });
const send = VibeFoxJSUi.createSplitButton('#app2', { label: 'Send', items: [{ id: 'later', label: 'Send later' }, { id: 'draft', label: 'Save draft' }] });
send.on('itemClick', (e) => console.log(e.item.id));
ButtonGroup: items, selection ('none', 'single', 'multiple': toggle buttons), value, required, vertical, block, label; events itemClick, valueChange. SplitButton: a main button and a menu (items as in Menu, menuLabel); methods open(), close(), isOpen(), setLabel(); events click, itemClick, open, close.
Form controls
Input and NumberInput
const phone = VibeFoxJSUi.createInput('#app', { label: 'Phone', mask: '+9 (999) 999-99-99', clearable: true, prefix: 'phone' });
phone.on('enterPress', (e) => console.log(e.value));
const qty = VibeFoxJSUi.createNumberInput('#app2', { label: 'Quantity', value: 1, min: 1, max: 99, step: 1, suffix: 'pcs' });
qty.stepUp();
Input: value, type, placeholder, mask (9 digit, a letter, * any; applyMask(raw, mask)), clearable, prefix, suffix, maxLength, disabled, label; methods setValue(), getValue(), clear(), focus(); events valueChange, clear, enterPress. NumberInput: value, min, max, step, precision, prefix, suffix (a text or an icon name before / after the number, not part of the value; a text is read with the number by screen readers, for example "12 pcs"); methods stepUp(), stepDown(); ArrowUp / ArrowDown step the value. A focused field shows one focus ring around the whole field.
Select
const tags = VibeFoxJSUi.createSelect('#app', { label: 'Tags', multiple: true, searchable: true, clearable: true, maxTagCount: 2,
options: [{ value: 'js', label: 'JavaScript', group: 'Web' }, { value: 'css', label: 'CSS', group: 'Web' }, { value: 'go', label: 'Go', group: 'Server' }] });
tags.setValue(['js', 'go']);
Options: options ({ value, label, disabled, group }), value, multiple, tags, searchable, clearable, placeholder, maxTagCount, disabled, label. Methods: open(), close(), isOpen(), setValue(), getValue(). Events: valueChange, open, close, searchInput.
AutoComplete
const city = VibeFoxJSUi.createAutoComplete('#app', {
label: 'City',
source: async (query, { signal }) => (await fetch('/api/cities?q=' + encodeURIComponent(query), { signal })).json(),
minLength: 2, delay: 250, textField: 'name', keyField: 'id',
});
const fruit = VibeFoxJSUi.createAutoComplete('#app2', { data: ['Apple', 'Apricot', 'Banana', 'Cherry'], filter: 'fuzzy', multiple: true });
Options: data (static items) or source (a function with an AbortSignal, or a URL template such as /api?q={query} returning a JSON array or { items }), delay, cache, minLength, filter ('contains', 'startsWith', 'fuzzy' or a function), keyField, textField, groupField, disabledField, template, highlight, virtual, itemHeight, multiple (chips), value, freeInput, autoHighlight, closeOnSelect, toggle, clearable, placeholder, label, inputId, readonly. Methods: search(query), getItems(), getSelectedItems(), open(), close(), clearCache(). Events: valueChange, searchInput, load, error, open, close.
Checkbox, Switch, RadioGroup, Segmented
VibeFoxJSUi.createCheckbox('#app', { label: 'I agree', checked: false });
VibeFoxJSUi.createSwitch('#app2', { label: 'Notifications', checked: true });
const plan = VibeFoxJSUi.createRadioGroup('#preview', { label: 'Plan', inline: true, value: 'm',
options: [{ value: 'm', label: 'Monthly' }, { value: 'y', label: 'Yearly' }] });
const view = VibeFoxJSUi.createSegmented('#sidebar', { label: 'View', items: [{ value: 'list', label: 'List' }, { value: 'grid', icon: 'grid', title: 'Grid' }], value: 'list' });
Checkbox: checked, label, indeterminate, disabled, name, required, value (sent with the form while checked, default 'on'); methods setChecked(), getChecked(), toggle(), setIndeterminate(). Switch: the same without the mixed state. RadioGroup: options, value, inline. Segmented: items (values, strings or { value, label, icon, title, disabled }), value, block, vertical. All emit valueChange.
Slider and Rating
const price = VibeFoxJSUi.createSlider('#app', { label: 'Price', min: 0, max: 500, step: 10, value: [50, 300], tooltip: true });
const stars = VibeFoxJSUi.createRating('#app2', { value: 3.5, max: 5, step: 0.5, labels: ['Bad', 'Poor', 'OK', 'Good', 'Great'] });
Slider: min, max, step, value (a pair = range), range, tooltip; events valueChange (while dragging), slideEnd. Rating: value, max, step (1 or 0.5), icon ('star', 'heart', 'circle' or SVG), labels, clearable, readonly; events valueChange, hoverChange.
OTP input
const code = VibeFoxJSUi.createOTPInput('#app', { length: 6, type: 'numeric', groups: [3, 3], name: 'code', autoSubmit: true });
code.on('complete', (e) => console.log('code', e.value));
Options: length, value, type ('numeric', 'alphanumeric', 'alpha', 'any'), pattern, uppercase, mask, placeholder, groups, separator, autoFocus, autoSubmit, label, readonly. A pasted code fills every cell. Methods: isComplete(), clear(), focus(index). Events: valueChange, complete.
Form fields in native forms
Every value control takes part in a native <form>: Input, NumberInput, Select, Checkbox, Switch, RadioGroup, Slider, DatePicker, ButtonGroup, ChipGroup, TimePicker, DateTimePicker, ColorPicker, Rating, FileUpload, ListView / ListBox, AutoComplete, QueryBuilder, OTPInput, Segmented, TransferList and SignaturePad. With name a control puts hidden inputs into its mount element, so the submit and new FormData(form) contain its value. required blocks the submit while the control is empty and shows the control's own message under it (aria-invalid; the focus goes to the first invalid control); form.reset() restores the initial value; a disabled control is neither submitted nor validated. Methods: checkValidity(), reportValidity() (shows the message next to the control), getValidationMessage(), reset(), focus(); event validate ({ valid, message }).
What is submitted, as with the native fields: Input its text (an empty field is sent empty); NumberInput the number; Select one value per selected option; Checkbox and Switch name=value while checked (option value, default 'on'); RadioGroup the checked value; Slider the number (a range: two values; Slider has no required, it always has a value); DatePicker YYYY-MM-DD (a range: start and end; required needs both); ButtonGroup (with selection) and ChipGroup the pressed / selected ids. Apart from Input, nothing is sent for an empty value. A control inside a <form> without a name still follows form.reset().
document.querySelector('#app').innerHTML = '<form id="order"><div id="qty"></div><div id="gift"></div><div id="day"></div></form>';
VibeFoxJSUi.createNumberInput('#qty', { label: 'Quantity', name: 'qty', value: 2 });
VibeFoxJSUi.createCheckbox('#gift', { label: 'Gift wrap', name: 'gift', checked: true }); // sends gift=on
const day = VibeFoxJSUi.createDatePicker('#day', { label: 'Delivery', name: 'day', required: true });
const order = document.querySelector('#order');
console.log(order.checkValidity(), day.getValidationMessage()); // false, the "required" message
day.setValue('2026-11-05');
console.log([...new FormData(order)]); // qty=2, gift=on, day=2026-11-05
const rating = VibeFoxJSUi.createRating('#app2', { name: 'score', required: true });
console.log(rating.checkValidity(), rating.getValidationMessage());
Date, time and color pickers
const stay = VibeFoxJSUi.createDatePicker('#app', { label: 'Stay', range: true, format: 'DD.MM.YYYY', firstDay: 1, min: '2026-01-01' });
stay.setValue(['2026-07-01', '2026-07-14']);
const meet = VibeFoxJSUi.createDateTimePicker('#app2', { label: 'Meeting', step: 15, hour12: false, value: '2026-11-03T10:30' });
const time = VibeFoxJSUi.createTimePicker('#preview', { label: 'Start', min: '08:00', max: '18:00', step: 30 });
const color = VibeFoxJSUi.createColorPicker('#sidebar', { label: 'Brand color', value: '#2563eb', format: 'hex', alpha: true });
console.log(stay.getState(), color.getRgba());
DatePicker: value (a date, or [start, end] with range), format (YYYY MM DD tokens), min, max, firstDay, inline (a permanent calendar), placeholder; methods open(), close(), isOpen(), setValue(), getValue() (a Date; with range an array [start, end] of Date objects, null for an empty end; null when empty); getState() gives the dates as 'YYYY-MM-DD' strings. TimePicker: value ('HH:mm'), min, max, step (minutes of the list), seconds, hour12 (null = by locale), clearable, readonly. DateTimePicker: value (local date-time), min, max, step, seconds, hour12, format, firstDay, inline. ColorPicker: value (any CSS color), format ('hex', 'rgb', 'hsl'), alpha, swatches (null = theme palette), inline; getRgba(); an eyedropper where the browser has one. All emit valueChange, open, close. The calendars follow the locale (month and weekday names, first weekday) and are full keyboard grids.
Lists and trees
ListView and ListBox
const people = VibeFoxJSUi.createListBox('#app', {
label: 'Assignees', selection: 'multiple', checkboxes: true, keyField: 'id', textField: 'name', height: 200,
data: [{ id: 1, name: 'Ann' }, { id: 2, name: 'Bob' }, { id: 3, name: 'Cleo', off: true }], disabledField: 'off',
draggable: true,
});
people.on('itemMove', (e) => console.log(e.from, '→', e.to));
people.setValue([1, 2]);
Options: data, keyField, textField, disabledField, template, selection ('none', 'single', 'multiple'), value, checkboxes, virtual ('auto': from 100 items), itemHeight, height, draggable (reorder by drag, Alt+ArrowUp / Down or the move menu), dragGroup (lists of a group exchange items), moveMenu, emptyText, label. ListBox is a ListView with a field border and single selection by default. Methods: getSelectedItems(), selectAll(), clearSelection(), scrollToIndex(). Events: valueChange, itemClick, itemActivate, itemMove.
TransferList
const columns = VibeFoxJSUi.createTransferList('#app2', { titles: ['Available', 'Shown'], reorder: true, max: 4,
data: ['Name', 'Email', 'Phone', 'City', 'Company'], value: ['Name', 'Email'] });
columns.transfer('City', 'target');
console.log(columns.getValue());
Options: data, keyField, textField, disabledField, value (keys of the chosen items), titles, search, template, reorder, draggable, moveAll, max, virtual, itemHeight, height, label. Methods: getItems(), transfer(keys, to), transferAll(to), setSearch(), getLists(). Events: valueChange, transfer, searchChange.
Tree
const tree = VibeFoxJSUi.createTree('#preview', { label: 'Folders', checkboxes: true, search: true,
data: [{ id: 'src', label: 'src', expanded: true, children: [{ id: 'a', label: 'app.js' }, { id: 'b', label: 'lib', lazy: true }] }],
load: async (node) => [{ id: node.id + '/x', label: 'x.js' }] });
tree.setChecked('a', true);
console.log(tree.getChecked(), tree.getState());
Options: data ({ id, label, children, expanded, disabled, lazy }), checkboxes (tri-state with propagation), selectable, search, load (lazy children), label. Methods: setData(), getData(), findNode(), selectNode(), toggleNode(), setChecked(), getChecked(), filter(query). Events: nodeSelect, nodeToggle, checkChange, nodeLoad.
Forms and file upload
Form
createForm builds a form from field descriptions with validation rules; each field is a VibeFox JS control.
const form = VibeFoxJSUi.createForm('#app', {
fields: [
{ name: 'email', label: 'Email', type: 'input', props: { type: 'email' }, rules: [{ required: true }, { pattern: '^[^@]+@[^@]+$', message: 'Not an email' }] },
{ name: 'age', label: 'Age', type: 'number', rules: [{ min: 18, message: 'Adults only' }] },
{ name: 'plan', label: 'Plan', type: 'segmented', props: { items: ['Free', 'Pro'] } },
{ name: 'terms', label: 'I accept the terms', type: 'checkbox', rules: [{ required: true, message: 'Please accept the terms' }] },
],
value: { plan: 'Free' }, layout: 'horizontal', validateOn: 'change', submitLabel: 'Register',
});
form.on('submit', (e) => console.log(e.value));
console.log(form.validate());
Field types: input, number, select, checkbox, switch, radio, slider, date, time, datetime, color, rating, file, listbox, otp, segmented, transfer; props are the options of that control. Rules: required, pattern, min, max, minLength, custom ((value, all) => boolean | string: true = valid, false = the message, a text = that error), message. Only required checks an empty value; the other rules, custom too, run only for non-empty values (empty = null, '', [], false of an unchecked box or switch), so a box that must be checked takes { required: true, message: '…' }. The name of every field is passed to its control, so new FormData() of the form element contains all fields. Options: fields, value, layout, validateOn, submitLabel, resetLabel. Methods: validate(), submit(), reset(), getValue(), setValue(), getField(name). Events: submit (only when valid), fieldChange, validate. Errors are linked to their fields and the focus goes to the first invalid one.
FileUpload
const files = VibeFoxJSUi.createFileUpload('#app2', {
url: '/api/upload', fieldName: 'file', headers: { 'X-CSRF': 'token' },
multiple: true, accept: 'image/*,.pdf', maxFileSize: 20e6, maxFiles: 5,
chunkSize: 5e6, retries: 3, concurrency: 2, autoUpload: true, name: 'attachments',
});
files.on('uploadComplete', (e) => console.log(e.file.name, e.response));
Uploads go by XMLHttpRequest to url (with method, fieldName, headers, params, withCredentials, timeout), in chunks with chunkSize, with retries and retryDelay and concurrency files at once — or through your transport (a function of the chunk context, or { upload, complete }). Other options: autoUpload, multiple, accept, maxFileSize, minFileSize, maxFiles, value (files uploaded before), fileValue (the form value of a file). Methods: addFiles(), open(), upload(id), retry(id), cancel(id), removeFile(id), clear(), getFiles(). Events: filesAdd, fileReject, uploadStart, uploadProgress, chunkUpload, uploadRetry, uploadComplete, uploadError, uploadCancel, fileRemove, queueComplete, valueChange. File sizes are written in the units of the locale with a space, as Intl formats them ("20 B", "46 kB"; the same in the file manager).
Navigation
Tabs and Accordion
const tabs = VibeFoxJSUi.createTabs('#app', { label: 'Document', closable: true, reorder: true,
tabs: [{ id: 'a', label: 'Overview', content: '<p>Text</p>' }, { id: 'b', label: 'Details', content: (host) => { host.textContent = 'Rendered'; } }] });
tabs.addTab({ id: 'c', label: 'History', content: 'Log' }, { activate: true });
const faq = VibeFoxJSUi.createAccordion('#app2', { multiple: true, headingLevel: 3,
items: [{ id: 'q1', title: 'Shipping?', content: '3–5 days' }, { id: 'q2', title: 'Returns?', content: '30 days' }] });
faq.expand('q1');
Tabs: tabs ({ id, label, content, icon, closable, disabled }), active, closable, reorder, label; methods setActive(), getActive(), addTab(), removeTab(), moveTab(); events tabChange, tabClose, tabReorder. Accordion: items ({ id, title, content, disabled }), active, multiple, headingLevel; methods toggle(), expand(), collapse(); event itemToggle.
Menu and Toolbar
const menu = VibeFoxJSUi.createMenu('#app', { label: 'Actions', items: [
{ id: 'copy', label: 'Copy', shortcut: 'Ctrl+C', icon: 'copy' },
{ id: 'wrap', label: 'Word wrap', checked: true },
{ divider: true },
{ id: 'export', label: 'Export', children: [{ id: 'pdf', label: 'PDF' }, { id: 'csv', label: 'CSV' }] },
] });
menu.attachContext('#app2'); // right click
menu.on('itemClick', (e) => console.log(e.path));
const bar = VibeFoxJSUi.createToolbar('#preview', { label: 'Formatting', items: [
{ type: 'toggle', id: 'bold', icon: 'bold', label: 'Bold' }, { type: 'separator' },
{ type: 'button', id: 'undo', icon: 'undo', tooltip: 'Undo' }, { type: 'spacer' },
{ type: 'custom', render: (host) => { host.textContent = 'Saved'; } },
] });
bar.on('toggleChange', (e) => console.log(e.id, e.pressed));
Menu: items ({ id, label, icon, shortcut, disabled, checked, children } or { divider: true }), closeOnClick, label; methods openAt(x, y), openFor(anchor), close(), isOpen(), attachContext(el) (context menu), attachTrigger(el) (dropdown); events itemClick, open, close. Toolbar: items of type button, toggle, separator, spacer, custom; methods getItem(), setItem(); events itemClick, toggleChange.
Breadcrumb and Pagination
VibeFoxJSUi.createBreadcrumb('#app', { maxItems: 4, items: [{ label: 'Home', href: '/' }, { label: 'Docs', href: '/docs' }, { label: 'UI' }] });
const pages = VibeFoxJSUi.createPagination('#app2', { total: 240, pageSize: 20, page: 3, pageSizes: [10, 20, 50], showTotal: true });
pages.on('pageChange', (e) => console.log(e.page, e.pageSize));
Breadcrumb: items ({ id, label, href, icon }), separator, maxItems; setItems(); event itemClick. Pagination: total, page, pageSize, siblings, pageSizes, showTotal; setPage(), getPage(); event pageChange.
Stepper and Wizard
const wizard = VibeFoxJSUi.createWizard('#app', { steps: [
{ id: 'account', title: 'Account', content: '<p>Account data</p>', validate: () => true },
{ id: 'address', title: 'Address', optional: true, content: '<p>Address</p>' },
{ id: 'done', title: 'Confirm', content: '<p>Check and finish</p>' },
] });
await wizard.next();
wizard.on('finish', () => console.log('finished'));
Options: steps ({ id, title, description, icon, optional, disabled, content, validate }), active, linear (forward only through valid steps), validate (for every step), orientation, buttons (Back / Next / Finish; on by default in Wizard), disabled. A validator returns true, false or a message (or a promise of it). Methods: goTo(), next(), prev(), finish() (promises of true / false), getActive(), setCompleted(), setStepError(), reset(). Events: stepChange, stepValidate, finish.
CommandPalette
const palette = VibeFoxJSUi.createCommandPalette('#app2', { hotkey: 'mod+k', commands: [
{ id: 'new', title: 'New document', category: 'File', shortcut: 'Ctrl+N', handler: () => console.log('new') },
{ id: 'theme', title: 'Toggle dark theme', keywords: ['night', 'dark'], handler: () => VibeFoxJSUi.setTheme('dark') },
] });
palette.open();
palette.run('new');
A fuzzy search over your commands, opened with Ctrl+K / Cmd+K (hotkey, null turns it off); recent commands come first (recent). Options: commands ({ id, title, category, shortcut, icon, keywords, handler }), hotkey, placeholder, recent, maxResults. Methods: open(), close(), isOpen(), run(id), addCommand(), removeCommand(). Events: commandRun, open, close.
Dialogs and overlays
Dialog
A dialog is modal by default (backdrop, focus kept inside); with modal: false it is a window: several windows stay open, the clicked one comes to the top, and they are moved by the header, resized by the corners, maximized and minimized.
const dlg = VibeFoxJSUi.createDialog('#app', {
title: 'Delete file?', content: '<p>This cannot be undone.</p>',
buttons: [{ id: 'cancel', label: 'Cancel', variant: 'secondary' }, { id: 'ok', label: 'Delete', variant: 'danger' }],
});
dlg.on('buttonClick', (e) => { console.log(e.id); dlg.close(); });
const win = VibeFoxJSUi.createDialog('#app2', { title: 'Properties', modal: false, resizable: true, maximizable: true, minimizable: true,
width: 360, x: 40, y: 40, content: 'Window content' });
win.setPosition(80, 60);
Options: title, content, modal, width, height, x, y, draggable, resizable, maximizable, minimizable, closable, buttons, openOnInit (default true), escClose. Methods: open(), close() (closes and removes the window), isOpen(), focus() (to the top), toggleMaximize(), toggleMinimize(), setPosition(). Events: open, close, buttonClick, focus, moveEnd, resizeEnd, maximizeChange, minimizeChange. With draggable or resizable the header starts with a window menu button (the context menu of the header opens the same menu): move left / right / up / down in steps, center, wider / narrower / taller / shorter — the way to move and resize a window without dragging.
Drawer
const drawer = VibeFoxJSUi.createDrawer('#app', { side: 'right', size: 'm', title: 'Filters', content: '<p>Filter controls</p>', openOnInit: false });
drawer.open();
Options: side ('left', 'right', 'top', 'bottom'), size (px, a CSS length or 's' / 'm' / 'l'), title, content, modal, escClose, openOnInit. Methods: open(), close(), toggle(), isOpen(). Events: open, close.
Toast
const toast = VibeFoxJSUi.createToast('#app2', { position: 'bottom-right', duration: 4000, max: 3 });
toast.success('Saved');
const id = toast.show({ type: 'warning', title: 'Offline', message: 'Changes are kept locally.', duration: 0, actions: [{ id: 'retry', label: 'Retry' }] });
toast.on('actionClick', (e) => { if (e.action === 'retry') toast.hide(id); });
await toast.promise(new Promise((r) => setTimeout(r, 200)), { loading: 'Uploading…', success: 'Uploaded', error: 'Upload failed' });
Options: position ('top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', 'bottom-center'), duration (0 = stays), max (the rest wait in a queue). Methods: show(), info(), success(), warning(), error(), promise(), hide(id), clear(). Events: toastShow, toastClose, actionClick. Toasts are read out by screen readers; the timer pauses on hover and focus.
Tooltip and Popover
document.querySelector('#app').innerHTML = '<button>Help</button>';
VibeFoxJSUi.createTooltip('#app button', { content: 'Opens the manual', placement: 'bottom' });
document.querySelector('#app2').innerHTML = '<button>Details</button>';
const pop = VibeFoxJSUi.createPopover('#app2 button', { title: 'Order 42', content: '<p>3 items, 120 EUR</p>', placement: 'right' });
Both attach to the mount element (the anchor) and leave its classes and look alone: a VibeFox JS button keeps its variant. Tooltip: content, placement, trigger ('hover', 'focus', 'click'), delay, disabled; show(), hide(), setContent(). Popover: also title and rich content, opens on click by default. Events: open, close.
Tour
document.querySelector('#app').innerHTML = '<button id="new">New</button> <button id="share">Share</button>';
const tour = VibeFoxJSUi.createTour('#app2', { steps: [
{ target: '#new', title: 'Create', content: 'Start a new document here.', placement: 'bottom' },
{ target: '#share', title: 'Share', content: 'Invite your team.' },
] });
tour.start();
tour.on('finish', () => localStorage.setItem('tour-done', '1'));
A spotlight on each target with a step card. Options: steps ({ target, title, content, placement }), padding, scroll. Methods: start(index), next(), prev(), stop(), isActive(). Events: stepChange, finish, skip.
Layout
Splitter
const split = VibeFoxJSUi.createSplitter('#app', { direction: 'horizontal', panes: [
{ content: 'Navigation', size: 25, min: 120, collapsible: true }, { content: 'Editor', size: 75 },
] });
split.setSizes([30, 70]);
split.on('paneResize', (e) => console.log(e.sizes));
Options: direction, panes ({ content, size, min, collapsible }). Methods: collapse(index), getSizes(), setSizes(). Events: paneResize, paneCollapse. A double click on a gutter collapses its pane; a click opens its move menu; the arrow keys move it.
DockLayout
Panels in five zones like an IDE; users drag panels between zones (or use the move menu / Alt+arrows), and the layout is saved as JSON.
const dock = VibeFoxJSUi.createDockLayout('#app2', { zoneSizes: { left: 220, bottom: 160 }, panels: [
{ id: 'files', title: 'Files', zone: 'left', content: 'Tree' },
{ id: 'code', title: 'main.js', zone: 'center', content: 'Code', closable: true },
{ id: 'log', title: 'Console', zone: 'bottom', content: 'Output' },
] });
dock.movePanel('log', 'right');
dock.on('layoutChange', (e) => localStorage.setItem('dock', JSON.stringify(e.state)));
Options: panels ({ id, title, zone, content, closable }), zoneSizes. Methods: getPanel(), addPanel(), removePanel(), movePanel(), activatePanel(), collapseZone(). Events: panelMove, panelClose, panelActivate, zoneCollapse, layoutChange.
TileLayout
A dashboard grid: tiles are dragged and resized on a column grid, flow around static tiles, and get other layouts at other widths.
const tiles = VibeFoxJSUi.createTileLayout('#preview', {
columns: 12, breakpoints: { 0: 4, 600: 8, 1000: 12 }, rowHeight: 80,
tiles: [
{ id: 'sales', title: 'Sales', x: 0, y: 0, w: 6, h: 3, content: 'Chart' },
{ id: 'kpi', title: 'KPI', x: 6, y: 0, w: 3, h: 2, minW: 2, content: '42' },
{ id: 'news', title: 'News', x: 9, y: 0, w: 3, h: 4, collapsible: true, content: 'Text' },
],
});
tiles.moveTile('kpi', 0, 3);
tiles.on('layoutChange', (e) => console.log(e.reason, e.layout));
const saved = tiles.toJSON();
Options: tiles ({ id, title, content, x, y, w, h, minW, minH, maxW, maxH, static, draggable, resizable, closable, collapsible, maximizable, collapsed, actions, className }), columns, breakpoints, layouts (saved layouts per column count), rowHeight, compact, draggable, resizable, header, headingLevel, closable, collapsible, maximizable, template, undoLimit, label, disabled. Methods: getLayout(), setLayout(), getColumns(), getTile(), getTiles(), addTile(), removeTile(), updateTile(), moveTile(), resizeTile(), collapseTile(), maximizeTile(), compact(), undo(), redo(), canUndo(), canRedo(), toJSON(). Events: layoutChange, dragStart, dragEnd, tileCollapse, tileMaximize, tileClose, tileAction, breakpointChange. The reason of layoutChange is 'drag', 'resize', 'keyboard', 'menu' (the move menu), 'api', 'add', 'remove', 'collapse', 'undo', 'redo' or 'compact'.
Data display
Card
const card = VibeFoxJSUi.createCard('#app', { title: 'Mountain lodge', subtitle: 'From 120 EUR', media: 'data:image/gif;base64,R0lGODlhAQABAAAAACw=', mediaAlt: 'Lodge', // an image URL
content: '<p>Quiet place near the lake.</p>', variant: 'elevated', actions: [{ id: 'book', label: 'Book', variant: 'primary' }] });
card.on('action', (e) => console.log(e.id));
Options: title, subtitle, headingLevel, content, footer, media, mediaAlt, mediaPosition, actions, variant ('outlined', 'elevated' or a look), size, href / target (the card is a link), clickable, disabled. Events: click, action.
Avatar, Chip, Badge
VibeFoxJSUi.createAvatarGroup('#app', { max: 3, items: ['Ann Lee', 'Bob Stone', { name: 'Cleo', status: 'online' }, 'Dan', 'Eve'] });
const filters = VibeFoxJSUi.createChipGroup('#app2', { selection: 'multiple', removable: true, items: ['Open', 'Urgent', { id: 'me', label: 'Mine', icon: 'user' }] });
filters.on('itemRemove', (e) => console.log('removed', e.item));
document.querySelector('#preview').innerHTML = '<button>Inbox</button>';
const badge = VibeFoxJSUi.createBadge('#preview button', { count: 7, max: 99, type: 'error', attached: true });
badge.setCount(12);
Avatar: src, name (initials and a color from the name), alt, icon, status, color, size ('xs' … 'xl' or px), shape; AvatarGroup: items, max (avatars shown, default 4; the rest are counted in a "+N" avatar: max: 3 of 5 = 3 avatars and "+2"; 0 = all); event imageError. Chip: label, icon, avatar, selectable, selected, clickable, removable, color, variant; ChipGroup: items, selection, value, removable; events click, selectedChange, remove / valueChange, itemClick, itemRemove. Badge: count, text, max, dot, type, attached (on the corner of the mount element, for example a button, which keeps its look); setCount().
Progress, Spinner, Skeleton
const bar = VibeFoxJSUi.createProgressBar('#app', { value: 30, max: 100, label: true, striped: true });
bar.setValue(80);
const spin = VibeFoxJSUi.createSpinner('#app2', { size: 'l', shape: 'dots', label: 'Loading orders…', delay: 200 });
VibeFoxJSUi.createSkeleton('#preview', { rows: 3, avatar: true, animated: true, widths: ['60%', '90%', '40%'] });
ProgressBar: value, max, indeterminate, striped, label; events valueChange, complete. Spinner: size, shape ('ring', 'dots'), label, showLabel, visible, delay, overlay (covers the positioned parent); show(), hide(), isVisible(), setLabel(). Skeleton: rows, avatar, animated, widths.
Carousel
const slides = VibeFoxJSUi.createCarousel('#app', { label: 'Products', loop: true, autoplay: 5000, perView: { 0: 1, 600: 2, 900: 3 }, perMove: 1,
items: [{ content: '<p>One</p>' }, { content: '<p>Two</p>' }, { content: '<p>Three</p>' }, { content: '<p>Four</p>' }] });
slides.goTo(2);
Options: items, active, loop, autoplay (not started with reduced motion), interval, pauseOnHover, arrows, indicators, swipe, effect ('slide', 'fade'), perView (a number, 'auto' or by width), perMove, label. Methods: next(), prev(), goTo(), getActive(), play(), pause(), isPlaying(), getPerView(). Events: slideChange, autoplayChange.
Kanban
A board of columns (and optional swimlanes) with cards your data defines. Cards are moved by drag and drop, by the keyboard or by their "Move" menu; WIP limits, search, quick add, undo / redo and virtual cells for long columns are built in.
const board = VibeFoxJSUi.createKanban('#app', {
columns: [{ id: 'todo', title: 'To do' }, { id: 'doing', title: 'In progress', limit: 3 }, { id: 'done', title: 'Done' }],
cards: [
{ id: 1, column: 'todo', title: 'Write docs', labels: [{ text: 'docs', color: 'info' }], assignees: ['Ann'], due: '2026-11-10' },
{ id: 2, column: 'doing', title: 'Fix login', labels: ['bug'], progress: 40 },
],
swimlaneField: null, wipStrict: true,
});
board.on('cardDrop', (e) => { if (e.to.column === 'done' && !confirm('Done?')) e.preventDefault(); });
board.on('cardsChange', (e) => console.log(e.reason, e.ids));
board.moveCard(1, { column: 'doing', index: 0 });
board.addCard({ id: 3, title: 'Review PR' }, { column: 'todo' });
Options: cards (or data), columns ({ id, title, limit, wipStrict, collapsed, width, color }), swimlanes, keyField, columnField, swimlaneField, fields (field names of the card parts), template, cardLabel, draggable, columnDraggable, wipStrict, collapsible, search (the search text: a string, every word must occur in the title, description, labels or people), filter (a function), toolbar (the search field above the board, default true), quickAdd, virtual, cardHeight, dateFormat, headingLevel, undoLimit, label, disabled. Card fields: id, column, title, description, labels, assignees, due, progress, color. Methods: getCards(), getCard(), getCardPlace(), getCardParts(), getColumns(), getSwimlanes(), addCard(), updateCard(), removeCard(), moveCard(), moveColumn(), collapseColumn(), collapseSwimlane(), setSearch(), getSearch(), setFilter(), scrollToCard(), focusCard(), undo(), redo(), canUndo(), canRedo(). Events: cardClick, cardDragStart, cardDrop (cancelable), cardMove, cardDragEnd, cardAdd (cancelable), cardsChange, columnDrop, columnMove, columnCollapse, swimlaneCollapse, wipExceed, searchChange. cardMove and columnMove carry reason: 'drag', 'keyboard', 'menu' (the move menu) or 'api'.
Chat and AI Prompt
Chat
A message list with a composer: Markdown messages, groups by author and time, date separators, replies, reactions, copying, attachments (uploaded through FileUpload options before sending), mentions, typing indicators, suggestions, loading older messages and streamed messages.
const chat = VibeFoxJSUi.createChat('#app', {
user: { id: 'me', name: 'Me' },
users: [{ id: 'ann', name: 'Ann', status: 'online' }],
messages: [{ id: 1, author: 'ann', text: 'Hi! Did you see **the report**?', time: Date.now() - 60000 }],
attachments: true, mentions: true, suggestions: ['Yes', 'Not yet'],
});
chat.on('send', (e) => { fetch('/api/messages', { method: 'POST', body: JSON.stringify(e.message) }); });
chat.addMessage({ author: 'ann', text: 'Great, thanks.' });
chat.setTyping(['ann']);
Options: messages (or data; { id, author, text, time, status, replyTo, reactions, attachments, kind, edited }), user, users, markdown, messageTemplate, linkTarget, groupWindow, dateSeparators, showAvatars, showNames, timeFormat, reactions, allowReactions, allowReply, allowCopy, value, placeholder, inputLabel, sendOnEnter, maxRows, maxLength, mentions, attachments, accept, maxFileSize, pasteImages, upload, typing, suggestions, showSuggestions, sendStatus, hasMore, announce, virtual, label, composer, disabled. Methods: getMessages(), getMessage(), addMessage(m, { prepend }), updateMessage(), removeMessage(), clear(), setTyping(), setHasMore(), send(), reply(), cancelReply(), toggleReaction(), copyMessage(), streamMessage(), stop(), isStreaming(), addFiles(), scrollToBottom(), scrollToMessage(), getValue(), setValue(). Events: send (cancelable), messageAdd, messageUpdate, messageRemove, reactionToggle, reply, copy, resend, attachmentClick, typingChange, mention, loadMore, streamStart, streamEnd, valueChange, suggestionClick.
AI Prompt
AIPrompt is a chat with an assistant: your request function gets the prompt and the conversation and returns the answer — a string, an async iterable, a ReadableStream, a Response of your server, or parts pushed with ctx.push() / ctx.done(). The library never calls a model or a service itself; Stop aborts ctx.signal.
const ai = VibeFoxJSUi.createAIPrompt('#app2', {
assistant: { name: 'Assistant' },
suggestions: ['Summarize my week', 'Draft an e-mail'],
request: (prompt, ctx) => fetch('/api/ai', { method: 'POST', body: JSON.stringify({ messages: ctx.messages }), signal: ctx.signal }),
});
ai.ask('What can you do?');
Own options: request, assistant ({ id, name, avatar, icon }), retry (a Retry button on the last answer); plus every Chat option. Methods: ask(prompt), retry(id) and the Chat methods. Event: retry and the Chat events. chat.streamMessage(source) streams any answer into a plain Chat the same way.
File manager
An explorer over your backend: a folder tree, details and tiles views, sorting, search, previews, new folder, rename, cut / copy / paste, drag and drop, delete, upload (with chunks, also dropped folders) and download. The backend is an adapter you write; createMemoryFileAdapter(tree) is one in memory for prototypes.
const fm = VibeFoxJSUi.createFileManager('#app', {
adapter: VibeFoxJSUi.createMemoryFileAdapter([
{ name: 'Documents', children: [{ name: 'report.pdf', size: 120000 }, { name: 'notes.txt', content: 'Hello' }] },
{ name: 'Images', children: [] },
]),
view: 'details', tree: true, preview: true, height: 420,
});
await fm.navigate('/Documents');
fm.on('fileOpen', (e) => console.log('open', e.entry.path));
await fm.createFolder('Archive');
An adapter has list(path, { signal }) and optionally mkdir, rename, move, copy, remove, upload (one call per chunk), download, search, thumbnail; methods it lacks hide their commands, and errors with code 'EEXIST', 'ENOENT', 'EINVAL' or 'EACCES' get localized messages. Options: adapter, data (tree of the in-memory adapter), path, rootName, view, sort, foldersFirst, columns, thumbnails, tree, treeWidth, preview, selection, readonly, disabled, confirmDelete, conflict ('rename', 'overwrite', 'error'), renameNew, upload (FileUpload options), search, searchDelay, filter, contextMenu, virtual, height, label. Methods: navigate(), back(), forward(), up(), refresh(), open(), getPath(), getEntries(), getAdapter(), setView(), setSort(), setSearch(), getSelected(), select(), selectAll(), clearSelection(), createFolder(), rename(), startRename(), copy(), cut(), paste(), getClipboard(), clearClipboard(), move(), copyTo(), remove(), upload(), download(), execute(command). Events: pathChange, load, selectionChange, fileOpen, beforeAction (cancelable), action, error, viewChange, sortChange, searchChange, clipboardChange, contextMenu, menuAction, layoutChange.
Query builder
A visual editor of filter conditions with AND / OR groups. Its model is the filter model of VibeFox JS Grid ({ op, not, rules: [{ field, op, value }] }), and it turns the model into SQL with parameters, a readable text or a filter function.
const qb = VibeFoxJSUi.createQueryBuilder('#app', {
fields: [
{ field: 'name', label: 'Name', type: 'text' },
{ field: 'score', label: 'Score', type: 'number' },
{ field: 'city', label: 'City', type: 'list', options: ['Berlin', 'Paris'] },
{ field: 'active', label: 'Active', type: 'boolean' },
],
value: { op: 'and', rules: [{ field: 'score', op: '>=', value: 50 }, { field: 'city', op: 'in', values: ['Berlin'] }] },
summary: true,
});
console.log(qb.toSQL({ params: true })); // { sql, params }
console.log(qb.toText());
const rows = [{ name: 'Ann', score: 70, city: 'Berlin', active: true }].filter(qb.getPredicate());
Operators: text contains, notContains, equals, notEquals, startsWith, endsWith, blank, notBlank; numbers and dates =, !=, >, >=, <, <=, between; isTrue, isFalse; lists in, notIn. Options: fields ({ field, label, type, options, operators, editor }; grid column definitions work too), value, maxDepth, allowNot, allowGroups, summary, label, readonly. Methods: getValue(), setValue(), getFilterModel(), setFilterModel(), getDraft(), clear(), addRule(), validate(), toSQL(), toText(), getPredicate(), toJSON(). Events: valueChange, filterChange, validate.
Spreadsheet
A workbook with sheets, a formula bar, formatting, number formats, formulas across sheets (the formula engine of VibeFox JS, Excel syntax), your own functions and names, undo / redo, and Excel (.xlsx) import and export.
const sheet = VibeFoxJSUi.createSpreadsheet('#app', {
data: { sheets: [{ name: 'Sales', rows: [['Month', 'Units', 'Price', 'Total'], ['Jan', 10, 2.5, '=B2*C2'], ['Feb', 14, 2.5, '=B3*C3']],
styles: { 'A1': { bold: true }, 'D2': { numFmt: '#,##0.00' } }, colWidths: { A: 120 } }] },
functions: { TAX: (x) => x * 0.2 },
names: { RATE: 0.2 },
});
sheet.setCell('D4', '=SUM(D2:D3)');
console.log(sheet.getValue('D4'), sheet.evaluate('=TAX(100)'));
sheet.setStyle('D2:D4', { fill: '#fef3c7', align: 'end' });
const bytes = await sheet.getXlsx();
Options: data ({ sheets: [{ name, cells, rows, styles, colWidths, rowCount, colCount }], active }), rows, cols, toolbar, formulaBar, tabs, status, readOnly, functions, names, currency, fileName, label, historyLimit. Cell styles: bold, italic, underline, strike, color, fill, align, numFmt (Excel format codes). Methods: getData(), getSheets(), getActiveSheet(), setActiveSheet(), addSheet(), removeSheet(), renameSheet(), moveSheet(), getCell(), getValue(), setCell(), getRange(), setRange(), setStyle(), setColumnWidth(), select(), selectAll(), getSelection(), editCell(), evaluate(), registerFunction(), getFormulaEngine(), undo(), redo(), canUndo(), canRedo(), getXlsx(), exportXlsx(), importXlsx(). Events: change, cellChange, selectionChange, sheetChange, sheetRemove (cancelable), editStart, editEnd, historyChange, import, export.
Image editor
Crop (free or by ratio), rotate, flip, straighten, resize, filters (brightness, contrast, saturation, grayscale, sepia, blur, sharpen) and annotations (brush, arrow, rectangle, ellipse, text, blur / pixelate areas), with a history and export to PNG, JPEG or WebP. The edits are a JSON document applied to the original on export.
const canvas = document.createElement('canvas'); canvas.width = 400; canvas.height = 300;
canvas.getContext('2d').fillRect(50, 50, 200, 120);
const img = VibeFoxJSUi.createImageEditor('#app2', { src: canvas, history: true, format: 'image/jpeg', quality: 0.9 });
await img.load(canvas);
img.rotate(90);
img.setFilters({ brightness: 10, contrast: 15 });
img.addShape({ type: 'text', x: 20, y: 20, text: 'Draft', size: 32, color: '#dc2626' });
const blob = await img.export({ type: 'image/png' });
Options: src, tools, tool, history, historyLimit, cropRatios, cropRatio, previewMaxPixels, maxPixels, format, quality, fileName, open (an Open button and file drop), colors, label. Methods: load(), getTool(), setTool(), rotate(), flip(), setFilters(), getFilters(), resize(), resetEdits(), setCropRatio(), swapCropFrame(), setAngle(), getCrop(), setCrop(), applyCrop(), cancelCrop(), addShape(), deleteShape(), getShapes(), selectShape(), undo(), redo(), canUndo(), canRedo(), goTo(), getHistory(), toCanvas(), export(), toDataURL(), save(), getZoom(), setZoom(), getImageSize(), getOutputSize(). Events: load, change, toolChange, historyChange, selectionChange, save (cancelable), error.
Signature pad and barcodes
SignaturePad
const sign = VibeFoxJSUi.createSignaturePad('#app', { name: 'signature', required: true, format: 'svg', penWidth: 2.5, velocity: 0.6 });
sign.setValue({ width: 300, height: 120, strokes: [{ points: [[20, 80, 1], [120, 40, 1], [220, 90, 1]] }] });
console.log(sign.isEmpty(), sign.toSVG().length);
const png = sign.toDataURL('image/png', { trim: true, scale: 2 });
Options: value, color, penWidth, minWidth, maxWidth, pressure, velocity, smoothing, background, guide, placeholder, toolbar (undo, redo, clear), label, format (form value: 'png', 'svg', 'json'), readonly. Methods: isEmpty(), getValue(), setValue(), undo(), redo(), clear(), toCanvas(), toDataURL(), toBlob(), toSVG(), download(). Events: strokeStart, strokeEnd, valueChange, clear.
QR code and barcodes
VibeFoxJSUi.createQRCode('#app2', { value: 'https://example.com/ticket/42', ecLevel: 'M', moduleSize: 4, label: 'Ticket link' });
const ean = VibeFoxJSUi.createBarcode('#preview', { type: 'ean13', value: '400638133393', text: true, height: 60 });
console.log(ean.isValid(), ean.getValue());
const symbol = VibeFoxJSUi.encodeBarcode('qr', 'HELLO'); // modules, version, mask … (also in Node)
Types: qr, datamatrix, code128, ean13, ean8, upca, code39, itf, itf14. Options: type, value, render ('svg' or 'canvas'), moduleSize, height, margin, text, color, background, label; QR ecLevel, version, mask, mode, eci, logo (an image in the center); Data Matrix shape, symbolSize; Code 39 / ITF checksum, fullAscii, wide, bearer. Methods: getValue(), setValue(), isValid(), getSymbol(), toSVG(), toCanvas(), toDataURL(), toBlob(), download(). Events: render, error.
Theming and styling
Themes
Every VibeFox JS component has the themes light (default), dark and high-contrast built into its CSS file. The optional vibefox-js-themes.css adds the theme pack: high-contrast-light, paper, paper-dark, glass, glass-dark, classic, classic-dark, ocean, ocean-dark, forest, forest-dark, sunset, sunset-dark, graphite, graphite-dark. The same file works for every VibeFox JS library.
VibeFoxJSUi.setTheme('dark'); // the whole page
VibeFoxJSUi.setTheme('ocean', '#sidebar'); // every component inside a container
select.setTheme('glass'); // one component (also: the theme option)
select.setTheme(null); // follow the page / container again
A component without its own theme follows the nearest container with a theme, then the page. After setTheme(name, container) the theme variables are set on the container itself too, so your CSS of the container can use them (#sidebar { background: var(--vfjs-bg); }). Your own theme: registerTheme(name, vars) with the theme variables (bg, fg, border, accent, accent-fg, muted, surface, radius, font, shadow, palette-0 … palette-9 and any other token); it applies at once to every component that uses it. getTheme() returns the page theme, themes lists the registered ones; the event themeChange reports a switch.
VibeFoxJSUi.registerTheme('brand', { accent: '#e11d48', 'accent-fg': '#ffffff', radius: '10px' });
select.setTheme('brand');
CSS variables
Every color, size, spacing, font, radius, shadow and duration of VibeFox JS UI is a CSS variable, so any setting is changed in one place. There are three levels:
- theme variables shared by all VibeFox JS components:
--vfjs-bg,--vfjs-fg,--vfjs-border,--vfjs-accent,--vfjs-accent-fg,--vfjs-muted,--vfjs-surface,--vfjs-radius,--vfjs-font,--vfjs-shadow,--vfjs-palette-0…--vfjs-palette-9; - design tokens: spacing
--vfjs-space-1…--vfjs-space-8, font sizes--vfjs-font-size,--vfjs-font-size-smand others, radii--vfjs-radius-sm…, status colors--vfjs-danger,--vfjs-success,--vfjs-warning,--vfjs-info, the scale--vfjs-size-unit, durations--vfjs-motion-duration, the focus ring--vfjs-focus-ring-colorand--vfjs-focus-ring-width; - variables of the library,
--vfjs-ui-*, which default to the tokens above.
/* all VibeFox JS components of the page */
.vfjs { --vfjs-accent: #0f766e; --vfjs-radius: 4px; }
/* only this form */
#checkout {
--vfjs-ui-field-bg: #f8fafc;
--vfjs-ui-btn-bg: #0f766e;
--vfjs-ui-control-border: #94a3b8;
}
About 750 variables, all starting with --vfjs-ui-. Shared ones: the size scale (--vfjs-ui-scale, --vfjs-ui-scale-s, --vfjs-ui-scale-l, --vfjs-ui-font-size), the looks (--vfjs-ui-filled-bg, --vfjs-ui-outline-border, --vfjs-ui-ghost-hover-bg), control colors (--vfjs-ui-control-border, --vfjs-ui-accent-text), the smallest pointer target (--vfjs-ui-target-min). Per component: buttons (--vfjs-ui-btn-bg …), fields (--vfjs-ui-field-bg, --vfjs-ui-field-border …), options (--vfjs-ui-option-selected-bg …), tabs (--vfjs-ui-tab-active-fg …), windows (--vfjs-ui-window-bg, --vfjs-ui-dialog-width), drawer (--vfjs-ui-drawer-size), toasts (--vfjs-ui-toast-accent), badges (--vfjs-ui-badge-hue), lists (--vfjs-ui-list-item-height), chips (--vfjs-ui-chip-height), avatars (--vfjs-ui-avatar-size), tiles (--vfjs-ui-tile-row-height), Kanban (--vfjs-ui-kanban-card-estimate), file manager (--vfjs-ui-fm-tree-width), carousel (--vfjs-ui-carousel-slide-width), signature (--vfjs-ui-sign-pen), codes (--vfjs-ui-code-module, --vfjs-ui-barcode-height).
Buttons: --vfjs-ui-btn-bg colors the buttons without their own variant; --vfjs-ui-btn-primary-bg colors every primary button (also variant: 'primary'); the other variants have their own variables (--vfjs-ui-btn-secondary-bg …).
From JavaScript: set the variables on the mount element (el.style.setProperty('--vfjs-ui-btn-bg', '#0f766e')) or on a container.
Where to set them: on :root, on any container of your page (#checkout { --vfjs-accent: #0f766e; }), on the element of the component, or in a theme (registerTheme). The closest value wins; a component with its own theme (the option theme or component.setTheme(name)) keeps the theme variables of that theme even inside a container that sets them. A container inside another component (a form inside a dialog or a card) passes the variables of the library to the components in it as well. Only the shared design tokens (--vfjs-space, --vfjs-danger, --vfjs-selected-bg …) do not pass there: set them on a container outside the outer component or on the nested components themselves (#form .vfjs { … }). Some size variables are computed on every component (--vfjs-ui-scale, --vfjs-ui-font-size, --vfjs-ui-font-size-xs, --vfjs-ui-font-size-sm, --vfjs-ui-font-size-lg, --vfjs-ui-avatar-size, --vfjs-ui-chip-height, --vfjs-ui-list-item-height, --vfjs-ui-rating-size, --vfjs-ui-spinner-size, --vfjs-ui-step-marker-size, --vfjs-ui-carousel-btn-size, --vfjs-ui-carousel-dot-size): on a container set their base variables (--vfjs-ui-scale-s, --vfjs-ui-scale-m, --vfjs-ui-scale-l, --vfjs-ui-font-size-s, --vfjs-ui-font-size-m, --vfjs-ui-font-size-l, --vfjs-ui-avatar-size-md …), or set the variable on the component itself. Popups, menus and dialogs placed in <body> take the values set on the page (:root), not those of the container of their component.
Default values: the theme variables are registered with @property (their initial value is the light theme), so they have a value on every element of the page. The variables of the library (--vfjs-ui-*) keep their defaults inside the stylesheet, at the place where they are used, so a variable that you did not set has no value on your elements:
- in your own CSS that uses a variable of the library, give it a fallback as the library does:
var(--vfjs-ui-field-bg, var(--vfjs-bg)), or use a theme variable directly; - from JavaScript, read the current value with
cssVar(element, '--vfjs-ui-font-size')(exported by the library; it also returns the default value the component computes);getComputedStyle(element).getPropertyValue()can return an empty string for a variable of the library that nobody set.
/* your own element in the colors of the component */
.my-summary { background: var(--vfjs-ui-field-bg, var(--vfjs-bg)); color: var(--vfjs-fg); }
const el = document.querySelector('#orders');
console.log(VibeFoxJSUi.cssVar(el, '--vfjs-ui-font-size')); // the value in use (also a default)
console.log(getComputedStyle(el).getPropertyValue('--vfjs-ui-font-size')); // can be '' unless you set it
If the CSS file of the library comes from another origin without CORS (a <link> without the crossorigin attribute), the browser does not let scripts read the stylesheet, and cssVar() returns an empty string for a variable without a value on the root of the component. From your own origin, or with that attribute, it works.
--vfjs-ui-sheet-ref has no value of its own: the library sets it on each formula reference of the Spreadsheet, from --vfjs-ui-sheet-ref-0 … --vfjs-ui-sheet-ref-7; change those. --vfjs-ui-ac-mark-fg and --vfjs-ui-md-link default to inherit (the color of the text around them), and cssVar() returns inherit.
The stylesheets are written with native CSS nesting; nothing changes for including them, and your own CSS can be written in any form.
Variants and sizes
Every component has the options variant ('filled', 'outline', 'ghost') and size ('s', 'm', 'l'; also 'sm', 'md', 'lg'). null (default) takes the look of the closest container, else the default look. Without JavaScript, set the attribute data-vfjs-ui-variant="outline" / data-vfjs-ui-size="s" (or the class vfjs-ui-variant-outline / vfjs-ui-size-s) on a container: every component inside follows; the component's own option wins. Popups (select lists, menus, dialogs, toasts) take the look of their component.
document.querySelector('#app').setAttribute('data-vfjs-ui-variant', 'outline'); // everything inside
const name = VibeFoxJSUi.createInput('#app', { label: 'Name' }); // outline
const go = VibeFoxJSUi.createButton('#app2', { label: 'Go', variant: 'ghost', size: 'l' });
Some components keep their own values too: Button 'primary', 'secondary', 'danger'; Card 'outlined', 'elevated'; Chip 'outlined'; Avatar and Spinner sizes 'xs', 'xl' or px. A size scales the control height (26 / 32 / 40 px at the default size unit), the font and the inner sizes.
Density and size
Set data-vfjs-density="compact", "normal" or "comfortable" on the page or on any container: heights and paddings of every VibeFox JS component inside follow. --vfjs-size-unit (default 1px) scales all sizes of a component at once, for example #orders { --vfjs-size-unit: 1.25px; }. Sizes you give as numbers in options are pixels and are not scaled.
Default height: when the element of Chat, AI Prompt, DockLayout, FileManager, Spreadsheet or ImageEditor has no height of its own, it gets the class vfjs-auto-height and exactly the default height of a variable: --vfjs-ui-chat-min-height (Chat and AI Prompt, 400 px), --vfjs-ui-dock-min-height (400 px), --vfjs-ui-fm-height (440 px), --vfjs-ui-sheet-height (420 px), --vfjs-ui-imged-height (520 px); all × --vfjs-size-unit; messages, files and rows scroll inside. An element with a height of its own (height, only a min-height, a flex item or a CSS Grid item, height: 100% of a parent with a height, absolute insets) gets the class vfjs-fit and is filled exactly, also when it is smaller; the content never makes it taller. With the variable at 0 (class vfjs-content-height) Chat, FileManager and Spreadsheet are as high as all their messages, files or rows, without scrolling of their own; DockLayout and ImageEditor take the height from the width (--vfjs-ui-dock-aspect-ratio, --vfjs-ui-imged-aspect-ratio; default: the token --vfjs-aspect-ratio, 2 / 1). The other components are as high as their content.
Your own CSS
All library rules are inside the cascade layer @layer vfjs, so your own CSS always wins without !important. The class names of VibeFox JS UI start with vfjs-ui- (modifier classes too, for example vfjs-ui-btn--pressed), so other CSS frameworks on the page do not restyle it.
.vfjs-ui-btn--primary { text-transform: uppercase; }
.vfjs-ui-btn--pressed { font-weight: 600; }
The library ships no font files. It uses the system font stacks of the tokens --vfjs-font, --vfjs-font-mono and --vfjs-font-serif; set them to your own fonts if you want. Animations follow prefers-reduced-motion, and colors follow forced-colors mode (Windows high contrast).
Localization and RTL
Languages
VibeFox JS UI comes with 14 interface languages. English (en) is built into the library file; each of the others is a language file of its own (dist/locales/vibefox-js-ui.<lang>.js in the package), and a page loads only the ones it uses: Russian (ru), Spanish (es), German (de), French (fr), Italian (it), Portuguese (Brazilian) (pt), Ukrainian (uk), Turkish (tr), Chinese (Simplified) (zh), Japanese (ja), Korean (ko), Hindi (hi) and Arabic (ar). The locale option sets the language of one component; setLocale(lang) sets the default language of the page, which every component without its own locale follows (it re-renders on a change).
VibeFoxJSUi.setLocale('ru'); // page default
const select = VibeFoxJSUi.createSelect('#app', { options: items, locale: 'en' }); // this select only
select.setOptions({ locale: 'de' });
The example above needs the files of the languages it uses. With script tags, load a language file after the library. The order matters: loaded first, the file adds no language and writes a warning to the console.
<link rel="stylesheet" href="vibefox-js-ui.css">
<script src="vibefox-js-ui.global.min.js"></script>
<script src="locales/vibefox-js-ui.ru.js"></script>
With npm or a bundler, import the language after the library. Without npm, an ES module page imports ./locales/vibefox-js-ui.ru.esm.js, which registers the language in vibefox-js-ui.esm.js.
import { createSelect } from '@vibefox/js-ui';
import '@vibefox/js-ui/locales/ru';
The .esm.js language file does not fit the minified build @vibefox/js-ui/min (it would load a second copy of the library). There, use the .json file:
import { createSelect, addLocale } from '@vibefox/js-ui/min';
import ru from '@vibefox/js-ui/locales/ru.json';
addLocale('ru', ru);
Without its file, locale: 'ru' shows English and writes one warning to the console.
Language codes: uk, ko, zh and pt are the real codes; ua and kr also work, as aliases of uk and ko. For each string the library tries the exact code, then the alias, the base language (pt-BR → pt, zh-CN → zh), English, and finally the key itself. normalizeLocale(code) returns the real code of an alias.
A language does not set the direction: with locale: 'ar', also set rtl: true or dir="rtl" on the container.
Adding a language
addLocale(lang, dictionary) adds strings to a language (and creates it): a language of your own, or your own wording over a language file. A missing key follows the chain above, so a partial dictionary works; addLocale('ua', …) fills uk. Add the dictionary before the components that use it are created, or switch the locale afterwards.
VibeFoxJSUi.addLocale('de', {
'ui.select.placeholder': 'Auswählen…',
'ui.select.empty': 'Nichts gefunden',
});
The keys of VibeFox JS UI start with ui. and the component (ui.select.placeholder, ui.date.prevMonth, ui.toast.close …; about 730 keys: placeholders, button names, screen reader texts, the menus of the large components). The language files list every key (locales/vibefox-js-ui.ru.json); the English texts are in the readable file vibefox-js-ui.esm.js. Placeholders in braces, such as {count}, are filled in by the library. t(key, params) translates a key in the page locale, select.t(key) in the component's locale; getLocale() returns the page locale, onLocaleChange(fn) reports changes.
Plural forms: a text with a number has the keys <key>.zero, .one, .two, .few, .many and .other (the categories of Intl.PluralRules); .other is the fallback, so your dictionary can give only that form. {count} and {n} are filled in. tPlural(key, count, params, lang) picks the form; the method select.tPlural(key, count, params) does it in the locale of the component.
VibeFoxJSUi.addLocale('de', {
'ui.upload.maxFiles.one': 'Bis zu {count} Datei',
'ui.upload.maxFiles.other': 'Bis zu {count} Dateien',
});
VibeFoxJSUi.tPlural('ui.upload.maxFiles', 5, {}, 'de'); // 'Bis zu 5 Dateien'
Date and time pickers take month and weekday names, the first day of the week and the 12 / 24-hour clock from the locale (Intl) unless you set firstDay, hour12 or format; Kanban and Chat format their dates with dateFormat / timeFormat; the spreadsheet takes the decimal separator and the currency of the locale.
Right-to-left
The option rtl: true lays the component out right-to-left (dir="rtl" on its element); rtl: false forces left-to-right; without it the component follows the page or its container (<html dir="rtl">). The arrow keys follow the reading order. isRtl(element) tells the direction of an element.
In VibeFox JS UI every component mirrors: arrows, menus and submenus, drawers, the slider and the carousel follow the reading direction, and the arrow keys follow it too. QR codes, barcodes, signatures and images are never mirrored.
Accessibility
The components follow the WAI-ARIA Authoring Practices and were audited against WCAG 2.2 AA: roles, names, states and announcements; keyboard access with one tab stop per composite (toolbars, tab lists, trees, grids, lists); visible focus; contrast of text, control borders and states in every theme and look; pointer targets of at least 24 × 24 px (--vfjs-ui-target-min × --vfjs-size-unit) in every size and density, size 's' with the compact density too: size s and compact keep their smaller fonts, paddings and icons, only boxes under 24 px grow (color swatches keep their size and get more space between them; the resize corners of a dialog have the window menu as an equivalent). Set --vfjs-ui-target-min smaller if you want denser controls. Focus is visible (the focus ring is the CSS variables --vfjs-focus-ring-color, --vfjs-focus-ring-width, --vfjs-focus-ring-offset, --vfjs-focus-ring-style); dialogs keep the focus inside and give it back when they close. The high-contrast and high-contrast-light themes, forced-colors mode and prefers-reduced-motion are supported.
Keyboard
The keys follow the usual patterns of each kind of component:
| Keys | Action |
|---|---|
| Tab, Shift+Tab | To the next / previous component (one stop per toolbar, tab list, tree, list, grid). |
| Arrows, Home, End | Inside a composite: tabs, menu items, toolbar buttons, tree rows, list options, calendar days, radio buttons, segments. |
| Enter, Space | Activate, select, toggle. |
| ↓, ↑, Enter, Space (select); ↓, Alt+↓ (autocomplete, pickers) | Open the list or the popup; Alt+↑ closes an autocomplete list. |
| Esc | Close a popup, menu, dialog or drawer and give the focus back. |
| PageUp, PageDown | Calendars: previous / next month (Shift: year). |
| Delete | Close a closable tab or dock panel, remove a chip or a list item where allowed. |
| Alt+↑, Alt+↓ (draggable list, transfer list) | Move the item up / down. |
| Shift+F10, Menu key | The context menu of the focused item; on anything that can be dragged, its "Move…" menu. |
| Alt+arrows (dock panel) | Move the panel to another zone. |
| Alt+Shift+arrows, Ctrl+Alt+Shift+arrows (window) | Move / resize the window. |
| Ctrl+K, Cmd+K | Command palette (option hotkey). |
| Ctrl+Z, Ctrl+Y | Undo / redo in Kanban, TileLayout, Spreadsheet, ImageEditor, SignaturePad. |
Drag and drop without dragging
Everything that can be dragged also has a "Move…" menu (WCAG 2.5.7) that lists the places it can go and the size steps. It opens with:
- a click or tap without moving on the drag handle (tile and column grips, splitter gutters, the column edge of the spreadsheet, the crop frame), or on the small "Move" handle of an item whose own click does something else (Kanban cards, list items, tabs, dock tabs; shown on hover and focus, always on touch screens);
- the window menu button at the start of a dialog header;
- the context menu of the item (right click, or a long press where the browser fires
contextmenu); - Shift+F10 or the Menu key on the focused item.
A pick does what a drop does: the same cancelable events with reason: 'menu' (Kanban cardMove / columnMove, TileLayout layoutChange), one undo step and an announcement; then the focus goes to the moved item, and Esc gives it back to the item. Inside a modal window the menu keeps the focus and lists the targets without submenus.
| Component | Menu |
|---|---|
| Kanban | Card: up, down, to the top, to the bottom, to another column or swimlane (full strict-WIP columns disabled). Column (its grip or header): left, right, to the start, to the end. |
| TileLayout | Move left / right / up / down; wider, narrower, taller, shorter (steps that change nothing are disabled). |
| DockLayout | Dock the panel left, top, center, bottom or right. |
ListView, ListBox (draggable, dragGroup) | Up, down, to the top, to the bottom, to every other list of the group; the selected items move together. moveMenu: false turns the menu and its handles off. |
Tabs (reorder) | Left, right, to the start, to the end. |
| Dialog | Move in steps, center, wider / narrower / taller / shorter. |
| Splitter, FileManager tree splitter | Back / forward in steps, to the start, to the end (a double click on a splitter gutter still collapses its pane). |
| Spreadsheet | Column edge: wider, narrower, default width. Sheet tabs: the handle opens the sheet menu (move left / right …). |
| ImageEditor | Crop frame: move and size steps; the selected shape: move steps. A click with a shape tool adds the shape in its default size; the freehand brush (like the signature pad) is a path by its nature. |
The handles are styled with --vfjs-ui-movebtn-size, --vfjs-ui-movebtn-fg, --vfjs-ui-movebtn-bg, --vfjs-ui-movebtn-hover-bg, --vfjs-ui-movebtn-hover-fg, --vfjs-ui-movebtn-radius and --vfjs-ui-movebtn-idle-opacity (1 shows them always). TransferList, Carousel, Slider and ColorPicker need no menu: their buttons, arrows and clicks on the track do the same.
Screen readers
Controls are named by the option label, or by a <label for="…"> of your page that points at the mount element (a click on it focuses the control). Form errors set aria-invalid and are linked with aria-describedby; toasts, results counts and moves are announced through one live region.
Most components have focus(). The library also exports the helpers it uses itself: announce(message), trapFocus, rovingFocus, setAria, prefersReducedMotion() and others (see API reference).
Using with other VibeFox JS libraries
VibeFox JS UI works on its own. Every VibeFox JS library is a separate file with its own copy of the shared core, and several libraries on one page work together without conflicts: one global variable per library (VibeFoxJSUi, VibeFoxJSCharts, …), class names with the library prefix, one page theme, the same events.
Connecting components with link()
link(source, event, target, method, transform) calls a method of one component whenever another emits an event; it returns a function that removes the link. connect(source, event, handler) subscribes and returns an unsubscribe function. bus is a page-wide event channel shared by all VibeFox JS libraries on the page.
// a query builder filters a table of VibeFox JS Grid (both files loaded on the page)
const unlink = VibeFoxJSUi.link(qb, 'filterChange', grid, 'setFilterModel', (e) => e.filterModel);
VibeFoxJSUi.bus.emit('filters:changed', { at: Date.now() }); // any library can listen: VibeFoxJSGrid.bus.on('filters:changed', fn)
What uses another library when it is on the page
- Dashboards of VibeFox JS Charts: when both files are on the page,
layout: { engine: 'tiles' }of a chart dashboard uses the TileLayout of VibeFox JS UI (tiles users drag and resize). - The QueryBuilder model is the filter model of VibeFox JS Grid:
setFilterModel()of a grid takes it as it is. - Every component of VibeFox JS UI works on its own; the Spreadsheet has its own formula engine and Excel files, no other library is needed.
AI tools
The library describes its main actions as tools for function calling with a language model. It never calls a model or a service itself: you send the descriptions to your model and run the calls it asks for.
| Tool | What it does |
|---|---|
sheet_list | The sheets and the selection of a Spreadsheet. |
sheet_get_range | Values (or formulas) of a range. |
sheet_set_range | Writes values and formulas (one undo step). |
sheet_format_range | Formats a range. |
sheet_manage | Adds, renames, removes or shows sheets. |
const { describeTools, callTool, createToolKit } = VibeFoxJSUi;
const sheet = VibeFoxJSUi.createSpreadsheet('#app', { data: { sheets: [{ name: 'Sales', rows: [['Month', 'Units'], ['Jan', 10]] }] } });
const tools = describeTools(sheet, { format: 'openai' }); // 'plain' / 'anthropic', 'openai', 'webmcp'
const result = await callTool(sheet, 'sheet_get_range', { range: 'A1:D3' }); // { ok: true, result } or { ok: false, error }
const kit = createToolKit({ budget: sheet }); // tool names get the prefix 'budget_'
const answer = await kit.ask('Add a total row under the units', {
format: 'anthropic',
model: async (request) => (await fetch('/api/llm', { method: 'POST', body: JSON.stringify(request.body) })).json(),
});
callTool checks the arguments against the tool schema before it runs and never throws for bad input. createToolKit(components, { webmcp, readOnly }) joins the tools of several components (also of other VibeFox JS libraries) under unique names; kit.ask(prompt, { model, format, system, maxSteps, signal, onToolCall }) runs the loop "model → tool calls → results" with your model function; kit.registerWebMCP() registers the tools in the browser's navigator.modelContext where available. registerTools(target, provider) adds your own tools; validateSchema(value, schema) is the schema check.
The Spreadsheet is the component of VibeFox JS UI with tools; the AI Prompt and Chat components show the conversation with your model (see Chat and AI Prompt).
API reference
Components
| Group | Factories (class = VibeFoxJS<Name>) |
|---|---|
| Buttons | createButton, createButtonGroup, createSplitButton |
| Form controls | createInput, createNumberInput, createSelect, createAutoComplete, createCheckbox, createSwitch, createRadioGroup, createSegmented, createSlider, createRating, createOTPInput |
| Pickers | createDatePicker, createTimePicker, createDateTimePicker, createColorPicker |
| Lists | createListView, createListBox, createTransferList, createTree |
| Forms and files | createForm, createFileUpload, createQueryBuilder |
| Navigation | createTabs, createAccordion, createMenu, createToolbar, createBreadcrumb, createPagination, createStepper, createWizard, createCommandPalette |
| Overlays | createDialog, createDrawer, createToast, createTooltip, createPopover, createTour |
| Layout | createSplitter, createDockLayout, createTileLayout |
| Data display | createCard, createAvatar, createAvatarGroup, createChip, createChipGroup, createBadge, createProgressBar, createSpinner, createSkeleton, createCarousel |
| Large components | createKanban, createChat, createAIPrompt, createFileManager, createSpreadsheet, createImageEditor, createSignaturePad, createQRCode, createBarcode |
Helpers: applyMask, encodeBarcode, listIcons, createMemoryFileAdapter, ensureUiStyles, VERSION. The options, methods and events of each component are listed in its section above.
Shared core (the same in every VibeFox JS library): setTheme, getTheme, registerTheme, themes, tokens, componentTokens, densities, cssVar, cssColor, cssLength, observeTokens, setLocale, getLocale, addLocale, normalizeLocale, t, tPlural, withLocale, onLocaleChange, link, connect, bus, Emitter, VibeFoxJSComponent, factory, toCSV, downloadFile, downloadCanvasPNG, createXlsx, readXlsx, XLSX_MIME, describeTools, callTool, createToolKit, registerTools, validateSchema, announce, trapFocus, rovingFocus, getFocusable, focusFirst, saveFocus, setAria, ensureId, addAriaRef, removeAriaRef, isRtl, mirrorArrow, prefersReducedMotion, prefersHighContrast, motionDuration, onPreferenceChange, injectStyles, ensureBaseStyles, formatNumber, formatDate, escapeHtml, createEl, deepMerge, isPlainObject, getPath, setPath, uid, clamp, debounce, throttle.
Common options
Also every VibeFox JS component accepts theme, locale, rtl and on (see Core concepts).
| Option | Type | Default | Description |
|---|---|---|---|
variant | 'filled' | 'outline' | 'ghost' (and own values) | null | Look; null = the container's or the default. |
size | 's' | 'm' | 'l' | null | Size; null = the container's or 'm'. |
label | string or null | null | Accessible name of a control. |
disabled | boolean | false | Inactive. |
name | string or null | null | Form field name (form-associated controls). |
required | boolean | false | Part of the form validation (not Slider: it always has a value). |
readonly | boolean | false | Shown, not editable (pickers, rating, OTP, autocomplete, query builder, signature, file manager). |
Common methods and events
| Method | Returns | Description |
|---|---|---|
setOptions, setOption, getOption, getState, setState, setTheme, on, once, off, use, t, destroy | — | Every component. |
getValue, setValue | value / this | Value components. |
checkValidity, reportValidity, getValidationMessage, reset, focus | boolean / string / this | Form-associated controls. |
open, close, isOpen | this / boolean | Popups, pickers, menus, dialogs, drawers, palette. |
| Event | Payload | Description |
|---|---|---|
ready, dataChange, optionsChange, themeChange, destroy | see Core concepts | Every component. |
valueChange | { value, … } ({ checked } for check boxes and switches) | The value changed. |
open, close | {} | A popup opened / closed. |
validate | { valid, message } | Validation of a form-associated control. |
The TypeScript declarations (vibefox-js-ui.d.ts) describe every option, payload and return type in detail: SelectOptions, DialogOptions, KanbanOptions, ChatOptions, FileAdapter, QueryGroup, SpreadsheetOptions, ImageEditDoc, BarcodeOptions and the others.
Troubleshooting
No styles
Link vibefox-js-ui.css next to the script. Without it the component works but is unstyled, and the console shows one warning "VibeFox JS stylesheet is not loaded". In a bundler, import @vibefox/js-ui/css. The framework wrappers do not add the CSS for you.
My CSS does not apply, or a page CSS framework changes the component
Your rules win over the library rules without !important because the library CSS is in @layer vfjs. If they still do not apply, check the class names: they all have the library prefix (vfjs-ui-btn--primary, not btn-primary). The library never uses generic class names, so page CSS frameworks do not change it.
ES modules do not load from disk
Browsers load <script type="module"> only over http(s). Use a local web server, or use vibefox-js-ui.global.js, which also works from file://.
Content Security Policy
The library does not use eval or inline scripts and loads nothing from the network. It sets inline styles on its elements (sizes and positions), so a policy with style-src must allow them ('unsafe-inline' for style attributes). Uploads, autocomplete sources, file manager adapters and AI requests are your own requests (connect-src); avatars, card media and image editor sources need img-src (also blob: / data: for local files and exports).
A dialog, toast or menu does not appear where the mount element is
Dialog, Drawer, Toast, Menu, CommandPalette and Tour put their layer into <body>. Mount them on document.body (or 'body', document), which they leave as it is, or on an empty element of their own: that element is hidden while the component lives. Do not mount them on a container with other content — it would be hidden too.
A control has no accessible name
Give the option label, or a <label for="id"> whose for is the id of the mount element.
The value is not submitted with my form
Give the control a name (a createForm field passes its name to its control). Disabled controls and empty values (except Input) are not submitted; Checkbox and Switch send their value only while checked; ButtonGroup needs selection to have a value.
Variable heights in a virtual list
Virtual lists (ListView, AutoComplete, TransferList, FileManager) need rows of equal height. With multi-line templates set virtual: false.
Copy and paste do not work
The browser gives clipboard access only on secure pages (https or localhost) and after a user action.
Limitations
- Forms: DatePicker
min/maxare not part of the validation (a date outside them cannot be picked, but one set by code is not reported); a ChipGroup withselection: 'none'submits nothing. Move menus by long press: iOS Safari fires nocontextmenu, the visible handles are the way there. - A container's
variantis read when a component is created or its look options change (a container'ssizeworks live). - Virtual lists need rows of equal height. ListView drag and drop on touch screens competes with scrolling (use the move menu or Alt+arrows). The time lists step by whole minutes; the color picker eyedropper works only where the browser offers one.
inlineof DatePicker, DateTimePicker and ColorPicker is fixed at creation; Stepper panels are rendered at creation and onsetOptions({ steps }); a Toolbarcustomitem renders again on every re-render.- TileLayout: no auto-scroll of the page while dragging near the window edge; the size limits of a tile are the same for every number of columns. QueryBuilder: conditions are not dragged.
- Kanban: no multi-card drag; column widths are fixed. Chat: no built-in edit / delete UI for messages (API only); a fixed emoji list for reactions; Markdown without nested lists, images or HTML; Retry only for the last answer.
- FileManager: tree nodes cannot be dragged or renamed; no system clipboard; dropping folders from the system needs browser support; several downloads at once may be blocked by the browser.
- ImageEditor: no pinch zoom; filters run on the main thread (a very large export can take a second or two); no layers.
- Spreadsheet: no insert / delete of rows and columns, merged cells, borders, fonts, wrapping, frozen panes, fill handle, sort / filter or charts; English function names only; the .xlsx import reads values and formulas without styles or merges.
- Framework wrappers: functions in options are compared by reference; removing a prop does not reset the option to its default; Vue watches object props shallowly.
