# Keyboard shortcut tip toast

> A tip with raised keycaps that press themselves; use the shortcut on your keyboard and they light up to confirm it.

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

## Where to use it

Shortcut tips are easy to ignore when they are plain text. Here the keys are drawn as real keycaps with depth, a legend in the corner and a shadow that shrinks as they press down in a loop. The toast listens for the real Alt + N combination, and the keys also work as a button on touch screens. Use it for onboarding, productivity apps and power user hints.

The main color lights the keys when the shortcut works, the second tints the caps. Change the key check in the script and the legends together, and keep the listener on the document only while the tip is visible.

## Code

### HTML

```html
<div class="uvq09-kbd"><button type="button" class="fire">Show again</button><div class="tt" role="status"><small class="lb">Tip</small><b>Create a note instantly</b><button type="button" class="ks" aria-label="Try the Alt + N shortcut"><kbd class="k1"><small>⌥</small>Alt</kbd><i aria-hidden="true">+</i><kbd class="k2">N</kbd></button><small class="hn">Try it now on your keyboard</small><small class="dn">Note created</small></div></div>
```

### CSS

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

.uvq09-kbd {
  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;
}

.uvq09-kbd .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-kbd .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

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

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

.uvq09-kbd .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: grid;
  justify-items: center;
  gap: .45em;
  padding: .95em 1em .85em;
  text-align: center;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-kbd .lb {
  padding: .3em .65em;
  border-radius: 2em;
  font-size: .64em;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
  background: color-mix(in srgb,var(--c1) 18%,transparent);
}

.uvq09-kbd b {
  font-size: .98em;
}

