SolariDisplay - A Split-Flap Display with CSS and JavaScript

Library to create a Split-Flap Display, or Solari Board, with CSS 3D transforms. Each flap goes through its values in order until it shows the one it was given, as the real ones do.

You can read the blog post here: Split-flap display with CSS and JavaScript.

Demos

Move the pointer around to turn the board.

Single-digit clock

2026 update

Disclaimer: this library is from 2012. Browsers still have nothing like it built in, and it’s small, so it’s still a way to make one

It had stopped looking right: the perspective was written without a unit, -webkit-perspective: 400, which browsers don’t accept anymore, so the board had no depth and the flaps were drawn flat and skewed. It has been updated. What changed:

Using the code

Copy src/SolariBoard.js and src/SolariBoard.css, include the CSS, and import the module:

<link href="SolariBoard.css" rel="stylesheet">
import { SolariBoard, SOLARI_VALUES } from './SolariBoard.js';

The display needs a container inside an element with the class displayBase, which gives it the perspective:

<div id="viewport" class="displayBase">
	<div id="container"></div>
</div>
#viewport, #container { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
#container { font-family: sans-serif; }

The board is centred in the container. Then create it, and give it something to show:

const display = new SolariBoard( {
	container: document.getElementById( 'container' ),
	format: Array( 11 ).fill( SOLARI_VALUES.letter ),
	segmentWidth: 70,
	segmentHeight: 120,
	fontSize: 100
} );

display.setContent( 'HELLO WORLD' );

The options are:

setContent() takes a string, or a list with a value for each flap. A flap whose value is missing, or isn’t one of its values, goes to its first value, which is the space for letters:

display.setContent( [ '18', ':', '28', ':', '39' ] );

dispose() stops it and removes it from the page.

To turn the board, set a 3D transform on the container, like the examples do in examples/tilt.js.

License

MIT licensed

Copyright (C) 2012 Jaume Sanchez Elias, http://www.clicktorelease.com