basic-web-components
Small self-registering web components with native slots. One page per component: a live example plus the full README reference.
Accordion
bwc-accordion
Collapsible sections built on native details elements.
Live example
One
Two
<bwc-accordion default-value='["two"]'>
<details slot="item" data-value="one">
<summary>One</summary>
<div>One content</div>
</details>
<details slot="item" data-value="two">
<summary>Two</summary>
<div>Two content</div>
</details>
</bwc-accordion>Modal
bwc-modal
Dialog overlay with modal focus and backdrop dismissal.
Live example
<bwc-modal>
<button slot="trigger">Open dialog</button>
<dialog slot="popup">
<header data-modal-header>
<h2 data-title>Confirm changes?</h2>
<button data-close title="Close">×</button>
</header>
<div data-modal-content>
<p data-description>Backdrop click or Escape also closes.</p>
</div>
<div data-modal-actions>
<button data-close>Cancel</button>
<button data-action data-close>Confirm</button>
</div>
</dialog>
</bwc-modal>Popover
bwc-popover
Non-modal floating panel on the native popover API.
Live example
Popover content
<div>
<bwc-popover side="bottom" side-offset="8">
<button slot="trigger">Options</button>
<div slot="popup">
<p>Popover content</p>
<button data-close>Close</button>
</div>
</bwc-popover>
</div>Tooltip
bwc-tooltip
Non-modal hover tooltip with open/close delays.
Live example
<div>
<bwc-tooltip side="top" align="center" side-offset="8" delay="300" close-delay="150" close-on-click="false">
<button slot="trigger">Save</button>
<div slot="popup">Saves the current file<span data-arrow></span></div>
</bwc-tooltip>
</div>Preview card
bwc-preview-card
Link preview card that opens on hover or focus.
Live example
<div>
<bwc-preview-card side="bottom" align="start" side-offset="8" delay="300" close-delay="150">
<a slot="trigger" href="./popover.html">Popover docs</a>
<div slot="popup">Floating panels without focus traps.<span data-arrow></span></div>
</bwc-preview-card>
</div>Menu
bwc-menu
Floating action menu anchored to a trigger button.
Live example
Context menu
bwc-context-menu
Floating menu that opens on right-click, anchored at the pointer.
Live example
Select
bwc-select
Single-value select with a floating listbox and form participation.
Live example
<div>
<bwc-select placeholder="Pick a fruit" side="bottom" align="start" side-offset="8" match-trigger-width>
<button slot="trigger"><span data-value></span> <span data-icon>▾</span></button>
<div slot="popup">
<div data-option data-value="apple">Apple</div>
<div data-option data-value="banana">Banana</div>
<div data-option data-value="cherry" data-disabled>Cherry</div>
<span data-arrow></span>
</div>
</bwc-select>
</div>Switch
bwc-switch
On/off toggle with native form participation.
Live example
<div>
<label for="demo-switch-button">Notifications</label>
<bwc-switch default-checked></bwc-switch>
</div>OTP
bwc-otp
One-time-code input with generated fields and a hidden form input.
Live example
<bwc-otp length="4" validation-type="numeric" name="demo-code"></bwc-otp>Tabs
bwc-tabs
Tabbed interface with matched panels, one visible at a time.
Live example
<bwc-tabs default-value="one">
<div slot="list">
<button value="one">One</button>
<button value="two">Two</button>
</div>
<section slot="panel" data-value="one">One panel</section>
<section slot="panel" data-value="two">Two panel</section>
</bwc-tabs>Slide-out
bwc-slide-out
Non-modal drawer panel with overlay dismissal and focus management.
Live example
<bwc-slide-out>
<button slot="trigger">Open panel</button>
<nav slot="panel">
<a href="./accordion.html">Accordion</a>
<button data-close>Close</button>
</nav>
</bwc-slide-out>Alert dialog
bwc-alert-dialog
Confirmation dialog with modal backdrop and focus management.
Live example
Discard draft?
You can't undo this action.
<bwc-alert-dialog>
<button slot="trigger">Discard draft</button>
<div slot="popup">
<header data-alert-header>
<h2 data-title>Discard draft?</h2>
<button data-close title="Close">×</button>
</header>
<div data-alert-content>
<p data-description>You can't undo this action.</p>
</div>
<div data-alert-actions>
<button data-cancel>Cancel</button>
<button data-action>Discard</button>
</div>
</div>
</bwc-alert-dialog>Toast
bwc-toast-region
Toast notifications with auto-dismiss, limits, and types.
Live example
<div>
<bwc-toast-region position="bottom-right" limit="3" duration="5000">
<bwc-toast type="success" default-open>
<header data-toast-header>
<div data-title>Saved</div>
<button data-close title="Close">×</button>
</header>
<div data-description>Your changes are live.</div>
</bwc-toast>
</bwc-toast-region>
</div>Menubar
bwc-menubar
Coordinated menu bar with hover switching and a single-open invariant.
Live example
Navigation menu
bwc-navigation-menu
Site navigation with hover-driven content panels and delays.
Live example