.uvq09-kbd .ks {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: .45em;
  padding: .35em .55em .55em;
  border-radius: .8em;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .ks:hover {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

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

.uvq09-kbd .ks>i {
  font-style: normal;
  font-weight: 700;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-kbd kbd {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2.3em;
  height: 2.3em;
  padding: 0 .6em;
  border-radius: .5em;
  font: 700 .9em/1 system-ui,sans-serif;
  color: #292524;
  background: linear-gradient(#fff,var(--c2));
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .22em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .35em .5em -.1em rgba(0,0,0,.35);
  transition: transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .k1 {
  min-width: 3.4em;
  padding-top: .5em;
}

.uvq09-kbd kbd small {
  position: absolute;
  left: .45em;
  top: .3em;
  font-size: .62em;
  opacity: .55;
}

.uvq09-kbd .tt.in kbd {
  animation: uvq09-kbd-p calc(2.6s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.8s / var(--k)) infinite;
}

.uvq09-kbd .tt.in .k2 {
  animation-delay: calc(1s / var(--k));
}

.uvq09-kbd .ks.pr kbd {
  transform: translateY(.16em);
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .06em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .1em .2em -.1em rgba(0,0,0,.3);
}

.uvq09-kbd .tt.ok kbd {
  animation: none;
  background: linear-gradient(color-mix(in srgb,var(--c1) 35%,#fff),var(--c1));
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.1),0 .22em 0 color-mix(in srgb,var(--c1) 60%,#000),0 0 1.1em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq09-kbd .hn,.uvq09-kbd .dn {
  font-size: .72em;
}

.uvq09-kbd .hn {
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-kbd .dn {
  display: none;
  font-weight: 750;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
}

.uvq09-kbd .tt.ok .hn {
  display: none;
}

.uvq09-kbd .tt.ok .dn {
  display: block;
  animation: uvq09-kbd-o calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

@keyframes uvq09-kbd-p {
  0%,8%,38%,100% {
    transform: none;
  }
  12%,32% {
    transform: translateY(.16em);
    box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .06em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .1em .2em -.1em rgba(0,0,0,.3);
  }
}

@keyframes uvq09-kbd-o {
  from {
    opacity: 0;
    transform: scale(.7);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq09-kbd").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");t.classList.remove('ok')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const ks=t.querySelector(".ks");const done=()=>{ks.classList.add("pr");later(()=>{ks.classList.remove("pr");t.classList.add("ok")},160)};
const kd=e=>{if(e.altKey&&e.code==="KeyN")done()};document.addEventListener("keydown",kd);ks.addEventListener("click",done);return()=>{clr();document.removeEventListener("keydown",kd)}
});
```

### 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-kbd {
  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;
}

.uvq09-kbd .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-kbd .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

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

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

.uvq09-kbd .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: grid;
  justify-items: center;
  gap: .45em;
  padding: .95em 1em .85em;
  text-align: center;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-kbd .lb {
  padding: .3em .65em;
  border-radius: 2em;
  font-size: .64em;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
  background: color-mix(in srgb,var(--c1) 18%,transparent);
}

.uvq09-kbd b {
  font-size: .98em;
}

.uvq09-kbd .ks {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: .45em;
  padding: .35em .55em .55em;
  border-radius: .8em;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .ks:hover {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

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

.uvq09-kbd .ks>i {
  font-style: normal;
  font-weight: 700;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-kbd kbd {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2.3em;
  height: 2.3em;
  padding: 0 .6em;
  border-radius: .5em;
  font: 700 .9em/1 system-ui,sans-serif;
  color: #292524;
  background: linear-gradient(#fff,var(--c2));
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .22em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .35em .5em -.1em rgba(0,0,0,.35);
  transition: transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .k1 {
  min-width: 3.4em;
  padding-top: .5em;
}

.uvq09-kbd kbd small {
  position: absolute;
  left: .45em;
  top: .3em;
  font-size: .62em;
  opacity: .55;
}

.uvq09-kbd .tt.in kbd {
  animation: uvq09-kbd-p calc(2.6s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.8s / var(--k)) infinite;
}

.uvq09-kbd .tt.in .k2 {
  animation-delay: calc(1s / var(--k));
}

.uvq09-kbd .ks.pr kbd {
  transform: translateY(.16em);
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .06em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .1em .2em -.1em rgba(0,0,0,.3);
}

.uvq09-kbd .tt.ok kbd {
  animation: none;
  background: linear-gradient(color-mix(in srgb,var(--c1) 35%,#fff),var(--c1));
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.1),0 .22em 0 color-mix(in srgb,var(--c1) 60%,#000),0 0 1.1em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq09-kbd .hn,.uvq09-kbd .dn {
  font-size: .72em;
}

.uvq09-kbd .hn {
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-kbd .dn {
  display: none;
  font-weight: 750;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
}

.uvq09-kbd .tt.ok .hn {
  display: none;
}

.uvq09-kbd .tt.ok .dn {
  display: block;
  animation: uvq09-kbd-o calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

@keyframes uvq09-kbd-p {
  0%,8%,38%,100% {
    transform: none;
  }
  12%,32% {
    transform: translateY(.16em);
    box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .06em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .1em .2em -.1em rgba(0,0,0,.3);
  }
}

@keyframes uvq09-kbd-o {
  from {
    opacity: 0;
    transform: scale(.7);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-kbd,.uvq09-kbd *,.uvq09-kbd *::before,.uvq09-kbd *::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");t.classList.remove('ok')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const ks=t.querySelector(".ks");const done=()=>{ks.classList.add("pr");later(()=>{ks.classList.remove("pr");t.classList.add("ok")},160)};
const kd=e=>{if(e.altKey&&e.code==="KeyN")done()};document.addEventListener("keydown",kd);ks.addEventListener("click",done);return()=>{clr();document.removeEventListener("keydown",kd)}
}

export default function ToastShortcutKeys() {
  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": "#f59e0b",
          "--c2": "#e7e5e4",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-kbd"><button type="button" className="fire">Show again</button><div className="tt" role="status"><small className="lb">Tip</small><b>Create a note instantly</b><button type="button" className="ks" aria-label="Try the Alt + N shortcut"><kbd className="k1"><small>⌥</small>Alt</kbd><i aria-hidden="true">+</i><kbd className="k2">N</kbd></button><small className="hn">Try it now on your keyboard</small><small className="dn">Note created</small></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 “Keyboard shortcut tip toast” block (Toasts) from AIMRAN Library to my project.

## What it is
A tip with raised keycaps that press themselves; use the shortcut on your keyboard and they light up to confirm it.

## Chosen settings
- Main color: #f59e0b
- Secondary color: #e7e5e4
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Crea una nota al instante"

## 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-kbd {
  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;
}

.uvq09-kbd .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-kbd .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

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

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

.uvq09-kbd .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: grid;
  justify-items: center;
  gap: .45em;
  padding: .95em 1em .85em;
  text-align: center;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-kbd .lb {
  padding: .3em .65em;
  border-radius: 2em;
  font-size: .64em;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
  background: color-mix(in srgb,var(--c1) 18%,transparent);
}

.uvq09-kbd b {
  font-size: .98em;
}

.uvq09-kbd .ks {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: .45em;
  padding: .35em .55em .55em;
  border-radius: .8em;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .ks:hover {
  background: color-mix(in srgb,var(--fg) 6%,transparent);
}

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

.uvq09-kbd .ks>i {
  font-style: normal;
  font-weight: 700;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-kbd kbd {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2.3em;
  height: 2.3em;
  padding: 0 .6em;
  border-radius: .5em;
  font: 700 .9em/1 system-ui,sans-serif;
  color: #292524;
  background: linear-gradient(#fff,var(--c2));
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .22em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .35em .5em -.1em rgba(0,0,0,.35);
  transition: transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-kbd .k1 {
  min-width: 3.4em;
  padding-top: .5em;
}

.uvq09-kbd kbd small {
  position: absolute;
  left: .45em;
  top: .3em;
  font-size: .62em;
  opacity: .55;
}

.uvq09-kbd .tt.in kbd {
  animation: uvq09-kbd-p calc(2.6s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.8s / var(--k)) infinite;
}

.uvq09-kbd .tt.in .k2 {
  animation-delay: calc(1s / var(--k));
}

.uvq09-kbd .ks.pr kbd {
  transform: translateY(.16em);
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .06em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .1em .2em -.1em rgba(0,0,0,.3);
}

.uvq09-kbd .tt.ok kbd {
  animation: none;
  background: linear-gradient(color-mix(in srgb,var(--c1) 35%,#fff),var(--c1));
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.1),0 .22em 0 color-mix(in srgb,var(--c1) 60%,#000),0 0 1.1em color-mix(in srgb,var(--c1) 60%,transparent);
}

.uvq09-kbd .hn,.uvq09-kbd .dn {
  font-size: .72em;
}

.uvq09-kbd .hn {
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq09-kbd .dn {
  display: none;
  font-weight: 750;
  color: color-mix(in srgb,var(--c1) 55%,var(--fg));
}

.uvq09-kbd .tt.ok .hn {
  display: none;
}

.uvq09-kbd .tt.ok .dn {
  display: block;
  animation: uvq09-kbd-o calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

@keyframes uvq09-kbd-p {
  0%,8%,38%,100% {
    transform: none;
  }
  12%,32% {
    transform: translateY(.16em);
    box-shadow: inset 0 -.12em 0 rgba(0,0,0,.08),0 .06em 0 color-mix(in srgb,var(--c2) 65%,#000),0 .1em .2em -.1em rgba(0,0,0,.3);
  }
}

@keyframes uvq09-kbd-o {
  from {
    opacity: 0;
    transform: scale(.7);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-kbd,.uvq09-kbd *,.uvq09-kbd *::before,.uvq09-kbd *::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");t.classList.remove('ok')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const ks=t.querySelector(".ks");const done=()=>{ks.classList.add("pr");later(()=>{ks.classList.remove("pr");t.classList.add("ok")},160)};
const kd=e=>{if(e.altKey&&e.code==="KeyN")done()};document.addEventListener("keydown",kd);ks.addEventListener("click",done);return()=>{clr();document.removeEventListener("keydown",kd)}
}

export default function ToastShortcutKeys() {
  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": "#f59e0b",
          "--c2": "#e7e5e4",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-kbd"><button type="button" className="fire">Show again</button><div className="tt" role="status"><small className="lb">Tip</small><b>Create a note instantly</b><button type="button" className="ks" aria-label="Try the Alt + N shortcut"><kbd className="k1"><small>⌥</small>Alt</kbd><i aria-hidden="true">+</i><kbd className="k2">N</kbd></button><small className="hn">Try it now on your keyboard</small><small className="dn">Note created</small></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.
````
