Overlays & feedback / Toasts & snackbars
Square Outline Cookie Panel
Floating bottom-right panel with a square 1px ink border over the grey canvas, a heavy serif title, small body copy, a hairline, then Deny all text link, Settings outline pill and Accept all solid pill.
Rebuilt from epic.net in the Gallery Graphite Editorial style.
npx shadcn@latest add https://justyoink.it/r/gallery-graphite-editorial/blocks/outlined-cookie-panel.json
Looks exactly like epic.net: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/gallery-graphite-editorial/mine/outlined-cookie-panel.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: title, body, denyLabel, settingsLabel, acceptLabel and onDeny/onSettings/onAccept callbacks. Deny and Accept dismiss the panel; it is fixed bottom-right (full width on mobile).
components/outlined-cookie-panel.tsx
import { useState } from "react"; export default function SquareOutlineCookiePanel({ title = "We value your privacy", body = "We use cookies and similar technologies to personalise content, study how the site is used and improve your experience. By continuing to browse you agree to their use.", denyLabel = "Deny all", settingsLabel = "Settings", acceptLabel = "Accept all", onDeny, onSettings, onAccept, }: { title?: string; body?: string; denyLabel?: string; settingsLabel?: string; acceptLabel?: string; onDeny?: () => void; onSettings?: () => void; onAccept?: () => void; }) { const [open, setOpen] = useState(true); if (!open) return null; const close = (cb?: () => void) => () => { cb?.(); setOpen(false); }; const focus = "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink"; return ( <div className="fixed inset-x-4 bottom-4 z-50 sm:inset-x-auto sm:right-4 sm:w-[360px]"> <section role="dialog" aria-label="Cookie consent" className="animate-popup-in border border-ink bg-canvas p-5 text-ink shadow-[0_10px_30px_-12px_rgba(0,0,0,0.25)]" > <h2 className="font-display text-[32px] font-black leading-[0.95] tracking-[-0.01em]">{title}</h2> <p className="mt-4 font-sans text-[11px] leading-[1.5]">{body}</p> <hr className="mt-5 border-0 border-t border-ink" /> <div className="mt-4 flex items-center justify-between gap-2"> <button type="button" onClick={close(onDeny)} className={`font-sans text-[10px] font-medium uppercase tracking-[0.06em] hover:underline ${focus}`} > {denyLabel} </button> <div className="flex items-center gap-2"> <button type="button" onClick={onSettings} className={`rounded-full border border-ink px-4 py-2 font-sans text-[10px] font-medium uppercase tracking-[0.06em] transition-colors duration-300 hover:bg-ink hover:text-canvas ${focus}`} > {settingsLabel} </button> <button type="button" onClick={close(onAccept)} className={`rounded-full border border-ink bg-ink px-4 py-2 font-sans text-[10px] font-medium uppercase tracking-[0.06em] text-canvas transition-colors duration-300 hover:bg-transparent hover:text-ink ${focus}`} > {acceptLabel} </button> </div> </div> </section> </div> ); }import { useState } from "react"; export default function SquareOutlineCookiePanel({ title = "We value your privacy", body = "We use cookies and similar technologies to personalise content, study how the site is used and improve your experience. By continuing to browse you agree to their use.", denyLabel = "Deny all", settingsLabel = "Settings", acceptLabel = "Accept all", onDeny, onSettings, onAccept, }: { title?: string; body?: string; denyLabel?: string; settingsLabel?: string; acceptLabel?: string; onDeny?: () => void; onSettings?: () => void; onAccept?: () => void; }) { const [open, setOpen] = useState(true); if (!open) return null; const close = (cb?: () => void) => () => { cb?.(); setOpen(false); }; const focus = "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground"; return ( <div className="fixed inset-x-4 bottom-4 z-50 sm:inset-x-auto sm:right-4 sm:w-[360px]"> <section role="dialog" aria-label="Cookie consent" className="animate-gallery-popup-in border border-foreground bg-background p-5 text-foreground shadow-[0_10px_30px_-12px_rgba(0,0,0,0.25)]" > <h2 className="font-sans text-[32px] font-black leading-[0.95] tracking-[-0.01em]">{title}</h2> <p className="mt-4 font-sans text-[11px] leading-[1.5]">{body}</p> <hr className="mt-5 border-0 border-t border-foreground" /> <div className="mt-4 flex items-center justify-between gap-2"> <button type="button" onClick={close(onDeny)} className={`font-sans text-[10px] font-medium uppercase tracking-[0.06em] hover:underline ${focus}`} > {denyLabel} </button> <div className="flex items-center gap-2"> <button type="button" onClick={onSettings} className={`rounded-full border border-foreground px-4 py-2 font-sans text-[10px] font-medium uppercase tracking-[0.06em] transition-colors duration-300 hover:bg-primary hover:text-primary-foreground ${focus}`} > {settingsLabel} </button> <button type="button" onClick={close(onAccept)} className={`rounded-full border border-foreground bg-primary px-4 py-2 font-sans text-[10px] font-medium uppercase tracking-[0.06em] text-primary-foreground transition-colors duration-300 hover:bg-transparent hover:text-primary-foreground ${focus}`} > {acceptLabel} </button> </div> </div> </section> </div> ); }
Quality checks
Automated, in a real browser · 4d ago- 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: passedIts animation plays and finishes with everything visible, and it stays still for people who turn on reduced motion.