# Printing receipt card

> A thermal receipt that feeds out of a small printer in jerky steps, with a torn zigzag edge, a barcode and a monospaced total.

- Category: [Cards](https://library.aimran.es/components/cards)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-card-receipt-print
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Receipts are a familiar format for summaries, and this one is printed in front of the user: the paper slides out of the slot in stepped jumps while the printer light blinks. The zigzag edge is a CSS mask, the barcode a repeating gradient. Use it for order confirmations, café menus, checkout summaries or playful year-in-review pages.

The main color tints the light, the button and the total; the second color is the printer body. Edit the lines and the shop name, and keep item names short so the columns stay aligned.

## Code

### HTML

```html
<div class="uvq07-rcp on"><div class="pr" aria-hidden="true"><i class="led"></i><i class="sl"></i></div><div class="pp"><div class="tk"><p class="h"><b>Café Lumbre</b><span>Plaza del Carmen 3, Granada</span><span>28/10/2026 · 09:41 · Table 6</span></p><ul><li><span>2</span><span>Latte</span><span>3,20</span></li><li><span>1</span><span>Tomato toast</span><span>2,90</span></li><li><span>1</span><span>Orange juice</span><span>3,50</span></li><li><span>1</span><span>Choc croissant</span><span>2,10</span></li></ul><p class="tt"><span>Total</span><b>11,70 €</b></p><p class="iv"><span>VAT included</span><span>Card ****4021</span></p><i class="bc" aria-hidden="true"></i><p class="th">Thanks for coming</p></div></div><button type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 9V3.5h10V9M7 17H4.5v-6.5A1.5 1.5 0 0 1 6 9h12a1.5 1.5 0 0 1 1.5 1.5V17H17M7 14h10v6.5H7z"/></svg>Print receipt</button></div>
```

### CSS

```css
.uvq07-rcp {
  --c1: #e4572e;
  --c2: #2d2a26;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq07-rcp {
  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;
  display: grid;
  justify-items: center;
  width: 16em;
}

.uvq07-rcp .pr {
  position: relative;
  z-index: 1;
  width: 16em;
  height: 2.6em;
  border-radius: 1em 1em .5em .5em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 75%,#fff),var(--c2) 60%);
  box-shadow: 0 .8em 1.4em -.8em rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.25),0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq07-rcp .sl {
  position: absolute;
  left: 1.2em;
  right: 1.2em;
  bottom: .45em;
  height: .3em;
  border-radius: 1em;
  background: #0b0a09;
  box-shadow: inset 0 .1em .2em #000;
}

.uvq07-rcp .led {
  position: absolute;
  right: 1em;
  top: .7em;
  width: .45em;
  height: .45em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--c1) 35%,#333);
}

.uvq07-rcp.pg .led {
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
  animation: uvq07-rcp calc(0.4s / var(--k)) steps(1) infinite;
}

.uvq07-rcp .pp {
  width: 13.4em;
  margin-top: -.75em;
  overflow: hidden;
  filter: drop-shadow(0 .5em .5em rgba(0,0,0,.16));
}

.uvq07-rcp .tk {
  padding: 1.6em 1.1em 1.9em;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .72em;
  line-height: 1.5;
  color: #2a2622;
  background: linear-gradient(180deg,rgba(0,0,0,.14),transparent 1.4em),#fffef8;
  transform: translateY(-101%);
  -webkit-mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/.9em 100%;
  mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/.9em 100%;
}

.uvq07-rcp.on .tk {
  transform: none;
  transition: transform calc(2.4s / var(--k)) steps(18,end);
}

.uvq07-rcp .tk p {
  margin: 0;
}

.uvq07-rcp .h {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: .9em!important;
}

.uvq07-rcp .h b {
  font-size: 1.5em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq07-rcp ul {
  list-style: none;
  margin: 0;
  padding: .7em 0;
  display: grid;
  gap: .15em;
  border-block: 1px dashed rgba(42,38,34,.45);
}

.uvq07-rcp li {
  display: grid;
  grid-template-columns: 1.4em 1fr auto;
  gap: .4em;
}

.uvq07-rcp .tt {
  display: flex;
  justify-content: space-between;
  margin: .6em 0 .1em!important;
  font-size: 1.35em;
  font-weight: 700;
}

.uvq07-rcp .tt b {
  color: var(--c1);
}

.uvq07-rcp .iv {
  display: flex;
  justify-content: space-between;
  font-size: .9em;
  opacity: .7;
}

.uvq07-rcp .bc {
  display: block;
  height: 3em;
  margin: 1em .4em .8em;
  background: repeating-linear-gradient(90deg,#2a2622 0 2px,transparent 2px 3px,#2a2622 3px 4px,transparent 4px 7px,#2a2622 7px 10px,transparent 10px 11px);
}

.uvq07-rcp .th {
  text-align: center;
  letter-spacing: .1em;
}

.uvq07-rcp button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin-top: 1.1em;
  padding: .7em 1.25em;
  border-radius: 2em;
  font-weight: 700;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .5em 1em -.5em var(--c1);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-rcp button svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq07-rcp button:hover {
  transform: translateY(-2px);
}

.uvq07-rcp button:active {
  transform: scale(.95);
}

.uvq07-rcp button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq07-rcp {
  50% {
    opacity: .3;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq07-rcp").forEach(el => {
  const tk=el.querySelector(".tk");const go=()=>{el.classList.remove("on","pg");void tk.offsetWidth;el.classList.add("on","pg")};
tk.addEventListener("transitionend",()=>el.classList.remove("pg"));el.querySelector("button").addEventListener("click",go)
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq07-rcp {
  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;
  display: grid;
  justify-items: center;
  width: 16em;
}

.uvq07-rcp .pr {
  position: relative;
  z-index: 1;
  width: 16em;
  height: 2.6em;
  border-radius: 1em 1em .5em .5em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 75%,#fff),var(--c2) 60%);
  box-shadow: 0 .8em 1.4em -.8em rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.25),0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq07-rcp .sl {
  position: absolute;
  left: 1.2em;
  right: 1.2em;
  bottom: .45em;
  height: .3em;
  border-radius: 1em;
  background: #0b0a09;
  box-shadow: inset 0 .1em .2em #000;
}

.uvq07-rcp .led {
  position: absolute;
  right: 1em;
  top: .7em;
  width: .45em;
  height: .45em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--c1) 35%,#333);
}

.uvq07-rcp.pg .led {
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
  animation: uvq07-rcp calc(0.4s / var(--k)) steps(1) infinite;
}

.uvq07-rcp .pp {
  width: 13.4em;
  margin-top: -.75em;
  overflow: hidden;
  filter: drop-shadow(0 .5em .5em rgba(0,0,0,.16));
}

.uvq07-rcp .tk {
  padding: 1.6em 1.1em 1.9em;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .72em;
  line-height: 1.5;
  color: #2a2622;
  background: linear-gradient(180deg,rgba(0,0,0,.14),transparent 1.4em),#fffef8;
  transform: translateY(-101%);
  -webkit-mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/.9em 100%;
  mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/.9em 100%;
}

.uvq07-rcp.on .tk {
  transform: none;
  transition: transform calc(2.4s / var(--k)) steps(18,end);
}

.uvq07-rcp .tk p {
  margin: 0;
}

.uvq07-rcp .h {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: .9em!important;
}

.uvq07-rcp .h b {
  font-size: 1.5em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq07-rcp ul {
  list-style: none;
  margin: 0;
  padding: .7em 0;
  display: grid;
  gap: .15em;
  border-block: 1px dashed rgba(42,38,34,.45);
}

.uvq07-rcp li {
  display: grid;
  grid-template-columns: 1.4em 1fr auto;
  gap: .4em;
}

.uvq07-rcp .tt {
  display: flex;
  justify-content: space-between;
  margin: .6em 0 .1em!important;
  font-size: 1.35em;
  font-weight: 700;
}

.uvq07-rcp .tt b {
  color: var(--c1);
}

.uvq07-rcp .iv {
  display: flex;
  justify-content: space-between;
  font-size: .9em;
  opacity: .7;
}

.uvq07-rcp .bc {
  display: block;
  height: 3em;
  margin: 1em .4em .8em;
  background: repeating-linear-gradient(90deg,#2a2622 0 2px,transparent 2px 3px,#2a2622 3px 4px,transparent 4px 7px,#2a2622 7px 10px,transparent 10px 11px);
}

.uvq07-rcp .th {
  text-align: center;
  letter-spacing: .1em;
}

.uvq07-rcp button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin-top: 1.1em;
  padding: .7em 1.25em;
  border-radius: 2em;
  font-weight: 700;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .5em 1em -.5em var(--c1);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-rcp button svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq07-rcp button:hover {
  transform: translateY(-2px);
}

.uvq07-rcp button:active {
  transform: scale(.95);
}

.uvq07-rcp button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq07-rcp {
  50% {
    opacity: .3;
  }
}

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

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const tk=el.querySelector(".tk");const go=()=>{el.classList.remove("on","pg");void tk.offsetWidth;el.classList.add("on","pg")};
tk.addEventListener("transitionend",()=>el.classList.remove("pg"));el.querySelector("button").addEventListener("click",go)
}

export default function CardReceiptPrint() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e4572e",
          "--c2": "#2d2a26",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq07-rcp on"><div className="pr" aria-hidden="true"><i className="led"></i><i className="sl"></i></div><div className="pp"><div className="tk"><p className="h"><b>Café Lumbre</b><span>Plaza del Carmen 3, Granada</span><span>28/10/2026 · 09:41 · Table 6</span></p><ul><li><span>2</span><span>Latte</span><span>3,20</span></li><li><span>1</span><span>Tomato toast</span><span>2,90</span></li><li><span>1</span><span>Orange juice</span><span>3,50</span></li><li><span>1</span><span>Choc croissant</span><span>2,10</span></li></ul><p className="tt"><span>Total</span><b>11,70 €</b></p><p className="iv"><span>VAT included</span><span>Card ****4021</span></p><i className="bc" aria-hidden="true"></i><p className="th">Thanks for coming</p></div></div><button type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 9V3.5h10V9M7 17H4.5v-6.5A1.5 1.5 0 0 1 6 9h12a1.5 1.5 0 0 1 1.5 1.5V17H17M7 14h10v6.5H7z" /></svg>Print receipt</button></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 “Printing receipt card” block (Cards) from AIMRAN Library to my project.

## What it is
A thermal receipt that feeds out of a small printer in jerky steps, with a torn zigzag edge, a barcode and a monospaced total.

## Chosen settings
- Main color: #e4572e
- Secondary color: #2d2a26
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Café Lumbre"

## 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
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq07-rcp {
  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;
  display: grid;
  justify-items: center;
  width: 16em;
}

.uvq07-rcp .pr {
  position: relative;
  z-index: 1;
  width: 16em;
  height: 2.6em;
  border-radius: 1em 1em .5em .5em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 75%,#fff),var(--c2) 60%);
  box-shadow: 0 .8em 1.4em -.8em rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.25),0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq07-rcp .sl {
  position: absolute;
  left: 1.2em;
  right: 1.2em;
  bottom: .45em;
  height: .3em;
  border-radius: 1em;
  background: #0b0a09;
  box-shadow: inset 0 .1em .2em #000;
}

.uvq07-rcp .led {
  position: absolute;
  right: 1em;
  top: .7em;
  width: .45em;
  height: .45em;
  border-radius: 50%;
  background: color-mix(in srgb,var(--c1) 35%,#333);
}

.uvq07-rcp.pg .led {
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
  animation: uvq07-rcp calc(0.4s / var(--k)) steps(1) infinite;
}

.uvq07-rcp .pp {
  width: 13.4em;
  margin-top: -.75em;
  overflow: hidden;
  filter: drop-shadow(0 .5em .5em rgba(0,0,0,.16));
}

.uvq07-rcp .tk {
  padding: 1.6em 1.1em 1.9em;
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .72em;
  line-height: 1.5;
  color: #2a2622;
  background: linear-gradient(180deg,rgba(0,0,0,.14),transparent 1.4em),#fffef8;
  transform: translateY(-101%);
  -webkit-mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/.9em 100%;
  mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/.9em 100%;
}

.uvq07-rcp.on .tk {
  transform: none;
  transition: transform calc(2.4s / var(--k)) steps(18,end);
}

.uvq07-rcp .tk p {
  margin: 0;
}

.uvq07-rcp .h {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: .9em!important;
}

.uvq07-rcp .h b {
  font-size: 1.5em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq07-rcp ul {
  list-style: none;
  margin: 0;
  padding: .7em 0;
  display: grid;
  gap: .15em;
  border-block: 1px dashed rgba(42,38,34,.45);
}

.uvq07-rcp li {
  display: grid;
  grid-template-columns: 1.4em 1fr auto;
  gap: .4em;
}

.uvq07-rcp .tt {
  display: flex;
  justify-content: space-between;
  margin: .6em 0 .1em!important;
  font-size: 1.35em;
  font-weight: 700;
}

.uvq07-rcp .tt b {
  color: var(--c1);
}

.uvq07-rcp .iv {
  display: flex;
  justify-content: space-between;
  font-size: .9em;
  opacity: .7;
}

.uvq07-rcp .bc {
  display: block;
  height: 3em;
  margin: 1em .4em .8em;
  background: repeating-linear-gradient(90deg,#2a2622 0 2px,transparent 2px 3px,#2a2622 3px 4px,transparent 4px 7px,#2a2622 7px 10px,transparent 10px 11px);
}

.uvq07-rcp .th {
  text-align: center;
  letter-spacing: .1em;
}

.uvq07-rcp button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin-top: 1.1em;
  padding: .7em 1.25em;
  border-radius: 2em;
  font-weight: 700;
  color: #fff;
  background: var(--c1);
  box-shadow: 0 .5em 1em -.5em var(--c1);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq07-rcp button svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq07-rcp button:hover {
  transform: translateY(-2px);
}

.uvq07-rcp button:active {
  transform: scale(.95);
}

.uvq07-rcp button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq07-rcp {
  50% {
    opacity: .3;
  }
}

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

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const tk=el.querySelector(".tk");const go=()=>{el.classList.remove("on","pg");void tk.offsetWidth;el.classList.add("on","pg")};
tk.addEventListener("transitionend",()=>el.classList.remove("pg"));el.querySelector("button").addEventListener("click",go)
}

export default function CardReceiptPrint() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e4572e",
          "--c2": "#2d2a26",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq07-rcp on"><div className="pr" aria-hidden="true"><i className="led"></i><i className="sl"></i></div><div className="pp"><div className="tk"><p className="h"><b>Café Lumbre</b><span>Plaza del Carmen 3, Granada</span><span>28/10/2026 · 09:41 · Table 6</span></p><ul><li><span>2</span><span>Latte</span><span>3,20</span></li><li><span>1</span><span>Tomato toast</span><span>2,90</span></li><li><span>1</span><span>Orange juice</span><span>3,50</span></li><li><span>1</span><span>Choc croissant</span><span>2,10</span></li></ul><p className="tt"><span>Total</span><b>11,70 €</b></p><p className="iv"><span>VAT included</span><span>Card ****4021</span></p><i className="bc" aria-hidden="true"></i><p className="th">Thanks for coming</p></div></div><button type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 9V3.5h10V9M7 17H4.5v-6.5A1.5 1.5 0 0 1 6 9h12a1.5 1.5 0 0 1 1.5 1.5V17H17M7 14h10v6.5H7z" /></svg>Print receipt</button></div>
      </div>
    </>
  );
}
```

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