# Mechanical keycap menu

> Sections become keys on a beige mechanical keyboard: they sink when pressed, the active one turns orange and keys 1 to 4 work too.

- Category: [Navigation](https://library.aimran.es/components/navigation)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-nav-keycaps
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A menu made of beige mechanical keycaps with a dished top, number legend and a small LED. Keys travel down when pressed, the active section stays orange with its LED lit, and a little green terminal line below types out what is inside. Pressing 1 to 4 on the keyboard presses the matching cap, which makes it fun for developer tools, dashboards and portfolios.

The main color sets the active key and the secondary color the keyboard case. Use one short word per key, up to five keys in a row, and list the shortcuts somewhere visible.

## Code

### HTML

```html
<div class="uvq12-kc"><div class="ks" role="tablist" aria-label="Shortcuts"><button type="button" role="tab" id="uvq12-kc-t0" aria-selected="true" aria-controls="uvq12-kc-p0" tabindex="0" aria-keyshortcuts="1"><span class="cap"><b>1</b><span>Home</span><i class="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t1" aria-selected="false" aria-controls="uvq12-kc-p1" tabindex="-1" aria-keyshortcuts="2"><span class="cap"><b>2</b><span>Projects</span><i class="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t2" aria-selected="false" aria-controls="uvq12-kc-p2" tabindex="-1" aria-keyshortcuts="3"><span class="cap"><b>3</b><span>Notes</span><i class="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t3" aria-selected="false" aria-controls="uvq12-kc-p3" tabindex="-1" aria-keyshortcuts="4"><span class="cap"><b>4</b><span>Settings</span><i class="led" aria-hidden="true"></i></span></button></div><div class="sc"><div class="pn" role="tabpanel" id="uvq12-kc-p0" aria-labelledby="uvq12-kc-t0">You have 3 new alerts.</div><div class="pn" role="tabpanel" id="uvq12-kc-p1" aria-labelledby="uvq12-kc-t1" hidden>12 active projects.</div><div class="pn" role="tabpanel" id="uvq12-kc-p2" aria-labelledby="uvq12-kc-t2" hidden>Last note 5 min ago.</div><div class="pn" role="tabpanel" id="uvq12-kc-p3" aria-labelledby="uvq12-kc-t3" hidden>Theme, language and shortcuts.</div></div></div>
```

### CSS

```css
.uvq12-kc {
  --c1: #f97316;
  --c2: #2a2826;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq12-kc {
  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: 21em;
  padding: 1em 1em .9em;
  border-radius: 1em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 85%,#fff 10%),var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),inset 0 -.3em .6em rgba(0,0,0,.3),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
}

.uvq12-kc .ks {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: .45em;
  padding: .4em;
  border-radius: .6em;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 .2em .4em rgba(0,0,0,.5);
}

.uvq12-kc [role="tab"] {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  height: 4.4em;
  border-radius: .55em;
  outline: 0;
}

.uvq12-kc .cap {
  position: relative;
  display: block;
  height: 4em;
  border-radius: .55em;
  color: #44403c;
  background: linear-gradient(180deg,#d9d2c3,#b9b09c);
  box-shadow: 0 .35em 0 #857c6a,0 .45em .6em rgba(0,0,0,.4);
  transition: transform calc(0.08s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.08s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-kc .cap::before {
  content: "";
  position: absolute;
  inset: .28em .38em .62em;
  border-radius: .45em;
  background: linear-gradient(180deg,#f3eee4,#ddd5c4);
  box-shadow: inset 0 .1em .15em rgba(255,255,255,.8),inset 0 -.15em .3em rgba(0,0,0,.08);
}

.uvq12-kc .cap b,.uvq12-kc .cap span {
  position: absolute;
  left: .75em;
  font-weight: 800;
  text-transform: uppercase;
}

.uvq12-kc .cap b {
  top: .55em;
  font-size: .8em;
}

.uvq12-kc .cap span {
  bottom: 1.25em;
  max-width: calc(100% - 1.2em);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .52em;
  letter-spacing: .06em;
  white-space: nowrap;
}

.uvq12-kc .led {
  position: absolute;
  right: .65em;
  top: .65em;
  width: .35em;
  height: .35em;
  border-radius: 50%;
  background: rgba(0,0,0,.2);
}

.uvq12-kc [role="tab"]:hover .cap::before {
  background: linear-gradient(180deg,#f8f4ec,#e3dccd);
}

.uvq12-kc [role="tab"]:active .cap,.uvq12-kc .dn .cap {
  transform: translateY(.28em);
  box-shadow: 0 .07em 0 #857c6a,0 .12em .2em rgba(0,0,0,.4);
}

.uvq12-kc [aria-selected="true"] .cap {
  color: #fff;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 85%,#fff),color-mix(in srgb,var(--c1) 85%,#000));
  box-shadow: 0 .35em 0 color-mix(in srgb,var(--c1) 55%,#000),0 .45em .6em rgba(0,0,0,.4);
}

.uvq12-kc [aria-selected="true"] .cap::before {
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 70%,#fff),var(--c1));
  box-shadow: inset 0 .1em .15em rgba(255,255,255,.45),inset 0 -.15em .3em rgba(0,0,0,.12);
}

.uvq12-kc [aria-selected="true"] .led {
  background: #bef264;
  box-shadow: 0 0 .4em #a3e635;
}

.uvq12-kc [role="tab"]:focus-visible .cap {
  outline: 2px solid #fafaf9;
  outline-offset: 2px;
}

.uvq12-kc .sc {
  margin-top: .8em;
  padding: .55em .8em;
  border-radius: .4em;
  background: #0c0f0a;
  box-shadow: inset 0 .15em .3em rgba(0,0,0,.6);
}

.uvq12-kc .pn {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .78em;
  color: #bef264;
  text-shadow: 0 0 .4em rgba(190,242,100,.4);
  animation: uvq12-kc calc(0.35s / var(--k)) steps(6,end);
}

.uvq12-kc .pn::before {
  content: "› ";
}

.uvq12-kc .pn::after {
  content: "▌";
  margin-left: .15em;
  animation: uvq12-kc-b 1s steps(1,end) infinite;
}

@keyframes uvq12-kc {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}

@keyframes uvq12-kc-b {
  50% {
    opacity: 0;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq12-kc").forEach(el => {
  const ps=[...el.querySelectorAll('[role="tabpanel"]')];const tb=[...el.querySelectorAll('[role="tab"]')];const sel=(t,f)=>{const i=tb.indexOf(t);tb.forEach((x,j)=>{x.setAttribute("aria-selected",String(j===i));x.tabIndex=j===i?0:-1});ps.forEach((p,j)=>{p.hidden=j!==i});if(f)t.focus()};tb.forEach(t=>t.addEventListener("click",()=>sel(t)));el.addEventListener("keydown",e=>{const i=tb.indexOf(document.activeElement);if(i<0)return;const n={ArrowRight:i+1,ArrowDown:i+1,ArrowLeft:i-1,ArrowUp:i-1,Home:0,End:tb.length-1}[e.key];if(n===undefined)return;e.preventDefault();sel(tb[(n+tb.length)%tb.length],1)});
const press=t=>{t.classList.add("dn");setTimeout(()=>t.classList.remove("dn"),120)};
el.addEventListener("keydown",e=>{const n=+e.key;if(n>=1&&n<=tb.length&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault();press(tb[n-1]);sel(tb[n-1],1)}if((e.key===" "||e.key==="Enter")&&tb.includes(document.activeElement))press(document.activeElement)})
});
```

### 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 = `
.uvq12-kc {
  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: 21em;
  padding: 1em 1em .9em;
  border-radius: 1em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 85%,#fff 10%),var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),inset 0 -.3em .6em rgba(0,0,0,.3),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
}

.uvq12-kc .ks {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: .45em;
  padding: .4em;
  border-radius: .6em;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 .2em .4em rgba(0,0,0,.5);
}

.uvq12-kc [role="tab"] {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  height: 4.4em;
  border-radius: .55em;
  outline: 0;
}

.uvq12-kc .cap {
  position: relative;
  display: block;
  height: 4em;
  border-radius: .55em;
  color: #44403c;
  background: linear-gradient(180deg,#d9d2c3,#b9b09c);
  box-shadow: 0 .35em 0 #857c6a,0 .45em .6em rgba(0,0,0,.4);
  transition: transform calc(0.08s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.08s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-kc .cap::before {
  content: "";
  position: absolute;
  inset: .28em .38em .62em;
  border-radius: .45em;
  background: linear-gradient(180deg,#f3eee4,#ddd5c4);
  box-shadow: inset 0 .1em .15em rgba(255,255,255,.8),inset 0 -.15em .3em rgba(0,0,0,.08);
}

.uvq12-kc .cap b,.uvq12-kc .cap span {
  position: absolute;
  left: .75em;
  font-weight: 800;
  text-transform: uppercase;
}

.uvq12-kc .cap b {
  top: .55em;
  font-size: .8em;
}

.uvq12-kc .cap span {
  bottom: 1.25em;
  max-width: calc(100% - 1.2em);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .52em;
  letter-spacing: .06em;
  white-space: nowrap;
}

.uvq12-kc .led {
  position: absolute;
  right: .65em;
  top: .65em;
  width: .35em;
  height: .35em;
  border-radius: 50%;
  background: rgba(0,0,0,.2);
}

.uvq12-kc [role="tab"]:hover .cap::before {
  background: linear-gradient(180deg,#f8f4ec,#e3dccd);
}

.uvq12-kc [role="tab"]:active .cap,.uvq12-kc .dn .cap {
  transform: translateY(.28em);
  box-shadow: 0 .07em 0 #857c6a,0 .12em .2em rgba(0,0,0,.4);
}

.uvq12-kc [aria-selected="true"] .cap {
  color: #fff;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 85%,#fff),color-mix(in srgb,var(--c1) 85%,#000));
  box-shadow: 0 .35em 0 color-mix(in srgb,var(--c1) 55%,#000),0 .45em .6em rgba(0,0,0,.4);
}

.uvq12-kc [aria-selected="true"] .cap::before {
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 70%,#fff),var(--c1));
  box-shadow: inset 0 .1em .15em rgba(255,255,255,.45),inset 0 -.15em .3em rgba(0,0,0,.12);
}

.uvq12-kc [aria-selected="true"] .led {
  background: #bef264;
  box-shadow: 0 0 .4em #a3e635;
}

.uvq12-kc [role="tab"]:focus-visible .cap {
  outline: 2px solid #fafaf9;
  outline-offset: 2px;
}

.uvq12-kc .sc {
  margin-top: .8em;
  padding: .55em .8em;
  border-radius: .4em;
  background: #0c0f0a;
  box-shadow: inset 0 .15em .3em rgba(0,0,0,.6);
}

.uvq12-kc .pn {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .78em;
  color: #bef264;
  text-shadow: 0 0 .4em rgba(190,242,100,.4);
  animation: uvq12-kc calc(0.35s / var(--k)) steps(6,end);
}

.uvq12-kc .pn::before {
  content: "› ";
}

.uvq12-kc .pn::after {
  content: "▌";
  margin-left: .15em;
  animation: uvq12-kc-b 1s steps(1,end) infinite;
}

@keyframes uvq12-kc {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}

@keyframes uvq12-kc-b {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-kc,.uvq12-kc *,.uvq12-kc *::before,.uvq12-kc *::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 ps=[...el.querySelectorAll('[role="tabpanel"]')];const tb=[...el.querySelectorAll('[role="tab"]')];const sel=(t,f)=>{const i=tb.indexOf(t);tb.forEach((x,j)=>{x.setAttribute("aria-selected",String(j===i));x.tabIndex=j===i?0:-1});ps.forEach((p,j)=>{p.hidden=j!==i});if(f)t.focus()};tb.forEach(t=>t.addEventListener("click",()=>sel(t)));el.addEventListener("keydown",e=>{const i=tb.indexOf(document.activeElement);if(i<0)return;const n={ArrowRight:i+1,ArrowDown:i+1,ArrowLeft:i-1,ArrowUp:i-1,Home:0,End:tb.length-1}[e.key];if(n===undefined)return;e.preventDefault();sel(tb[(n+tb.length)%tb.length],1)});
const press=t=>{t.classList.add("dn");setTimeout(()=>t.classList.remove("dn"),120)};
el.addEventListener("keydown",e=>{const n=+e.key;if(n>=1&&n<=tb.length&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault();press(tb[n-1]);sel(tb[n-1],1)}if((e.key===" "||e.key==="Enter")&&tb.includes(document.activeElement))press(document.activeElement)})
}

export default function NavKeycaps() {
  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": "#f97316",
          "--c2": "#2a2826",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq12-kc"><div className="ks" role="tablist" aria-label="Shortcuts"><button type="button" role="tab" id="uvq12-kc-t0" aria-selected="true" aria-controls="uvq12-kc-p0" tabIndex={0} aria-keyshortcuts="1"><span className="cap"><b>1</b><span>Home</span><i className="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t1" aria-selected="false" aria-controls="uvq12-kc-p1" tabIndex={-1} aria-keyshortcuts="2"><span className="cap"><b>2</b><span>Projects</span><i className="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t2" aria-selected="false" aria-controls="uvq12-kc-p2" tabIndex={-1} aria-keyshortcuts="3"><span className="cap"><b>3</b><span>Notes</span><i className="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t3" aria-selected="false" aria-controls="uvq12-kc-p3" tabIndex={-1} aria-keyshortcuts="4"><span className="cap"><b>4</b><span>Settings</span><i className="led" aria-hidden="true"></i></span></button></div><div className="sc"><div className="pn" role="tabpanel" id="uvq12-kc-p0" aria-labelledby="uvq12-kc-t0">You have 3 new alerts.</div><div className="pn" role="tabpanel" id="uvq12-kc-p1" aria-labelledby="uvq12-kc-t1" hidden={true}>12 active projects.</div><div className="pn" role="tabpanel" id="uvq12-kc-p2" aria-labelledby="uvq12-kc-t2" hidden={true}>Last note 5 min ago.</div><div className="pn" role="tabpanel" id="uvq12-kc-p3" aria-labelledby="uvq12-kc-t3" hidden={true}>Theme, language and shortcuts.</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 “Mechanical keycap menu” block (Navigation) from AIMRAN Library to my project.

## What it is
Sections become keys on a beige mechanical keyboard: they sink when pressed, the active one turns orange and keys 1 to 4 work too.

## Chosen settings
- Main color: #f97316
- Secondary color: #2a2826
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Atajos"

## 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 = `
.uvq12-kc {
  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: 21em;
  padding: 1em 1em .9em;
  border-radius: 1em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 85%,#fff 10%),var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),inset 0 -.3em .6em rgba(0,0,0,.3),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
}

.uvq12-kc .ks {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: .45em;
  padding: .4em;
  border-radius: .6em;
  background: rgba(0,0,0,.35);
  box-shadow: inset 0 .2em .4em rgba(0,0,0,.5);
}

.uvq12-kc [role="tab"] {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  height: 4.4em;
  border-radius: .55em;
  outline: 0;
}

.uvq12-kc .cap {
  position: relative;
  display: block;
  height: 4em;
  border-radius: .55em;
  color: #44403c;
  background: linear-gradient(180deg,#d9d2c3,#b9b09c);
  box-shadow: 0 .35em 0 #857c6a,0 .45em .6em rgba(0,0,0,.4);
  transition: transform calc(0.08s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.08s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-kc .cap::before {
  content: "";
  position: absolute;
  inset: .28em .38em .62em;
  border-radius: .45em;
  background: linear-gradient(180deg,#f3eee4,#ddd5c4);
  box-shadow: inset 0 .1em .15em rgba(255,255,255,.8),inset 0 -.15em .3em rgba(0,0,0,.08);
}

.uvq12-kc .cap b,.uvq12-kc .cap span {
  position: absolute;
  left: .75em;
  font-weight: 800;
  text-transform: uppercase;
}

.uvq12-kc .cap b {
  top: .55em;
  font-size: .8em;
}

.uvq12-kc .cap span {
  bottom: 1.25em;
  max-width: calc(100% - 1.2em);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .52em;
  letter-spacing: .06em;
  white-space: nowrap;
}

.uvq12-kc .led {
  position: absolute;
  right: .65em;
  top: .65em;
  width: .35em;
  height: .35em;
  border-radius: 50%;
  background: rgba(0,0,0,.2);
}

.uvq12-kc [role="tab"]:hover .cap::before {
  background: linear-gradient(180deg,#f8f4ec,#e3dccd);
}

.uvq12-kc [role="tab"]:active .cap,.uvq12-kc .dn .cap {
  transform: translateY(.28em);
  box-shadow: 0 .07em 0 #857c6a,0 .12em .2em rgba(0,0,0,.4);
}

.uvq12-kc [aria-selected="true"] .cap {
  color: #fff;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 85%,#fff),color-mix(in srgb,var(--c1) 85%,#000));
  box-shadow: 0 .35em 0 color-mix(in srgb,var(--c1) 55%,#000),0 .45em .6em rgba(0,0,0,.4);
}

.uvq12-kc [aria-selected="true"] .cap::before {
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 70%,#fff),var(--c1));
  box-shadow: inset 0 .1em .15em rgba(255,255,255,.45),inset 0 -.15em .3em rgba(0,0,0,.12);
}

.uvq12-kc [aria-selected="true"] .led {
  background: #bef264;
  box-shadow: 0 0 .4em #a3e635;
}

.uvq12-kc [role="tab"]:focus-visible .cap {
  outline: 2px solid #fafaf9;
  outline-offset: 2px;
}

.uvq12-kc .sc {
  margin-top: .8em;
  padding: .55em .8em;
  border-radius: .4em;
  background: #0c0f0a;
  box-shadow: inset 0 .15em .3em rgba(0,0,0,.6);
}

.uvq12-kc .pn {
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .78em;
  color: #bef264;
  text-shadow: 0 0 .4em rgba(190,242,100,.4);
  animation: uvq12-kc calc(0.35s / var(--k)) steps(6,end);
}

.uvq12-kc .pn::before {
  content: "› ";
}

.uvq12-kc .pn::after {
  content: "▌";
  margin-left: .15em;
  animation: uvq12-kc-b 1s steps(1,end) infinite;
}

@keyframes uvq12-kc {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}

@keyframes uvq12-kc-b {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq12-kc,.uvq12-kc *,.uvq12-kc *::before,.uvq12-kc *::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 ps=[...el.querySelectorAll('[role="tabpanel"]')];const tb=[...el.querySelectorAll('[role="tab"]')];const sel=(t,f)=>{const i=tb.indexOf(t);tb.forEach((x,j)=>{x.setAttribute("aria-selected",String(j===i));x.tabIndex=j===i?0:-1});ps.forEach((p,j)=>{p.hidden=j!==i});if(f)t.focus()};tb.forEach(t=>t.addEventListener("click",()=>sel(t)));el.addEventListener("keydown",e=>{const i=tb.indexOf(document.activeElement);if(i<0)return;const n={ArrowRight:i+1,ArrowDown:i+1,ArrowLeft:i-1,ArrowUp:i-1,Home:0,End:tb.length-1}[e.key];if(n===undefined)return;e.preventDefault();sel(tb[(n+tb.length)%tb.length],1)});
const press=t=>{t.classList.add("dn");setTimeout(()=>t.classList.remove("dn"),120)};
el.addEventListener("keydown",e=>{const n=+e.key;if(n>=1&&n<=tb.length&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault();press(tb[n-1]);sel(tb[n-1],1)}if((e.key===" "||e.key==="Enter")&&tb.includes(document.activeElement))press(document.activeElement)})
}

export default function NavKeycaps() {
  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": "#f97316",
          "--c2": "#2a2826",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq12-kc"><div className="ks" role="tablist" aria-label="Shortcuts"><button type="button" role="tab" id="uvq12-kc-t0" aria-selected="true" aria-controls="uvq12-kc-p0" tabIndex={0} aria-keyshortcuts="1"><span className="cap"><b>1</b><span>Home</span><i className="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t1" aria-selected="false" aria-controls="uvq12-kc-p1" tabIndex={-1} aria-keyshortcuts="2"><span className="cap"><b>2</b><span>Projects</span><i className="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t2" aria-selected="false" aria-controls="uvq12-kc-p2" tabIndex={-1} aria-keyshortcuts="3"><span className="cap"><b>3</b><span>Notes</span><i className="led" aria-hidden="true"></i></span></button><button type="button" role="tab" id="uvq12-kc-t3" aria-selected="false" aria-controls="uvq12-kc-p3" tabIndex={-1} aria-keyshortcuts="4"><span className="cap"><b>4</b><span>Settings</span><i className="led" aria-hidden="true"></i></span></button></div><div className="sc"><div className="pn" role="tabpanel" id="uvq12-kc-p0" aria-labelledby="uvq12-kc-t0">You have 3 new alerts.</div><div className="pn" role="tabpanel" id="uvq12-kc-p1" aria-labelledby="uvq12-kc-t1" hidden={true}>12 active projects.</div><div className="pn" role="tabpanel" id="uvq12-kc-p2" aria-labelledby="uvq12-kc-t2" hidden={true}>Last note 5 min ago.</div><div className="pn" role="tabpanel" id="uvq12-kc-p3" aria-labelledby="uvq12-kc-t3" hidden={true}>Theme, language and shortcuts.</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.
````
