40 live examples

Examples

Small, complete apps. Every one below is running right now: click around, then read the source or open it in the playground to change it.

Live
CounterBasics

The smallest Keeno app: a state, two derived values and a few buttons.

state()derived()
Live

A grouped shopping list kept in one store(): mutate nested items directly, bind inputs to them, snapshot it.

store()bind:value on a store
Live
Todo listBasics

Keyed lists, two-way binding, a child component and persistence to localStorage.

keyed listsbind:valuepersist
Live
AccordionBasics

An FAQ that opens one panel at a time, or several, animated with CSS grid rows.

class objectsbind:checked
Live

Number and range inputs bound to states, with totals derived from them.

bind:valuevalidate
Live

A character limit ring, hashtags and a feed, all derived from one textarea.

derived()SVG attributes
Live

Reorder rows by dragging or with the keyboard; keyed rows move and keep their DOM.

keyed lists
Live

One source of truth, with a validated state and values derived from it.

validatederived()
Live

A drawing grid with undo and redo, built on the history option of a state.

historyinit()
Live

Filter a list as you type, searching once typing pauses.

debounceupdate()
Live

Field errors, a password strength meter and touched state, all as derived values.

derived()bind:checked
Live

Quantities, a promo code and free-shipping threshold, persisted across reloads.

persistderived()
Live

A settings form that knows which fields differ from what was saved, compared by value.

deepEqualequals
Live

The same pointer position written to three states, to see how each option paces writes.

throttleonUpdate()
Live

A multi-step form with per-step validation, a progress bar and a summary.

conditionalsvalidate
Live

The board is one state; the winner, the turn and time travel all come from it.

historyderived()
Live
StopwatchComponents

requestAnimationFrame-driven timing with laps, cleaned up on destroy.

destroy()peek()
Live
SVG clockComponents

An analog clock: SVG markup with reactive attributes, ticking from an interval.

SVGinit() cleanup
Live
Theme contextComponents

Provide a state once and read it anywhere below, without passing props down.

provide()inject()
Live
Star ratingComponents

A reusable component with default props, a callback and half-star display.

props()prop defaults
Live
AutocompleteComponents

A multi-select combobox with keyboard navigation and an element ref for focus.

ref()update()
Live
Infinite scrollComponents

Load the next page when a sentinel scrolls into view, with an IntersectionObserver.

ref()init() cleanup
Live
Game of LifeComponents

Conway’s cellular automaton, with a timer that restarts when the speed changes.

update(fn, deps)peek()
Live
Memory gameComponents

Flip cards to find pairs, with a move counter, a timer and a persisted best score.

init()persist
Live
Dynamic tabsBuilt-ins

Switch between components with <Dynamic>; each tab mounts and unmounts.

<Dynamic>
Live
Async dataBuilt-ins

Loading, success and error states of a request with <Await>.

<Await>
Live
Async derivedBuilt-ins

An async derived inside <Loading>: refetches when its inputs change, keeps the old card while refreshing.

async derived<Loading>pending()
Live

Likes show at once and save in the background with the save option; a failed save rolls back and reports to an error boundary.

savepending()<ErrorBoundary>
Live
Virtual listBuilt-ins

100 000 rows that scroll smoothly: <Virtual> only renders the rows in view, with filtering and jump-to-row.

<Virtual>scrollTo()
Live
Document headBuilt-ins

A reactive tab title and meta description from inside a component, restored when it unmounts.

<Head>
Live
DirectivesBuilt-ins

Reusable DOM behaviors with use: — a reactive tooltip, click-outside, autosize, autofocus and an in-view observer.

use: directivesDirective type
Live

Catch an error thrown while rendering, show a fallback, and reset.

<ErrorBoundary>
Live
ToastsBuilt-ins

Notifications that animate in and out of a keyed list.

<Transition>
Live
Modal dialogBuilt-ins

A dialog rendered into <body> with a portal, with enter and leave transitions.

<Portal>children
Live
Kanban boardBuilt-ins

Cards that keep their state (notes, running timers) as they move between columns.

keyedReparentable()
Live
Lazy loadingBuilt-ins

A component fetched on first render, preloaded on hover, with retry after a failed load.

lazy()<ErrorBoundary>
Live

A player that moves between layouts and keeps playing, created once with reparentable().

reparentable()
Live

Utility classes in markup, with class arrays for conditional styles.

Tailwind CSSclass arrays
Live

States written into CSS custom properties, with every color derived in scoped CSS.

scoped CSSstyle bindings
Live

Stat cards and a bar chart with hover details, styled with Tailwind utilities.

Tailwind CSSclass arrays

Have an idea?
Build it in the browser.

Start from any example above, or from a blank file. No install, no setup.