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.
npx shadcn@latest add https://justyoink.it/r/embossed-lab-monochrome/mine/cart-tab-overlay.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
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> ); }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-background p-6 font-mono text-foreground"> <button type="button" onClick={add} className="rounded-lg border border-foreground/40 px-4 py-2 text-embossed-caption lowercase transition-opacity duration-embossed-tile-hover ease-embossed-tile-hover hover:opacity-70 focus-visible:outline focus-visible:outline-2 focus-visible:outline-embossed-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-embossed-accent-green pt-1 text-embossed-caption text-foreground transition-transform duration-embossed-tile-hover ease-embossed-tile-hover hover:-translate-y-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground ${pulse ? "animate-embossed-bulge" : ""}`} > <span className="absolute -top-2 h-4 w-5 rounded-t-full border-2 border-b-0 border-embossed-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- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.