# Terminal breadcrumb

> A terminal path works as a breadcrumb: click a folder and the cd command types itself, the prompt updates and its contents appear.

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

## Where to use it

A breadcrumb for developers, drawn as a terminal prompt. Every folder in the path is clickable, and so is every folder listed below it. Clicking types the right cd command letter by letter, moves it into the history, updates the prompt and lists the new folder. Backspace goes up one level. It suits docs for command line tools, file browsers and portfolios.

The main color sets the prompt and the secondary color the folders. Replace the small file system object in the script with your own structure, and keep folder names short.

## Code

### HTML

```html
<div class="uvq12-sh" aria-label="Terminal" role="group"><div class="tb" aria-hidden="true"><i></i><i></i><i></i><span>zsh</span></div><div class="bd"><div class="hs"></div><div class="pr"><span class="u">ana@mac</span>:<nav class="pa" aria-label="Breadcrumb" aria-live="polite"><button type="button">~</button>/<button type="button">code</button>/<button type="button">web</button>/<button type="button">src</button>/<button type="button" aria-current="location">components</button></nav><span class="u">$</span> <span class="cm"></span><span class="cr" aria-hidden="true"></span></div><ul class="ls" aria-label="Content"><li><span>Button.tsx</span></li><li><span>Nav.tsx</span></li></ul></div></div>
```

### CSS

