0.5.0 is the first element quality release, covering every A, B and C element. Components rebuild cleanly when moved or re-populated, keyboard and screen-reader access is fixed across the C components, and several XSS paths are closed. Themes gain a --btn-border-width hook,…
VB's client-side storage API: namespaced, async, timestamped values with expiry. Available as window.VB.store and as a named export.
VBStore is the storage layer VB's own components use for preferences and dismissals. Values are namespaced, wrapped with a timestamp so they can expire, and read and written through an async API so the backend can change without touching callers.
Getting it
Global or import
// Any page that loads Vanilla BreezeawaitVB.store.set('my-app', 'tour-seen', true);// Or as a moduleimport { VBStore } from'vanilla-breeze/js'; // also exported by core-jsconst seen = awaitVBStore.get('my-app', 'tour-seen');
Every bundled copy shares one store, so values written through VB.store are the ones components read.
API
Method
Returns
Notes
set(namespace, key, value)
Promise<void>
Stores any JSON-serializable value with the current time.
get(namespace, key, { maxAge }?)
Promise<value | null>
null if missing, unreadable, or older than maxAge milliseconds.
remove(namespace, key)
Promise<void>
Deletes one entry.
list(namespace)
Promise<{ key, data, timestamp }[]>
Every readable entry in the namespace.
setMany(namespace, [[key, value], …])
Promise<void>
Several set calls in one.
clear(namespace)
Promise<void>
Removes one namespace.
clearAll()
Promise<void>
Removes every vb:* key and leaves the rest of storage alone.
configure({ backend })
—
Swap the backend (see below). null restores the default.
Namespace and key must be non-empty strings; anything else throws a TypeError.
Storage format
The default backend is localStorage. An entry is stored under vb:{namespace}:{key} as JSON:
Writes are not caught: if storage is full or blocked, set rejects with the browser's error. If localStorage doesn't exist at all, the first call throws.
Namespaces VB uses
Namespace
Written by
theme
Theme manager (theme, mode, accent and other appearance choices)