LivingBlocks · v0.7.1 · MIT

Components as data.

A carousel, an accordion or a ring, written as data: layers with roles, the parts its behavior needs, its settings. Any design draws it in its own style; a small runtime makes it work, with a keyboard and a screen reader. Free for everyone.

npm install livingblocks
  • 14.7 KB runtime, gzipped
  • 0 dependencies
  • 10 behaviors
  • 20 Blocks

Picture 1

A line about this picture.

Picture 2

A line about this picture.

Picture 3

A line about this picture.

This carousel is a Block. Swipe it, or use its arrows.

The idea

Layers in, working out.

A Block is layers you already know: stacks, text, buttons, pictures. A few are marked as the parts its behavior needs, and its colors and type are roles. Point at a layer to find it; switch to Code for the file.

The FAQ list: its layers, and the Block working.

Question 1

+

The answer to question 1, in a sentence or two.

Question 2

+

The answer to question 2, in a sentence or two.

Question 3

+

The answer to question 3, in a sentence or two.

Question 4

+

The answer to question 4, in a sentence or two.

Every behavior

Ten behaviors, every setting.

Each shown with one of the package’s Blocks. Change a setting and watch it change; no control offers a value a Block cannot hold. Code shows what the page carries.

Swipe, use the arrows, or the arrow keys when it has focus.

Product 1

€49

Product 2

€49

Product 3

€49

Product 4

€49

Product 5

€49

Product 6

€49

Settings Products

Roles, not colors

Lands in any design.

A Block names its colors and type by role: the accent, the surface, the ink, the heading. Pick a design: the same three Blocks take its look, still working, and only its roles change.

A banner, quotes and questions, in the Studio design.

Our opening hours change this week. See the new times before you visit.

×

The calmest hour of my week. I leave lighter every time.

Person 1

Member since 2024

The calmest hour of my week. I leave lighter every time.

Person 2

Member since 2024

The calmest hour of my week. I leave lighter every time.

Person 3

Member since 2024

Question 1

+

The answer to question 1, in a sentence or two.

Question 2

+

The answer to question 2, in a sentence or two.

Question 3

+

The answer to question 3, in a sentence or two.

Question 4

+

The answer to question 4, in a sentence or two.

Built in, not added

Works for everyone.

The runtime owns the behavior, so whoever draws a Block cannot leave out the keyboard or the screen reader. Use these two and read what a screen reader is told.

A carousel and questions: use them with the keyboard.

Picture 1

A line about this picture.

Picture 2

A line about this picture.

Picture 3

A line about this picture.

Section 1

+

What a buyer should know about section 1.

Section 2

+

What a buyer should know about section 2.

Section 3

+

What a buyer should know about section 3.

Section 4

+

What a buyer should know about section 4.

Safe to share

Data, never code.

What a Block does comes from a fixed, reviewed set of behaviors, so anyone’s Block is safe to run. Try to break one: the package’s own checker refuses it and says why, and nothing it refuses is drawn.

Try to break a notice.

Checking…

    Want to add a Block? How to contribute one.

    Made with LivingBlocks

    Running on real pages.

    Install

    On your page in a minute.

    1. Add the runtime

    npm install livingblocks

    Or as a plain script, then start it on the page:

    <script src="https://cdn.jsdelivr.net/npm/livingblocks@0.7/dist/livingblocks.min.js"></script>
    <script>LivingBlocks.start(document.body)</script>

    A table or a chart: add their add-on after the runtime, on the pages that hold one:

    <script src="https://cdn.jsdelivr.net/npm/livingblocks@0.7/dist/livingblocks.dashboard.min.js"></script>

    2. Mark the parts

    The Block’s own element carries its settings; the elements its behavior needs carry their part:

    <section data-living='{"kind": "accordion", "v": 1, "settings": {"single": true, "start": 0}}'>
      <div data-living-part="item">
        <button data-living-part="header">Do you ship abroad?</button>
        <div data-living-part="panel">Everywhere in Europe.</div>
      </div>
      <!-- …more items -->
    </section>

    3. Change it at a breakpoint

    Settings for a smaller window go in data-living-at, applied in order as the page’s CSS cascades:

    <section data-living='{"kind": "carousel", "v": 1, "settings": {"perView": 3}}'
      data-living-at='[{"query": "(max-width: 809px)", "settings": {"perView": 1}}]'>
      …
    </section>

    For a design tool, or a store of Blocks

    The ES module has every Block, the checker and the types: draw a Block in your own style, or check one someone sent you before you keep it.

    import { BLOCKS, blockById, validateBlock } from 'livingblocks';
    
    const faq = blockById('faq');          // a Block: layers, roles, parts, settings
    validateBlock(JSON.parse(submitted));  // { ok, errors: ['settings.delay: a number from 0 to 60', …] }

    Every field is in the schema, each setting’s range in the checker, and the parts each behavior needs in the README.

    Good to know

    Before you build on it.

    • Still 0.x. The format may change before 1.0. Each Block carries its format’s version, and a reader refuses one it does not know rather than guess.
    • Reduced motion. Slides, rings and notices change at once; nothing spins or glides.
    • Keyboard and screen readers. Arrow keys, Enter, Space and Escape where each behavior needs them; a carousel’s slides announced politely, sections with their state, notices read without taking the focus.
    • A notice is not a cookie banner. With remember it stays away for that visitor until its words change; it does not record consent.
    • Credits. The ring follows Codrops’ On-Scroll 3D Carousel and the cylinder their 3D Text Animation on Scroll (MIT); both rebuilt without other libraries, their notices in the package.
    • License. MIT, © 2026 uxspot.io. Use it in any project, commercial ones included.

    Free, and open.

    I built LivingBlocks so the components people place in uxdeck keep working on the sites they publish, then opened it, Blocks and checker included. Use it in your code, or place the same Blocks in uxdeck without writing any.