```css
.uvq12-sh {
  --c1: #3fb950;
  --c2: #58a6ff;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq12-sh {
  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;
  border-radius: .8em;
  overflow: hidden;
  color: #c9d1d9;
  background: #0d1117;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq12-sh .tb {
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .55em .8em;
  background: #161b22;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.uvq12-sh .tb i {
  width: .65em;
  height: .65em;
  border-radius: 50%;
  background: #ff5f57;
}

.uvq12-sh .tb i:nth-child(2) {
  background: #febc2e;
}

.uvq12-sh .tb i:nth-child(3) {
  background: #28c840;
}

.uvq12-sh .tb span {
  flex: 1;
  margin-right: 2em;
  text-align: center;
  font-size: .68em;
  color: #8b949e;
}

.uvq12-sh .bd {
  height: 9.6em;
  padding: .7em .85em;
  font-size: .76em;
  line-height: 1.6;
  overflow: hidden;
}

.uvq12-sh .hs div {
  color: #8b949e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: uvq12-sh calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-sh .pr {
  white-space: normal;
  word-break: break-all;
}

.uvq12-sh .u {
  color: var(--c1);
  font-weight: 700;
}

.uvq12-sh .pa {
  display: inline;
}

.uvq12-sh .pa button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 .05em;
  border-radius: .2em;
  color: var(--c2);
  font-weight: 700;
}

.uvq12-sh .pa button:hover {
  background: color-mix(in srgb,var(--c2) 18%,transparent);
  text-decoration: underline;
}

.uvq12-sh .pa button:last-child {
  color: #e6edf3;
  cursor: default;
}

.uvq12-sh .pa button:last-child:hover {
  background: none;
  text-decoration: none;
}

.uvq12-sh .cm {
  color: #e6edf3;
}

.uvq12-sh .cr {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  vertical-align: -.2em;
  background: #e6edf3;
  animation: uvq12-sh-b 1s steps(1,end) infinite;
}

.uvq12-sh .ls {
  display: flex;
  flex-wrap: wrap;
  gap: .1em 1.1em;
  margin: .2em 0 0;
  padding: 0;
  list-style: none;
}

.uvq12-sh .ls li {
  animation: uvq12-sh calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1) both;
}

.uvq12-sh .ls button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 .1em;
  border-radius: .2em;
  color: var(--c2);
  font-weight: 700;
}

.uvq12-sh .ls button:hover {
  background: color-mix(in srgb,var(--c2) 18%,transparent);
}

.uvq12-sh .ls span {
  color: #8b949e;
}

.uvq12-sh button:active {
  transform: translateY(1px);
}

.uvq12-sh button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 1px;
}

@keyframes uvq12-sh {
  from {
    opacity: 0;
  }
}

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

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

### JavaScript

```js
document.querySelectorAll(".uvq12-sh").forEach(el => {
  const FS={"~":["code","docs","notes.txt"],"~/code":["web","app","scripts"],"~/code/web":["src","public","package.json"],"~/code/web/src":["components","styles","main.ts"],"~/code/web/src/components":["Button.tsx","Nav.tsx"],"~/code/web/src/styles":["base.css"],"~/code/web/public":["logo.svg"],"~/code/app":["ios","android"],"~/code/app/ios":["App.swift"],"~/code/app/android":["Main.kt"],"~/code/scripts":["deploy.sh"],"~/docs":["cv.pdf","ideas.md"]};
const pa=el.querySelector(".pa"),cm=el.querySelector(".cm"),ls=el.querySelector(".ls"),hs=el.querySelector(".hs"),tms=[];let cwd="~/code/web/src/components",busy=false;
const K=()=>parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;
const mk=(t,c)=>{const b=document.createElement("button");b.type="button";b.textContent=t;if(c)b.addEventListener("click",c);return b};
const render=()=>{pa.textContent="";const parts=cwd.split("/");parts.forEach((p,i)=>{if(i)pa.append("/");const b=mk(p,i<parts.length-1?()=>cd(parts.slice(0,i+1).join("/")):null);if(i===parts.length-1)b.setAttribute("aria-current","location");pa.append(b)});ls.textContent="";(FS[cwd]||[]).forEach((n,i)=>{const li=document.createElement("li");li.style.animationDelay=(i*40)+"ms";if(FS[cwd+"/"+n])li.append(mk(n+"/",()=>cd(cwd+"/"+n)));else{const s=document.createElement("span");s.textContent=n;li.append(s)}ls.append(li)})};
const rel=to=>{if(to.startsWith(cwd+"/"))return to.slice(cwd.length+1);const up=cwd.split("/").length-to.split("/").length;return Array(up).fill("..").join("/")};
const cd=to=>{if(busy||to===cwd)return;busy=true;const c="cd "+rel(to);let i=0;const back=el.contains(document.activeElement);const tick=()=>{cm.textContent=c.slice(0,++i);if(i<c.length)tms.push(setTimeout(tick,(38+Math.random()*40)/K()));else tms.push(setTimeout(()=>{const h=document.createElement("div");h.textContent="ana@mac:"+cwd+"$ "+c;hs.append(h);while(hs.children.length>2)hs.firstChild.remove();cm.textContent="";cwd=to;render();busy=false;if(back){const f=ls.querySelector("button")||pa.querySelector("button");if(f)f.focus()}},160/K()))};tick()};
el.addEventListener("keydown",e=>{if(e.key==="Backspace"&&cwd!=="~"){e.preventDefault();cd(cwd.split("/").slice(0,-1).join("/"))}});
render();return()=>tms.forEach(clearTimeout)
});
```

### 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-sh {
  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;
  border-radius: .8em;
  overflow: hidden;
  color: #c9d1d9;
  background: #0d1117;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq12-sh .tb {
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .55em .8em;
  background: #161b22;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.uvq12-sh .tb i {
  width: .65em;
  height: .65em;
  border-radius: 50%;
  background: #ff5f57;
}

.uvq12-sh .tb i:nth-child(2) {
  background: #febc2e;
}

.uvq12-sh .tb i:nth-child(3) {
  background: #28c840;
}

.uvq12-sh .tb span {
  flex: 1;
  margin-right: 2em;
  text-align: center;
  font-size: .68em;
  color: #8b949e;
}

.uvq12-sh .bd {
  height: 9.6em;
  padding: .7em .85em;
  font-size: .76em;
  line-height: 1.6;
  overflow: hidden;
}

.uvq12-sh .hs div {
  color: #8b949e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: uvq12-sh calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-sh .pr {
  white-space: normal;
  word-break: break-all;
}

.uvq12-sh .u {
  color: var(--c1);
  font-weight: 700;
}

.uvq12-sh .pa {
  display: inline;
}

.uvq12-sh .pa button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 .05em;
  border-radius: .2em;
  color: var(--c2);
  font-weight: 700;
}

.uvq12-sh .pa button:hover {
  background: color-mix(in srgb,var(--c2) 18%,transparent);
  text-decoration: underline;
}

.uvq12-sh .pa button:last-child {
  color: #e6edf3;
  cursor: default;
}

.uvq12-sh .pa button:last-child:hover {
  background: none;
  text-decoration: none;
}

.uvq12-sh .cm {
  color: #e6edf3;
}

.uvq12-sh .cr {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  vertical-align: -.2em;
  background: #e6edf3;
  animation: uvq12-sh-b 1s steps(1,end) infinite;
}

.uvq12-sh .ls {
  display: flex;
  flex-wrap: wrap;
  gap: .1em 1.1em;
  margin: .2em 0 0;
  padding: 0;
  list-style: none;
}

.uvq12-sh .ls li {
  animation: uvq12-sh calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1) both;
}

.uvq12-sh .ls button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 .1em;
  border-radius: .2em;
  color: var(--c2);
  font-weight: 700;
}

.uvq12-sh .ls button:hover {
  background: color-mix(in srgb,var(--c2) 18%,transparent);
}

.uvq12-sh .ls span {
  color: #8b949e;
}

.uvq12-sh button:active {
  transform: translateY(1px);
}

.uvq12-sh button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 1px;
}

@keyframes uvq12-sh {
  from {
    opacity: 0;
  }
}

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

@media (prefers-reduced-motion:reduce) {
  .uvq12-sh,.uvq12-sh *,.uvq12-sh *::before,.uvq12-sh *::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 FS={"~":["code","docs","notes.txt"],"~/code":["web","app","scripts"],"~/code/web":["src","public","package.json"],"~/code/web/src":["components","styles","main.ts"],"~/code/web/src/components":["Button.tsx","Nav.tsx"],"~/code/web/src/styles":["base.css"],"~/code/web/public":["logo.svg"],"~/code/app":["ios","android"],"~/code/app/ios":["App.swift"],"~/code/app/android":["Main.kt"],"~/code/scripts":["deploy.sh"],"~/docs":["cv.pdf","ideas.md"]};
const pa=el.querySelector(".pa"),cm=el.querySelector(".cm"),ls=el.querySelector(".ls"),hs=el.querySelector(".hs"),tms=[];let cwd="~/code/web/src/components",busy=false;
const K=()=>parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;
const mk=(t,c)=>{const b=document.createElement("button");b.type="button";b.textContent=t;if(c)b.addEventListener("click",c);return b};
const render=()=>{pa.textContent="";const parts=cwd.split("/");parts.forEach((p,i)=>{if(i)pa.append("/");const b=mk(p,i<parts.length-1?()=>cd(parts.slice(0,i+1).join("/")):null);if(i===parts.length-1)b.setAttribute("aria-current","location");pa.append(b)});ls.textContent="";(FS[cwd]||[]).forEach((n,i)=>{const li=document.createElement("li");li.style.animationDelay=(i*40)+"ms";if(FS[cwd+"/"+n])li.append(mk(n+"/",()=>cd(cwd+"/"+n)));else{const s=document.createElement("span");s.textContent=n;li.append(s)}ls.append(li)})};
const rel=to=>{if(to.startsWith(cwd+"/"))return to.slice(cwd.length+1);const up=cwd.split("/").length-to.split("/").length;return Array(up).fill("..").join("/")};
const cd=to=>{if(busy||to===cwd)return;busy=true;const c="cd "+rel(to);let i=0;const back=el.contains(document.activeElement);const tick=()=>{cm.textContent=c.slice(0,++i);if(i<c.length)tms.push(setTimeout(tick,(38+Math.random()*40)/K()));else tms.push(setTimeout(()=>{const h=document.createElement("div");h.textContent="ana@mac:"+cwd+"$ "+c;hs.append(h);while(hs.children.length>2)hs.firstChild.remove();cm.textContent="";cwd=to;render();busy=false;if(back){const f=ls.querySelector("button")||pa.querySelector("button");if(f)f.focus()}},160/K()))};tick()};
el.addEventListener("keydown",e=>{if(e.key==="Backspace"&&cwd!=="~"){e.preventDefault();cd(cwd.split("/").slice(0,-1).join("/"))}});
render();return()=>tms.forEach(clearTimeout)
}

export default function NavShellCrumbs() {
  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": "#3fb950",
          "--c2": "#58a6ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq12-sh" aria-label="Terminal" role="group"><div className="tb" aria-hidden="true"><i></i><i></i><i></i><span>zsh</span></div><div className="bd"><div className="hs"></div><div className="pr"><span className="u">ana@mac</span>:<nav className="pa" aria-label="Breadcrumb" aria-live="polite"><button type="button">~</button>/<button type="button">code</button>/<button type="button">web</button>/<button type="button">src</button>/<button type="button" aria-current="location">components</button></nav><span className="u">$</span> <span className="cm"></span><span className="cr" aria-hidden="true"></span></div><ul className="ls" aria-label="Content"><li><span>Button.tsx</span></li><li><span>Nav.tsx</span></li></ul></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 “Terminal breadcrumb” block (Navigation) from AIMRAN Library to my project.

## What it is
A terminal path works as a breadcrumb: click a folder and the cd command types itself, the prompt updates and its contents appear.

## Chosen settings
- Main color: #3fb950
- Secondary color: #58a6ff
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Terminal"

## 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-sh {
  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;
  border-radius: .8em;
  overflow: hidden;
  color: #c9d1d9;
  background: #0d1117;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08),0 1.2em 2.4em -1.2em rgba(0,0,0,.6);
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

.uvq12-sh .tb {
  display: flex;
  align-items: center;
  gap: .4em;
  padding: .55em .8em;
  background: #161b22;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.uvq12-sh .tb i {
  width: .65em;
  height: .65em;
  border-radius: 50%;
  background: #ff5f57;
}

.uvq12-sh .tb i:nth-child(2) {
  background: #febc2e;
}

.uvq12-sh .tb i:nth-child(3) {
  background: #28c840;
}

.uvq12-sh .tb span {
  flex: 1;
  margin-right: 2em;
  text-align: center;
  font-size: .68em;
  color: #8b949e;
}

.uvq12-sh .bd {
  height: 9.6em;
  padding: .7em .85em;
  font-size: .76em;
  line-height: 1.6;
  overflow: hidden;
}

.uvq12-sh .hs div {
  color: #8b949e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: uvq12-sh calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq12-sh .pr {
  white-space: normal;
  word-break: break-all;
}

.uvq12-sh .u {
  color: var(--c1);
  font-weight: 700;
}

.uvq12-sh .pa {
  display: inline;
}

.uvq12-sh .pa button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 .05em;
  border-radius: .2em;
  color: var(--c2);
  font-weight: 700;
}

.uvq12-sh .pa button:hover {
  background: color-mix(in srgb,var(--c2) 18%,transparent);
  text-decoration: underline;
}

.uvq12-sh .pa button:last-child {
  color: #e6edf3;
  cursor: default;
}

.uvq12-sh .pa button:last-child:hover {
  background: none;
  text-decoration: none;
}

.uvq12-sh .cm {
  color: #e6edf3;
}

.uvq12-sh .cr {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  vertical-align: -.2em;
  background: #e6edf3;
  animation: uvq12-sh-b 1s steps(1,end) infinite;
}

.uvq12-sh .ls {
  display: flex;
  flex-wrap: wrap;
  gap: .1em 1.1em;
  margin: .2em 0 0;
  padding: 0;
  list-style: none;
}

.uvq12-sh .ls li {
  animation: uvq12-sh calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1) both;
}

.uvq12-sh .ls button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 .1em;
  border-radius: .2em;
  color: var(--c2);
  font-weight: 700;
}

.uvq12-sh .ls button:hover {
  background: color-mix(in srgb,var(--c2) 18%,transparent);
}

.uvq12-sh .ls span {
  color: #8b949e;
}

.uvq12-sh button:active {
  transform: translateY(1px);
}

.uvq12-sh button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 1px;
}

@keyframes uvq12-sh {
  from {
    opacity: 0;
  }
}

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

@media (prefers-reduced-motion:reduce) {
  .uvq12-sh,.uvq12-sh *,.uvq12-sh *::before,.uvq12-sh *::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 FS={"~":["code","docs","notes.txt"],"~/code":["web","app","scripts"],"~/code/web":["src","public","package.json"],"~/code/web/src":["components","styles","main.ts"],"~/code/web/src/components":["Button.tsx","Nav.tsx"],"~/code/web/src/styles":["base.css"],"~/code/web/public":["logo.svg"],"~/code/app":["ios","android"],"~/code/app/ios":["App.swift"],"~/code/app/android":["Main.kt"],"~/code/scripts":["deploy.sh"],"~/docs":["cv.pdf","ideas.md"]};
const pa=el.querySelector(".pa"),cm=el.querySelector(".cm"),ls=el.querySelector(".ls"),hs=el.querySelector(".hs"),tms=[];let cwd="~/code/web/src/components",busy=false;
const K=()=>parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;
const mk=(t,c)=>{const b=document.createElement("button");b.type="button";b.textContent=t;if(c)b.addEventListener("click",c);return b};
const render=()=>{pa.textContent="";const parts=cwd.split("/");parts.forEach((p,i)=>{if(i)pa.append("/");const b=mk(p,i<parts.length-1?()=>cd(parts.slice(0,i+1).join("/")):null);if(i===parts.length-1)b.setAttribute("aria-current","location");pa.append(b)});ls.textContent="";(FS[cwd]||[]).forEach((n,i)=>{const li=document.createElement("li");li.style.animationDelay=(i*40)+"ms";if(FS[cwd+"/"+n])li.append(mk(n+"/",()=>cd(cwd+"/"+n)));else{const s=document.createElement("span");s.textContent=n;li.append(s)}ls.append(li)})};
const rel=to=>{if(to.startsWith(cwd+"/"))return to.slice(cwd.length+1);const up=cwd.split("/").length-to.split("/").length;return Array(up).fill("..").join("/")};
const cd=to=>{if(busy||to===cwd)return;busy=true;const c="cd "+rel(to);let i=0;const back=el.contains(document.activeElement);const tick=()=>{cm.textContent=c.slice(0,++i);if(i<c.length)tms.push(setTimeout(tick,(38+Math.random()*40)/K()));else tms.push(setTimeout(()=>{const h=document.createElement("div");h.textContent="ana@mac:"+cwd+"$ "+c;hs.append(h);while(hs.children.length>2)hs.firstChild.remove();cm.textContent="";cwd=to;render();busy=false;if(back){const f=ls.querySelector("button")||pa.querySelector("button");if(f)f.focus()}},160/K()))};tick()};
el.addEventListener("keydown",e=>{if(e.key==="Backspace"&&cwd!=="~"){e.preventDefault();cd(cwd.split("/").slice(0,-1).join("/"))}});
render();return()=>tms.forEach(clearTimeout)
}

export default function NavShellCrumbs() {
  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": "#3fb950",
          "--c2": "#58a6ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq12-sh" aria-label="Terminal" role="group"><div className="tb" aria-hidden="true"><i></i><i></i><i></i><span>zsh</span></div><div className="bd"><div className="hs"></div><div className="pr"><span className="u">ana@mac</span>:<nav className="pa" aria-label="Breadcrumb" aria-live="polite"><button type="button">~</button>/<button type="button">code</button>/<button type="button">web</button>/<button type="button">src</button>/<button type="button" aria-current="location">components</button></nav><span className="u">$</span> <span className="cm"></span><span className="cr" aria-hidden="true"></span></div><ul className="ls" aria-label="Content"><li><span>Button.tsx</span></li><li><span>Nav.tsx</span></li></ul></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.
````
