Skip to content
Eskais UI

Signs

LED Matrix

A bus or pharmacy dot-matrix sign: round LEDs behind smoked glass in an aluminium housing, in amber, red, green or white. Messages scroll right to left a dot at a time, or hold a page at a time, in turn, drawn from its own 5×7 bitmap font for Latin-1 and €. A canvas paints only when a dot changes, only on screen and in a visible tab; reduced motion pages instead of scrolling. A marquee live region with the message, a pause toggle, and setMessages, pause and resume for agents.

Example

Pharmacy on duty: 12 Harbour Street

Installation

npx shadcn@latest add @eskais/led-matrix
npm packageslucide-react

Usage

Import
import { LedMatrix, ledMatrixLabels } from "@/components/ui/led-matrix"import { ledMatrix } from "@/components/ui/led-matrix-primitive"import { createLedMatrixEngine, ledPalettes } from "@/components/ui/led-matrix-engine"import { glyphColumns, glyphOf, glyphRows, hasGlyph, pagesOf, textColumns } from "@/components/ui/led-matrix-font"import { ledMatrixGlyphData } from "@/components/ui/led-matrix-glyphs"import { useLedMatrixScene } from "@/components/ui/use-led-matrix-scene"

Reach for it where a notice should feel like a sign in the street: the next turn, a pharmacy on duty, departures. For a status a person must act on, use an Alert or a toast.

API reference

LedMatrix

PropTypeDefault
labelrequiredThe sign's accessible name: "Next departures", "Pharmacy".string–
colorThe colour of the lit dots. Default `amber`.LedColor"amber"
mode`scroll` (the default) runs each message right to left; `hold` shows it still, a page at a time.LedMatrixMode"scroll"
speedScroll speed in dots per second. Default 24.number24
holdMsHow long a held message or page stays, in ms. Default 3000.number3000
columnsDots across. Default 96.number96
rowsDots down. Default 9; 14 or more doubles the 5×7 glyphs.number9
controlsShows the pause toggle, which motion that starts by itself needs. Default true.booleantrue
labelsPartial<LedMatrixLabels>–
classNameClasses for the housing; a function gets the sign's state.StateClassName<LedMatrixState>–
onPaintCalled with each canvas paint's duration in ms, for measuring.(milliseconds: number) => void–

Also takes LedMatrixOptions.

Other exports

ledMatrixLabelsledMatrixcreateLedMatrixEngineledPalettesglyphColumnsglyphOfglyphRowshasGlyphpagesOftextColumnsledMatrixGlyphDatauseLedMatrixScenetype LedColortype LedMatrixLabelstype LedMatrixModetype LedMatrixPropstype LedMatrixStatetype LedMatrixChangeReasontype LedMatrixOptionstype LedMatrixHandlerstype LedMatrixSettings

Accessibility

  • The sign is a marquee named by its label, holding the current message as text; it stays quiet unless live is polite, which reads each new message once.
  • Motion that starts by itself has a pause toggle, named Pause and overridable, with a 44px touch target.
  • Under reduced motion a scrolling sign shows its messages a page at a time, split at words.

Agent actions

Agents find it by its label and call setMessages (a list, or one string), pause and resume; messages with no text fail the step with why.

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.