# Luggage tag toast

> A bag tag hangs from its cord and swings like a pendulum; brush it with the pointer and it starts swaying again.

- Category: [Toasts](https://library.aimran.es/components/toasts)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-toast-luggage-tag
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Baggage claim updates deserve something better than a grey banner. This toast hangs an airline bag tag from a rail with a cord and eyelet, airport codes in heavy type and a barcode, and a few lines of JavaScript run a damped pendulum so it swings in and settles. Moving the pointer across it, or pressing the arrow keys, gives it a push.

The main color is the stripe and button, the second the cord. Tune the stiffness and damping numbers in the script for a heavier or lighter tag; with reduced motion it simply hangs still. Good for travel apps, airlines and event cloakrooms.

## Code

### HTML

```html
<div class="uvq09-tag"><i class="rl" aria-hidden="true"></i><button type="button" class="fire">Show again</button><div class="tt" role="status"><span class="st" aria-hidden="true"></span><div class="tg"><i class="eye" aria-hidden="true"></i><span class="rt" aria-hidden="true"><b>MAD</b><i>✈</i><b>LIS</b></span><b class="tx">Your bag is on belt 7</b><small>Flight TP 1027 · landed at 14:05</small><span class="ft"><i class="bc" aria-hidden="true"></i><button type="button" class="ok">Got it</button></span></div></div></div>
```

### CSS

```css
.uvq09-tag {
  --c1: #059669;
  --c2: #a16207;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq09-tag {
  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;
  position: relative;
  width: 21em;
  height: 15em;
  height: 15.5em;
}

.uvq09-tag .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-tag .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-tag .fire:active {
  scale: .96;
}

.uvq09-tag .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-tag .fire {
  top: auto;
  bottom: .8em;
}

.uvq09-tag .rl {
  position: absolute;
  left: 2em;
  right: 2em;
  top: .55em;
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(#f4f4f5,#a1a1aa);
  box-shadow: 0 .15em .3em rgba(0,0,0,.2);
}

.uvq09-tag .tt {
  position: absolute;
  left: 50%;
  top: .75em;
  width: 15em;
  translate: -50% -2.5em;
  transform-origin: 50% 0;
  rotate: var(--a,0deg);
  opacity: 0;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1),translate calc(0.7s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq09-tag .tt.in {
  opacity: 1;
  translate: -50% 0;
}

.uvq09-tag .st {
  position: relative;
  z-index: 1;
  display: block;
  width: .16em;
  height: 2.45em;
  margin: 0 auto;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c2),color-mix(in srgb,var(--c2) 60%,#000));
}

.uvq09-tag .tg {
  position: relative;
  margin-top: -.65em;
  padding: 1.2em 1em .8em 1.5em;
  border-radius: .55em;
  color: #1c1917;
  background: linear-gradient(90deg,var(--c1) 0 .55em,transparent .55em),#fffef8;
  box-shadow: 0 .1em .2em rgba(0,0,0,.12),0 1em 1.5em -.8em rgba(0,0,0,.45);
  touch-action: pan-y;
}

.uvq09-tag .eye {
  position: absolute;
  left: 50%;
  top: .3em;
  width: .65em;
  height: .65em;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 .15em #b8b8bd,inset 0 1px 2px rgba(0,0,0,.35);
}

.uvq09-tag .rt {
  display: flex;
  align-items: center;
  gap: .35em;
  font: 900 1.65em/1 system-ui,sans-serif;
  letter-spacing: .02em;
}

.uvq09-tag .rt i {
  font-style: normal;
  font-size: .55em;
  color: var(--c1);
}

.uvq09-tag .tx {
  display: block;
  margin-top: .35em;
  font-size: .88em;
}

.uvq09-tag small {
  display: block;
  margin-top: .15em;
  font-size: .68em;
  color: #78716c;
}

.uvq09-tag .ft {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .6em;
  margin-top: .55em;
}

.uvq09-tag .bc {
  width: 6.5em;
  height: 1.5em;
  background: repeating-linear-gradient(90deg,#1c1917 0 1px,transparent 1px 3px,#1c1917 3px 5px,transparent 5px 6px,#1c1917 6px 7px,transparent 7px 10px);
}

.uvq09-tag .ok {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .45em .8em;
  border-radius: 2em;
  font-size: .74em;
  font-weight: 750;
  color: #fff;
  background: var(--c1);
  transition: filter calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-tag .ok:hover {
  filter: brightness(1.1);
}

.uvq09-tag .ok:active {
  scale: .94;
}

.uvq09-tag .ok:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq09-tag").forEach(el => {
  const t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");a=rm?0:16;w=0;draw();kick(0)},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();let a=0,w=0,raf=0,lt=0;const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;
const draw=()=>t.style.setProperty("--a",a.toFixed(2)+"deg");
const step=ts=>{const dt=Math.min(.033,(ts-(lt||ts))/1000)||.016;lt=ts;w+=(-30*a-1.4*w)*dt;a+=w*dt;draw();if(Math.abs(a)<.05&&Math.abs(w)<.3){a=0;w=0;draw();raf=0;lt=0;return}raf=requestAnimationFrame(step)};
const kick=v=>{if(rm)return;w=Math.max(-160,Math.min(160,w+v));if(!raf){lt=0;raf=requestAnimationFrame(step)}};
t.addEventListener("pointermove",e=>{if(e.pointerType==="mouse"||e.buttons)kick(e.movementX*5)});
t.addEventListener("keydown",e=>{if(e.key==="ArrowLeft")kick(-90);if(e.key==="ArrowRight")kick(90)});
t.querySelector(".ok").addEventListener("click",hide);return()=>{clr();cancelAnimationFrame(raf)}
});
```

### 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 = `
.uvq09-tag {
  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;
  position: relative;
  width: 21em;
  height: 15em;
  height: 15.5em;
}

.uvq09-tag .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-tag .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-tag .fire:active {
  scale: .96;
}

.uvq09-tag .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-tag .fire {
  top: auto;
  bottom: .8em;
}

.uvq09-tag .rl {
  position: absolute;
  left: 2em;
  right: 2em;
  top: .55em;
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(#f4f4f5,#a1a1aa);
  box-shadow: 0 .15em .3em rgba(0,0,0,.2);
}

.uvq09-tag .tt {
  position: absolute;
  left: 50%;
  top: .75em;
  width: 15em;
  translate: -50% -2.5em;
  transform-origin: 50% 0;
  rotate: var(--a,0deg);
  opacity: 0;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1),translate calc(0.7s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq09-tag .tt.in {
  opacity: 1;
  translate: -50% 0;
}

.uvq09-tag .st {
  position: relative;
  z-index: 1;
  display: block;
  width: .16em;
  height: 2.45em;
  margin: 0 auto;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c2),color-mix(in srgb,var(--c2) 60%,#000));
}

.uvq09-tag .tg {
  position: relative;
  margin-top: -.65em;
  padding: 1.2em 1em .8em 1.5em;
  border-radius: .55em;
  color: #1c1917;
  background: linear-gradient(90deg,var(--c1) 0 .55em,transparent .55em),#fffef8;
  box-shadow: 0 .1em .2em rgba(0,0,0,.12),0 1em 1.5em -.8em rgba(0,0,0,.45);
  touch-action: pan-y;
}

.uvq09-tag .eye {
  position: absolute;
  left: 50%;
  top: .3em;
  width: .65em;
  height: .65em;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 .15em #b8b8bd,inset 0 1px 2px rgba(0,0,0,.35);
}

.uvq09-tag .rt {
  display: flex;
  align-items: center;
  gap: .35em;
  font: 900 1.65em/1 system-ui,sans-serif;
  letter-spacing: .02em;
}

.uvq09-tag .rt i {
  font-style: normal;
  font-size: .55em;
  color: var(--c1);
}

.uvq09-tag .tx {
  display: block;
  margin-top: .35em;
  font-size: .88em;
}

.uvq09-tag small {
  display: block;
  margin-top: .15em;
  font-size: .68em;
  color: #78716c;
}

.uvq09-tag .ft {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .6em;
  margin-top: .55em;
}

.uvq09-tag .bc {
  width: 6.5em;
  height: 1.5em;
  background: repeating-linear-gradient(90deg,#1c1917 0 1px,transparent 1px 3px,#1c1917 3px 5px,transparent 5px 6px,#1c1917 6px 7px,transparent 7px 10px);
}

.uvq09-tag .ok {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .45em .8em;
  border-radius: 2em;
  font-size: .74em;
  font-weight: 750;
  color: #fff;
  background: var(--c1);
  transition: filter calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-tag .ok:hover {
  filter: brightness(1.1);
}

.uvq09-tag .ok:active {
  scale: .94;
}

.uvq09-tag .ok:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-tag,.uvq09-tag *,.uvq09-tag *::before,.uvq09-tag *::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 t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");a=rm?0:16;w=0;draw();kick(0)},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();let a=0,w=0,raf=0,lt=0;const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;
const draw=()=>t.style.setProperty("--a",a.toFixed(2)+"deg");
const step=ts=>{const dt=Math.min(.033,(ts-(lt||ts))/1000)||.016;lt=ts;w+=(-30*a-1.4*w)*dt;a+=w*dt;draw();if(Math.abs(a)<.05&&Math.abs(w)<.3){a=0;w=0;draw();raf=0;lt=0;return}raf=requestAnimationFrame(step)};
const kick=v=>{if(rm)return;w=Math.max(-160,Math.min(160,w+v));if(!raf){lt=0;raf=requestAnimationFrame(step)}};
t.addEventListener("pointermove",e=>{if(e.pointerType==="mouse"||e.buttons)kick(e.movementX*5)});
t.addEventListener("keydown",e=>{if(e.key==="ArrowLeft")kick(-90);if(e.key==="ArrowRight")kick(90)});
t.querySelector(".ok").addEventListener("click",hide);return()=>{clr();cancelAnimationFrame(raf)}
}

export default function ToastLuggageTag() {
  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": "#059669",
          "--c2": "#a16207",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-tag"><i className="rl" aria-hidden="true"></i><button type="button" className="fire">Show again</button><div className="tt" role="status"><span className="st" aria-hidden="true"></span><div className="tg"><i className="eye" aria-hidden="true"></i><span className="rt" aria-hidden="true"><b>MAD</b><i>✈</i><b>LIS</b></span><b className="tx">Your bag is on belt 7</b><small>Flight TP 1027 · landed at 14:05</small><span className="ft"><i className="bc" aria-hidden="true"></i><button type="button" className="ok">Got it</button></span></div></div></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 “Luggage tag toast” block (Toasts) from AIMRAN Library to my project.

## What it is
A bag tag hangs from its cord and swings like a pendulum; brush it with the pointer and it starts swaying again.

## Chosen settings
- Main color: #059669
- Secondary color: #a16207
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Tu maleta está en la cinta 7"

## 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 = `
.uvq09-tag {
  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;
  position: relative;
  width: 21em;
  height: 15em;
  height: 15.5em;
}

.uvq09-tag .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-tag .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-tag .fire:active {
  scale: .96;
}

.uvq09-tag .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-tag .fire {
  top: auto;
  bottom: .8em;
}

.uvq09-tag .rl {
  position: absolute;
  left: 2em;
  right: 2em;
  top: .55em;
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(#f4f4f5,#a1a1aa);
  box-shadow: 0 .15em .3em rgba(0,0,0,.2);
}

.uvq09-tag .tt {
  position: absolute;
  left: 50%;
  top: .75em;
  width: 15em;
  translate: -50% -2.5em;
  transform-origin: 50% 0;
  rotate: var(--a,0deg);
  opacity: 0;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1),translate calc(0.7s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq09-tag .tt.in {
  opacity: 1;
  translate: -50% 0;
}

.uvq09-tag .st {
  position: relative;
  z-index: 1;
  display: block;
  width: .16em;
  height: 2.45em;
  margin: 0 auto;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c2),color-mix(in srgb,var(--c2) 60%,#000));
}

.uvq09-tag .tg {
  position: relative;
  margin-top: -.65em;
  padding: 1.2em 1em .8em 1.5em;
  border-radius: .55em;
  color: #1c1917;
  background: linear-gradient(90deg,var(--c1) 0 .55em,transparent .55em),#fffef8;
  box-shadow: 0 .1em .2em rgba(0,0,0,.12),0 1em 1.5em -.8em rgba(0,0,0,.45);
  touch-action: pan-y;
}

.uvq09-tag .eye {
  position: absolute;
  left: 50%;
  top: .3em;
  width: .65em;
  height: .65em;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 .15em #b8b8bd,inset 0 1px 2px rgba(0,0,0,.35);
}

.uvq09-tag .rt {
  display: flex;
  align-items: center;
  gap: .35em;
  font: 900 1.65em/1 system-ui,sans-serif;
  letter-spacing: .02em;
}

.uvq09-tag .rt i {
  font-style: normal;
  font-size: .55em;
  color: var(--c1);
}

.uvq09-tag .tx {
  display: block;
  margin-top: .35em;
  font-size: .88em;
}

.uvq09-tag small {
  display: block;
  margin-top: .15em;
  font-size: .68em;
  color: #78716c;
}

.uvq09-tag .ft {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .6em;
  margin-top: .55em;
}

.uvq09-tag .bc {
  width: 6.5em;
  height: 1.5em;
  background: repeating-linear-gradient(90deg,#1c1917 0 1px,transparent 1px 3px,#1c1917 3px 5px,transparent 5px 6px,#1c1917 6px 7px,transparent 7px 10px);
}

.uvq09-tag .ok {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .45em .8em;
  border-radius: 2em;
  font-size: .74em;
  font-weight: 750;
  color: #fff;
  background: var(--c1);
  transition: filter calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-tag .ok:hover {
  filter: brightness(1.1);
}

.uvq09-tag .ok:active {
  scale: .94;
}

.uvq09-tag .ok:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-tag,.uvq09-tag *,.uvq09-tag *::before,.uvq09-tag *::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 t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");a=rm?0:16;w=0;draw();kick(0)},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();let a=0,w=0,raf=0,lt=0;const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;
const draw=()=>t.style.setProperty("--a",a.toFixed(2)+"deg");
const step=ts=>{const dt=Math.min(.033,(ts-(lt||ts))/1000)||.016;lt=ts;w+=(-30*a-1.4*w)*dt;a+=w*dt;draw();if(Math.abs(a)<.05&&Math.abs(w)<.3){a=0;w=0;draw();raf=0;lt=0;return}raf=requestAnimationFrame(step)};
const kick=v=>{if(rm)return;w=Math.max(-160,Math.min(160,w+v));if(!raf){lt=0;raf=requestAnimationFrame(step)}};
t.addEventListener("pointermove",e=>{if(e.pointerType==="mouse"||e.buttons)kick(e.movementX*5)});
t.addEventListener("keydown",e=>{if(e.key==="ArrowLeft")kick(-90);if(e.key==="ArrowRight")kick(90)});
t.querySelector(".ok").addEventListener("click",hide);return()=>{clr();cancelAnimationFrame(raf)}
}

export default function ToastLuggageTag() {
  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": "#059669",
          "--c2": "#a16207",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-tag"><i className="rl" aria-hidden="true"></i><button type="button" className="fire">Show again</button><div className="tt" role="status"><span className="st" aria-hidden="true"></span><div className="tg"><i className="eye" aria-hidden="true"></i><span className="rt" aria-hidden="true"><b>MAD</b><i>✈</i><b>LIS</b></span><b className="tx">Your bag is on belt 7</b><small>Flight TP 1027 · landed at 14:05</small><span className="ft"><i className="bc" aria-hidden="true"></i><button type="button" className="ok">Got it</button></span></div></div></div>
      </div>
    </>
  );
}
```

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