Buttons & actions / Floating buttons

Green Cart Tab

Small green rounded-top tab fixed at bottom-right edge resembling a bag, 3.25vw wide, used as cart shortcut.

Rebuilt from teenage.engineering/newsletter in the Embossed Lab Monochrome style.

npx shadcn@latest add https://justyoink.it/r/embossed-lab-monochrome/blocks/cart-tab-overlay.json

Looks exactly like teenage.engineering: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Props: count (initial items), label (aria label), href (cart link). The tab is fixed bottom-right; clicking the demo 'add item' button increments the count and triggers the bulge pulse.

components/cart-tab-overlay.tsx
import { useState } from "react";

export default function GreenCartTab(props: { count?: number; label?: string; href?: string }) {
  const { count = 0, label = "open cart", href = "#cart" } = props;
  const [items, setItems] = useState(count);
  const [pulse, setPulse] = useState(false);

  const add = () => {
    setItems((n) => n + 1);
    setPulse(false);
    requestAnimationFrame(() => setPulse(true));
  };

  return (
    <div className="relative min-h-[240px] w-full bg-canvas p-6 font-sans text-on-dark">
      <button
        type="button"
        onClick={add}
        className="rounded-soft border border-on-dark/40 px-4 py-2 text-caption lowercase transition-opacity duration-tile-hover ease-tile-hover hover:opacity-70 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-green"
      >
        add item
      </button>
      <a
        href={href}
        aria-label={`${label}${items ? `, ${items} items` : ""}`}
        onAnimationEnd={() => setPulse(false)}
        className={`fixed bottom-0 right-3 flex h-[22px] w-[max(2.75rem,3.25vw)] items-start justify-center rounded-t-[14px] bg-accent-green pt-1 text-caption text-white transition-transform duration-tile-hover ease-tile-hover hover:-translate-y-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white ${pulse ? "animate-bulge" : ""}`}
      >
        <span className="absolute -top-2 h-4 w-5 rounded-t-full border-2 border-b-0 border-accent-green" aria-hidden="true" />
        {items > 0 && <span className="relative text-[11px] leading-none">{items}</span>}
      </a>
    </div>
  );
}

Quality checks

Automated, in a real browser · today
—

More from Embossed Lab Monochrome

The whole style →

Pictogram Mega Nav Bar

Headers & nav bars

Centered Link Footer

Footers

Embossed Advent Tile Grid

Feature sections

Embossed Relief Tile

Cards

Centered Uppercase Intro Panel

Heroes

Quiet Countdown Readout

Stats & metrics