# LED dot matrix bus sign

> The destination sign of a night bus: amber LED dots that jump from line to line, just like the real ones.

- Category: [Text & scroll](https://library.aimran.es/components/text-scroll)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tx-dot-matrix
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Bus and tram signs show text as a grid of glowing dots, and this block gets the same look with pure CSS: a radial gradient mask turns ordinary type into LEDs, and unlit dots stay faintly visible behind. The lines change in steps, like a real display refreshing. It fits transport apps, city guides and retro event pages.

Set the destination in the text field, write the other lines in the list and choose the LED color with the main color. A slider changes the dot size, and hovering pauses the sign so the current line can be read calmly.

## Code

### HTML

```html
<div class="uvq14-dmx"><div class="pn"><span class="no">27</span><div class="vw"><ul class="ln"><li>Plaza Mayor</li><li>Via Centre and Station</li><li>Next: Museum</li><li aria-hidden="true">Plaza Mayor</li></ul></div></div><p class="cp"><i></i>Night line · every 12 min</p></div>
```

### CSS

```css
.uvq14-dmx {
  --c1: #ffb000;
  --c2: #22c55e;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --dot: 4px;
  /* tamaño del led */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq14-dmx {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 22em;
  display: grid;
  gap: .7em;
}

.uvq14-dmx .pn {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .6em;
  border-radius: .7em;
  background: #0c0c0d;
  box-shadow: inset 0 0 0 .3em #26262a,inset 0 0 0 .36em #000,0 1.2em 2em -1em rgba(0,0,0,.6);
}

.uvq14-dmx .pn::after {
  content: "";
  position: absolute;
  inset: .36em;
  border-radius: .45em;
  background: linear-gradient(170deg,rgba(255,255,255,.1),transparent 40%);
  pointer-events: none;
}

.uvq14-dmx .no,.uvq14-dmx .vw {
  -webkit-mask: radial-gradient(circle,#000 62%,transparent 70%) 0 0/var(--dot) var(--dot);
  mask: radial-gradient(circle,#000 62%,transparent 70%) 0 0/var(--dot) var(--dot);
}

.uvq14-dmx .no {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 2.1em;
  font: 900 1.25em/1 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color: #0c0c0d;
  background: var(--c1);
}

.uvq14-dmx .vw {
  flex: 1;
  height: 2.9em;
  overflow: hidden;
  background: color-mix(in srgb,var(--c1) 13%,#0c0c0d);
}

.uvq14-dmx .ln {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 900 1.24em/2.36em ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 55%,#fff);
  -webkit-text-stroke: .09em color-mix(in srgb,var(--c1) 75%,#fff);
  text-shadow: 0 0 .3em var(--c1),0 0 .8em var(--c1);
  animation: uvq14-dmx-r calc(10s / var(--k)) steps(6,end) infinite;
}

.uvq14-dmx li {
  height: 2.36em;
  padding: 0 .35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.uvq14-dmx:hover .ln {
  animation-play-state: paused;
}

.uvq14-dmx .cp {
  display: flex;
  align-items: center;
  gap: .5em;
  margin: 0;
  font-size: .75em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq14-dmx .cp i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--c2);
  box-shadow: 0 0 0 .25em color-mix(in srgb,var(--c2) 25%,transparent);
}

@keyframes uvq14-dmx-r {
  0%,28% {
    transform: translateY(0);
  }
  33.3%,61% {
    transform: translateY(-2.36em);
  }
  66.6%,94% {
    transform: translateY(-4.72em);
  }
  100% {
    transform: translateY(-7.08em);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-dmx,.uvq14-dmx *,.uvq14-dmx *::before,.uvq14-dmx *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq14-dmx {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 22em;
  display: grid;
  gap: .7em;
}

.uvq14-dmx .pn {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .6em;
  border-radius: .7em;
  background: #0c0c0d;
  box-shadow: inset 0 0 0 .3em #26262a,inset 0 0 0 .36em #000,0 1.2em 2em -1em rgba(0,0,0,.6);
}

.uvq14-dmx .pn::after {
  content: "";
  position: absolute;
  inset: .36em;
  border-radius: .45em;
  background: linear-gradient(170deg,rgba(255,255,255,.1),transparent 40%);
  pointer-events: none;
}

.uvq14-dmx .no,.uvq14-dmx .vw {
  -webkit-mask: radial-gradient(circle,#000 62%,transparent 70%) 0 0/var(--dot) var(--dot);
  mask: radial-gradient(circle,#000 62%,transparent 70%) 0 0/var(--dot) var(--dot);
}

.uvq14-dmx .no {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 2.1em;
  font: 900 1.25em/1 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color: #0c0c0d;
  background: var(--c1);
}

.uvq14-dmx .vw {
  flex: 1;
  height: 2.9em;
  overflow: hidden;
  background: color-mix(in srgb,var(--c1) 13%,#0c0c0d);
}

.uvq14-dmx .ln {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 900 1.24em/2.36em ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 55%,#fff);
  -webkit-text-stroke: .09em color-mix(in srgb,var(--c1) 75%,#fff);
  text-shadow: 0 0 .3em var(--c1),0 0 .8em var(--c1);
  animation: uvq14-dmx-r calc(10s / var(--k)) steps(6,end) infinite;
}

.uvq14-dmx li {
  height: 2.36em;
  padding: 0 .35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.uvq14-dmx:hover .ln {
  animation-play-state: paused;
}

.uvq14-dmx .cp {
  display: flex;
  align-items: center;
  gap: .5em;
  margin: 0;
  font-size: .75em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq14-dmx .cp i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--c2);
  box-shadow: 0 0 0 .25em color-mix(in srgb,var(--c2) 25%,transparent);
}

@keyframes uvq14-dmx-r {
  0%,28% {
    transform: translateY(0);
  }
  33.3%,61% {
    transform: translateY(-2.36em);
  }
  66.6%,94% {
    transform: translateY(-4.72em);
  }
  100% {
    transform: translateY(-7.08em);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-dmx,.uvq14-dmx *,.uvq14-dmx *::before,.uvq14-dmx *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function TxDotMatrix() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#ffb000",
          "--c2": "#22c55e",
          "--s": "16px",
          "--k": "1",
          "--dot": "4px",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq14-dmx"><div className="pn"><span className="no">27</span><div className="vw"><ul className="ln"><li>Plaza Mayor</li><li>Via Centre and Station</li><li>Next: Museum</li><li aria-hidden="true">Plaza Mayor</li></ul></div></div><p className="cp"><i></i>Night line · every 12 min</p></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “LED dot matrix bus sign” block (Text & scroll) from AIMRAN Library to my project.

## What it is
The destination sign of a night bus: amber LED dots that jump from line to line, just like the real ones.

## Chosen settings
- Main color: #ffb000
- Secondary color: #22c55e
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- LED size: 4px (from 3 to 7px)
- Text: "Plaza Mayor"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
.uvq14-dmx {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  width: 22em;
  display: grid;
  gap: .7em;
}

.uvq14-dmx .pn {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .6em;
  border-radius: .7em;
  background: #0c0c0d;
  box-shadow: inset 0 0 0 .3em #26262a,inset 0 0 0 .36em #000,0 1.2em 2em -1em rgba(0,0,0,.6);
}

.uvq14-dmx .pn::after {
  content: "";
  position: absolute;
  inset: .36em;
  border-radius: .45em;
  background: linear-gradient(170deg,rgba(255,255,255,.1),transparent 40%);
  pointer-events: none;
}

.uvq14-dmx .no,.uvq14-dmx .vw {
  -webkit-mask: radial-gradient(circle,#000 62%,transparent 70%) 0 0/var(--dot) var(--dot);
  mask: radial-gradient(circle,#000 62%,transparent 70%) 0 0/var(--dot) var(--dot);
}

.uvq14-dmx .no {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 2.1em;
  font: 900 1.25em/1 ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color: #0c0c0d;
  background: var(--c1);
}

.uvq14-dmx .vw {
  flex: 1;
  height: 2.9em;
  overflow: hidden;
  background: color-mix(in srgb,var(--c1) 13%,#0c0c0d);
}

.uvq14-dmx .ln {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 900 1.24em/2.36em ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 55%,#fff);
  -webkit-text-stroke: .09em color-mix(in srgb,var(--c1) 75%,#fff);
  text-shadow: 0 0 .3em var(--c1),0 0 .8em var(--c1);
  animation: uvq14-dmx-r calc(10s / var(--k)) steps(6,end) infinite;
}

.uvq14-dmx li {
  height: 2.36em;
  padding: 0 .35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.uvq14-dmx:hover .ln {
  animation-play-state: paused;
}

.uvq14-dmx .cp {
  display: flex;
  align-items: center;
  gap: .5em;
  margin: 0;
  font-size: .75em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq14-dmx .cp i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--c2);
  box-shadow: 0 0 0 .25em color-mix(in srgb,var(--c2) 25%,transparent);
}

@keyframes uvq14-dmx-r {
  0%,28% {
    transform: translateY(0);
  }
  33.3%,61% {
    transform: translateY(-2.36em);
  }
  66.6%,94% {
    transform: translateY(-4.72em);
  }
  100% {
    transform: translateY(-7.08em);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-dmx,.uvq14-dmx *,.uvq14-dmx *::before,.uvq14-dmx *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function TxDotMatrix() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#ffb000",
          "--c2": "#22c55e",
          "--s": "16px",
          "--k": "1",
          "--dot": "4px",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq14-dmx"><div className="pn"><span className="no">27</span><div className="vw"><ul className="ln"><li>Plaza Mayor</li><li>Via Centre and Station</li><li>Next: Museum</li><li aria-hidden="true">Plaza Mayor</li></ul></div></div><p className="cp"><i></i>Night line · every 12 min</p></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
