Segmented control toggle. Pass options as a comma-separated string or array. Fires o-change with { value, index }.
Selected: Day — change the toggle above to see this update live.
<o-toggle options="Day,Week,Month" value="day"></o-toggle>
// Or set via JS
toggle.options = [{ label: 'Day', value: 'day' }, { label: 'Week', value: 'week' }]
toggle.value = 'week'
// Event
toggle.addEventListener('o-change', e => console.log(e.detail)) // { value, index, prev }
o-toggle — as a tab switcher
Use o-toggle to drive tab content — swap any panel based on the selected value.
Overview
Open Web Components is a glassmorphic web component library. Drop in one script tag and get beautiful, zero-dependency UI components that work in any framework.
API reference
Components expose attributes (move, resize, snap) and fire custom DOM events (o-click, o-change, o-input, o-results, o-select, o-sort, o-row-select).
Examples
See the full interactive demos on this page. Each section has copy-ready code snippets. Press ? for keyboard shortcuts.
o-table
Sortable, resizable, glassmorphic data table. Supports column persistence and optional row selection.
editable="always" renders inline inputs. editable="click" opens a form row below the original with label:input pairs. Press ✏️ to edit, ✓ to confirm, ✗ to cancel.
Glass-styled note component. variant="textarea" (default) auto-resizes with optional floating label and char counter. variant="card" adds a title and tag chips.
Glassmorphism form dialog with blurred backdrop, slot-based content, and programmatic open/close. Fires o-submit with named input values and o-cancel on backdrop click or Escape.
Glassmorphic tab bar. Add slot="tab" children with data-value for the tab headers, and data-tab on panel elements for content. Fires o-change with { value, prev }. Arrow-key navigable.
OverviewInstallationEventsTheming
Open Web Components
A glassmorphic web component library — zero dependencies, one script tag. All components are built with native Custom Elements and Shadow DOM, making them compatible with any framework or plain HTML.
CSS custom properties
All components inherit from GlassElement and use CSS variables: --glass-bg, --glass-border, --glass-blur, --glass-shadow, --glass-text, --glass-hover, --accent-warm. Override on :root or any ancestor to apply a custom theme.
Glassmorphic text input with optional static label and validation states. Fires o-input on every keystroke and o-change on blur.
Default
Error state
Success state
Disabled
<o-input label="Name" placeholder="Alice"></o-input>
<o-input label="Email" error="Invalid email"></o-input>
<o-input label="User" success></o-input>
<o-input label="Key" disabled></o-input>
input.addEventListener('o-input', e => console.log(e.detail)) // { value }
input.addEventListener('o-change', e => console.log(e.detail)) // { value }
o-skeleton
Pulsing glassmorphic placeholder for loading states. Three variants: block (default), table (matches o-table), and panel (matches o-panel). Swap in wherever content is loading.
Fixed top-of-page loading bar. Use the static API or set the value attribute (0–100). OProgress.done() or value="100" animates to full then fades out automatically.
StartSet 50%Set 75%Done
Value attribute (drag to set)
0%
<o-progress></o-progress>
// Static API (works without a JS reference)
OProgress.start() // auto-increments slowly
OProgress.set(60) // jump to 60%
OProgress.done() // shoot to 100% then fade out
// Attribute API
document.querySelector('o-progress').setAttribute('value', '75')
asyncPlus
asyncPlus(...promises) wraps multiple promises and automatically drives the progress bar — starts on the first call, increments as each settles, completes when all are done. Fires a progress-complete event on document.
Simulate parallel requests
3 requests5 requests8 requests (1 fails)
// Auto-drives OProgress for any set of promises
const results = await asyncPlus(
fetch('/api/users'),
fetch('/api/posts'),
fetch('/api/comments')
)
// results: PromiseSettledResult[] — never rejects
// Fires when all settle
document.addEventListener('progress-complete', e => {
console.log(e.detail.results)
})
Search + Table + Pagination
Live example combining o-search, o-table (selectable), o-toggle for pages + page size, and o-button for prev/next.