Row actions revealed by a swipe for quick phone triage
Swipe a lead, or its menu (…) · Q A S E act · Delete · Z undoes
pnpm dlx shadcn@latest add @notchset-pro/swipe-actionsA row's actions in two trays behind a swipe, mirrored in its menu and keys.
Every shadcn style · one file
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { Archive, BadgeCheck, Clock, Ellipsis, Trash2, UserRoundPlus } from "@/lib/notchset/icons";
import { Avatar } from "@/components/ui/notchset/avatar";
import { Card } from "@/components/ui/notchset/card";
import { CompanyMark } from "@/components/ui/notchset/company-mark";
import { SwipeActions, type SwipeAction } from "@/components/ui/notchset/swipe-actions";
import { notify, Toaster } from "@/components/ui/notchset/toast";
import { brandGlyph } from "./brands";
import { useLessMotion } from "@/lib/notchset/motion";
import { useSelfPlay } from "./self-play";
/*
* The Leads on a phone: swipe a lead right for Qualify and Assign to me, left for Snooze, Delete and Archive; all the
* way right qualifies it, all the way left archives it (a delete is never the long swipe). Assign and Snooze keep the
* lead and change it: Maya's face hops in, a "Back Mon" chip lands. Each action says what it did once, with Undo for
* 5s; an undone lead comes back from the side it left. Every action is also in the lead's menu (…) and, on a focused
* lead, its key: Q A S E, Delete, and Z to undo. The looks: the Leads, and the worst case (German words: the tiles
* go to icons alone). The rows alone, each whole. Shown once, the second lead slides open to its trailing tray
* (Snooze, Delete, Archive; the long swipe is Archive, the safe one) and lands there.
*/
type Lead = { id: string; who: string; co: string; color: string; when: string; subject: string; preview: string; owner?: string; back?: boolean };
type Act = "qualify" | "assign" | "snooze" | "delete" | "archive";
const ME = "Maya Lindqvist";
const FACE: Record<string, string> = {
"Kevin Ito": "https://notchset.dev/media/people/person-08.webp",
"Priya Raman": "https://notchset.dev/media/people/person-01.webp",
"Marcus Bell": "https://notchset.dev/media/people/person-02.webp",
"Ana Ruiz": "https://notchset.dev/media/people/person-05.webp",
"Ines Duarte": "https://notchset.dev/media/people/person-07.webp",
"Lena Ortiz": "https://notchset.dev/media/people/person-04.webp",
"Maya Lindqvist": "https://notchset.dev/media/people/person-03.webp",
};
const LEADS: Lead[] = [
{ id: "l1", who: "Kevin Ito", co: "Airtable", color: "#fcb400", when: "9:41", subject: "40 seats on the Team plan", preview: "Can we start on Team and move up to Business in Q1?" },
{ id: "l2", who: "Priya Raman", co: "Linear", color: "#5e6ad2", when: "9:12", subject: "Security review", preview: "Our IT team needs the SOC 2 report before Friday." },
{ id: "l3", who: "Marcus Bell", co: "Webflow", color: "#146ef5", when: "8:47", subject: "Agency partner program", preview: "Four of our clients asked about Notchset this month." },
{ id: "l4", who: "Ana Ruiz", co: "Shopify", color: "#5e8e3e", when: "Yesterday", subject: "A pilot in Berlin", preview: "The retail team would like a two-week pilot first." },
{ id: "l5", who: "Ines Duarte", co: "Stripe", color: "#635bff", when: "Yesterday", subject: "Intro from Maya", preview: "Maya said you could help with our pipeline reviews." },
{ id: "l6", who: "Lena Ortiz", co: "Notion", color: "#191919", when: "Mon", subject: "Renewal terms", preview: "Happy to sign for two years if onboarding is included." },
];
const EN = {
title: "Leads",
tile: { qualify: "Qualify", assign: "Assign", snooze: "Snooze", delete: "Delete", archive: "Archive" },
menu: { qualify: "Qualify", assign: "Assign to me", snooze: "Snooze until Monday", delete: "Delete", archive: "Archive" },
more: "More actions for {who}",
undo: "Undo",
toast: { qualify: "{who} is in Deals", assign: "Assigned to you", snooze: "Snoozed until Mon", delete: "Deleted", archive: "Archived" },
chip: "Back Mon",
yours: "Yours",
clear: "All triaged",
clearHint: "New leads land here.",
};
const DE: typeof EN = {
title: "Leads",
tile: { qualify: "Qualifizieren", assign: "Zuweisen", snooze: "Später", delete: "Löschen", archive: "Archivieren" },
menu: { qualify: "Qualifizieren", assign: "Mir zuweisen", snooze: "Bis Montag zurückstellen", delete: "Löschen", archive: "Archivieren" },
more: "Weitere Aktionen für {who}",
undo: "Rückgängig",
toast: { qualify: "{who} ist in Deals", assign: "Dir zugewiesen", snooze: "Zurückgestellt bis Mo.", delete: "Gelöscht", archive: "Archiviert" },
chip: "Zurück Mo.",
yours: "Deins",
clear: "Alles gesichtet",
clearHint: "Neue Leads landen hier.",
};
const fill = (s: string, v: Record<string, string | number>) => s.replace(/\{(\w+)\}/g, (_, k: string) => String(v[k] ?? ""));
const LEAVES: Record<Act, boolean> = { qualify: true, assign: false, snooze: false, delete: true, archive: true };
/* the worst case (?qa=worst) swaps in the German words */
const LOOK = "leads" as "leads" | "worst";
export default function SwipeActionsDemo() {
const look = LOOK;
const leads = LEADS;
const w = look === "worst" ? DE : EN;
const root = React.useRef<HTMLDivElement>(null);
const play = useSelfPlay(root, { beats: [0], off: useLessMotion() });
return (
<div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} className="w-[min(100%,400px)]">
<Card inset className="overflow-visible p-0">
<Inbox key={look} leads={leads.slice(0, 4)} w={w} opened={play.step >= 0 ? leads[1]?.id : undefined} />
</Card>
<Toaster />
</div>
);
}
function Inbox({ leads: start, w, opened }: { leads: Lead[]; w: typeof EN; opened?: string | undefined }) {
const [leads, setLeads] = React.useState(start);
const [back, setBack] = React.useState<{ id: string; side: "leading" | "trailing" } | null>(null);
const [said, setSaid] = React.useState("");
const [undoLast, setUndoLast] = React.useState<{ run: () => void } | null>(null);
const acted = (lead: Lead, a: Act) => {
const at = leads.findIndex((l) => l.id === lead.id);
const before = leads;
if (LEAVES[a]) setLeads((ls) => ls.filter((l) => l.id !== lead.id));
else setLeads((ls) => ls.map((l) => (l.id === lead.id ? (a === "assign" ? { ...l, owner: ME } : { ...l, back: true }) : l)));
const undo = () => {
setUndoLast(null);
if (LEAVES[a]) setBack({ id: lead.id, side: a === "qualify" ? "leading" : "trailing" });
setLeads(() => {
if (!LEAVES[a]) return before;
const next = before.filter((l) => l.id !== lead.id);
next.splice(at, 0, lead);
return next;
});
};
setUndoLast({ run: undo });
const title = fill(w.toast[a], { who: lead.who });
setSaid(`${lead.who}: ${title}`);
notify({ title, action: { kind: "undo", label: w.undo, onClick: undo } }, { ms: 5000 });
};
const actionsOf = (lead: Lead) => {
const make = (a: Act, icon: SwipeAction["icon"], tone: SwipeAction["tone"], shortcut: string): SwipeAction => ({ key: a, label: w.menu[a], short: w.tile[a], icon, tone, shortcut, leaves: LEAVES[a], onRun: () => acted(lead, a) });
return {
leading: [make("qualify", BadgeCheck, "signal", "Q"), make("assign", UserRoundPlus, undefined, "A")],
trailing: [make("snooze", Clock, undefined, "S"), make("delete", Trash2, "bad", "Delete"), make("archive", Archive, "ink", "E")],
};
};
return (
<div
onKeyDown={(e) => {
if (e.key.toLowerCase() === "z" && !e.metaKey && !e.ctrlKey && undoLast) {
e.preventDefault();
undoLast.run();
}
}}
>
<span role="status" className="sr-only">{said}</span>
<ul aria-label={w.title} data-swipe-off="" className="m-0 min-h-[352px] list-none p-0">
{leads.map((lead) => {
const { leading, trailing } = actionsOf(lead);
return (
<li key={lead.id} className="border-b border-[var(--ns-line-soft)] last:border-b-0">
<SwipeActions label={fill(w.more, { who: lead.who })} swipe="any" keys show={opened === lead.id ? "short" : undefined} leading={leading} trailing={trailing} arriveFrom={back?.id === lead.id ? back.side : undefined}>
<div tabIndex={0} aria-label={`${lead.who}, ${lead.co}. ${lead.subject}. ${lead.when}`} aria-keyshortcuts="Q A S E Delete Z" className="flex gap-3 py-3 ps-4 pe-2 outline-hidden select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--ns-signal)]">
<span className="relative mt-0.5 size-10 shrink-0">
<Avatar name={lead.who} src={FACE[lead.who]} size="md" />
<span className="absolute -end-1 -bottom-1 rounded-[7px] ring-2 ring-[var(--ns-panel)]">
<CompanyMark name={lead.co} color={lead.color} glyph={brandGlyph(lead.co)} size="xs" />
</span>
</span>
<span className="flex min-w-0 flex-1 flex-col">
<span className="flex items-baseline gap-2">
<span className="min-w-0 flex-1 truncate font-[number:var(--ns-weight-strong)] text-[var(--ns-ink)]">
{lead.who} <span className="font-normal text-[var(--ns-ink-3)]">· {lead.co}</span>
</span>
<span className="shrink-0 text-[length:var(--ns-text-meta)] text-[var(--ns-ink-3)] tabular-nums">{lead.when}</span>
</span>
<span className="flex items-center gap-1.5">
<span className="min-w-0 flex-1 truncate text-[length:var(--ns-text-small)] font-[number:var(--ns-weight-medium)] text-[var(--ns-ink-2)]">{lead.subject}</span>
{lead.back && (
<span className="inline-flex h-5 shrink-0 items-center gap-1 rounded-full bg-[var(--ns-well)] ps-1.5 pe-2 text-[11px] font-[number:var(--ns-weight-strong)] text-[var(--ns-ink-2)] [animation:ns-swipe-land_420ms_cubic-bezier(.34,1.42,.64,1)_160ms_both] motion-reduce:animate-none">
<Clock aria-hidden className="size-3 stroke-[2.5]" />
{w.chip}
</span>
)}
{lead.owner && (
<span title={w.yours} className="inline-flex size-[18px] shrink-0 overflow-hidden rounded-full ring-2 ring-[var(--ns-panel)] [animation:ns-swipe-hop_520ms_cubic-bezier(.3,1.22,.5,1)_200ms_both] motion-reduce:animate-none">
<Avatar name={lead.owner} src={FACE[lead.owner]} size="xs" className="!size-full" />
</span>
)}
</span>
<span className="truncate text-[length:var(--ns-text-small)] text-[var(--ns-ink-3)]">{lead.preview}</span>
</span>
{/* the lead's menu: the same Menu a right-click or long press opens */}
<button
type="button"
aria-label={fill(w.more, { who: lead.who })}
onPointerDown={(e) => e.stopPropagation()}
onClick={(e) => {
const r = e.currentTarget.getBoundingClientRect();
e.currentTarget.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: r.left, clientY: r.bottom }));
}}
className="grid size-11 shrink-0 cursor-pointer place-items-center self-center rounded-[var(--ns-radius)] text-[var(--ns-ink-3)] outline-hidden hover:bg-[var(--ns-hover)] hover:text-[var(--ns-ink)] focus-visible:outline-2 focus-visible:outline-[var(--ns-signal)] [&_svg]:size-4"
>
<Ellipsis aria-hidden />
</button>
</div>
</SwipeActions>
</li>
);
})}
{!leads.length && (
<li className="flex flex-col items-center gap-1 px-6 py-16 text-center">
<b className="font-[number:var(--ns-weight-strong)] text-[var(--ns-ink)]">{w.clear}</b>
<span className="text-[length:var(--ns-text-small)] text-[var(--ns-ink-3)]">{w.clearHint}</span>
</li>
)}
</ul>
</div>
);
}"use client";
import * as React from "react";
import { Archive, BadgeCheck, Clock, Ellipsis, Trash2, UserRoundPlus } from "@/lib/notchset/icons";
import { Avatar } from "@/components/ui/notchset/avatar";
import { Card } from "@/components/ui/notchset/card";
import { CompanyMark } from "@/components/ui/notchset/company-mark";
import { SwipeActions, type SwipeAction } from "@/components/ui/notchset/swipe-actions";
import { notify, Toaster } from "@/components/ui/notchset/toast";
import { brandGlyph } from "./brands";
import { useLessMotion } from "@/lib/notchset/motion";
import { useSelfPlay } from "./self-play";
/*
* The Leads on a phone: swipe a lead right for Qualify and Assign to me, left for Snooze, Delete and Archive; all the
* way right qualifies it, all the way left archives it (a delete is never the long swipe). Assign and Snooze keep the
* lead and change it: Maya's face hops in, a "Back Mon" chip lands. Each action says what it did once, with Undo for
* 5s; an undone lead comes back from the side it left. Every action is also in the lead's menu (…) and, on a focused
* lead, its key: Q A S E, Delete, and Z to undo. The looks: the Leads, and the worst case (German words: the tiles
* go to icons alone). The rows alone, each whole. Shown once, the second lead slides open to its trailing tray
* (Snooze, Delete, Archive; the long swipe is Archive, the safe one) and lands there.
*/
type Lead = { id: string; who: string; co: string; color: string; when: string; subject: string; preview: string; owner?: string; back?: boolean };
type Act = "qualify" | "assign" | "snooze" | "delete" | "archive";
const ME = "Maya Lindqvist";
const FACE: Record<string, string> = {
"Kevin Ito": "https://notchset.dev/media/people/person-08.webp",
"Priya Raman": "https://notchset.dev/media/people/person-01.webp",
"Marcus Bell": "https://notchset.dev/media/people/person-02.webp",
"Ana Ruiz": "https://notchset.dev/media/people/person-05.webp",
"Ines Duarte": "https://notchset.dev/media/people/person-07.webp",
"Lena Ortiz": "https://notchset.dev/media/people/person-04.webp",
"Maya Lindqvist": "https://notchset.dev/media/people/person-03.webp",
};
const LEADS: Lead[] = [
{ id: "l1", who: "Kevin Ito", co: "Airtable", color: "#fcb400", when: "9:41", subject: "40 seats on the Team plan", preview: "Can we start on Team and move up to Business in Q1?" },
{ id: "l2", who: "Priya Raman", co: "Linear", color: "#5e6ad2", when: "9:12", subject: "Security review", preview: "Our IT team needs the SOC 2 report before Friday." },
{ id: "l3", who: "Marcus Bell", co: "Webflow", color: "#146ef5", when: "8:47", subject: "Agency partner program", preview: "Four of our clients asked about Notchset this month." },
{ id: "l4", who: "Ana Ruiz", co: "Shopify", color: "#5e8e3e", when: "Yesterday", subject: "A pilot in Berlin", preview: "The retail team would like a two-week pilot first." },
{ id: "l5", who: "Ines Duarte", co: "Stripe", color: "#635bff", when: "Yesterday", subject: "Intro from Maya", preview: "Maya said you could help with our pipeline reviews." },
{ id: "l6", who: "Lena Ortiz", co: "Notion", color: "#191919", when: "Mon", subject: "Renewal terms", preview: "Happy to sign for two years if onboarding is included." },
];
const EN = {
title: "Leads",
tile: { qualify: "Qualify", assign: "Assign", snooze: "Snooze", delete: "Delete", archive: "Archive" },
menu: { qualify: "Qualify", assign: "Assign to me", snooze: "Snooze until Monday", delete: "Delete", archive: "Archive" },
more: "More actions for {who}",
undo: "Undo",
toast: { qualify: "{who} is in Deals", assign: "Assigned to you", snooze: "Snoozed until Mon", delete: "Deleted", archive: "Archived" },
chip: "Back Mon",
yours: "Yours",
clear: "All triaged",
clearHint: "New leads land here.",
};
const DE: typeof EN = {
title: "Leads",
tile: { qualify: "Qualifizieren", assign: "Zuweisen", snooze: "Später", delete: "Löschen", archive: "Archivieren" },
menu: { qualify: "Qualifizieren", assign: "Mir zuweisen", snooze: "Bis Montag zurückstellen", delete: "Löschen", archive: "Archivieren" },
more: "Weitere Aktionen für {who}",
undo: "Rückgängig",
toast: { qualify: "{who} ist in Deals", assign: "Dir zugewiesen", snooze: "Zurückgestellt bis Mo.", delete: "Gelöscht", archive: "Archiviert" },
chip: "Zurück Mo.",
yours: "Deins",
clear: "Alles gesichtet",
clearHint: "Neue Leads landen hier.",
};
const fill = (s: string, v: Record<string, string | number>) => s.replace(/\{(\w+)\}/g, (_, k: string) => String(v[k] ?? ""));
const LEAVES: Record<Act, boolean> = { qualify: true, assign: false, snooze: false, delete: true, archive: true };
/* the worst case (?qa=worst) swaps in the German words */
const LOOK = "leads" as "leads" | "worst";
export default function SwipeActionsDemo() {
const look = LOOK;
const leads = LEADS;
const w = look === "worst" ? DE : EN;
const root = React.useRef<HTMLDivElement>(null);
const play = useSelfPlay(root, { beats: [0], off: useLessMotion() });
return (
<div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} className="w-[min(100%,400px)]">
<Card inset className="overflow-visible p-0">
<Inbox key={look} leads={leads.slice(0, 4)} w={w} opened={play.step >= 0 ? leads[1]?.id : undefined} />
</Card>
<Toaster />
</div>
);
}
function Inbox({ leads: start, w, opened }: { leads: Lead[]; w: typeof EN; opened?: string | undefined }) {
const [leads, setLeads] = React.useState(start);
const [back, setBack] = React.useState<{ id: string; side: "leading" | "trailing" } | null>(null);
const [said, setSaid] = React.useState("");
const [undoLast, setUndoLast] = React.useState<{ run: () => void } | null>(null);
const acted = (lead: Lead, a: Act) => {
const at = leads.findIndex((l) => l.id === lead.id);
const before = leads;
if (LEAVES[a]) setLeads((ls) => ls.filter((l) => l.id !== lead.id));
else setLeads((ls) => ls.map((l) => (l.id === lead.id ? (a === "assign" ? { ...l, owner: ME } : { ...l, back: true }) : l)));
const undo = () => {
setUndoLast(null);
if (LEAVES[a]) setBack({ id: lead.id, side: a === "qualify" ? "leading" : "trailing" });
setLeads(() => {
if (!LEAVES[a]) return before;
const next = before.filter((l) => l.id !== lead.id);
next.splice(at, 0, lead);
return next;
});
};
setUndoLast({ run: undo });
const title = fill(w.toast[a], { who: lead.who });
setSaid(`${lead.who}: ${title}`);
notify({ title, action: { kind: "undo", label: w.undo, onClick: undo } }, { ms: 5000 });
};
const actionsOf = (lead: Lead) => {
const make = (a: Act, icon: SwipeAction["icon"], tone: SwipeAction["tone"], shortcut: string): SwipeAction => ({ key: a, label: w.menu[a], short: w.tile[a], icon, tone, shortcut, leaves: LEAVES[a], onRun: () => acted(lead, a) });
return {
leading: [make("qualify", BadgeCheck, "signal", "Q"), make("assign", UserRoundPlus, undefined, "A")],
trailing: [make("snooze", Clock, undefined, "S"), make("delete", Trash2, "bad", "Delete"), make("archive", Archive, "ink", "E")],
};
};
return (
<div
onKeyDown={(e) => {
if (e.key.toLowerCase() === "z" && !e.metaKey && !e.ctrlKey && undoLast) {
e.preventDefault();
undoLast.run();
}
}}
>
<span role="status" className="sr-only">{said}</span>
<ul aria-label={w.title} data-swipe-off="" className="m-0 min-h-[352px] list-none p-0">
{leads.map((lead) => {
const { leading, trailing } = actionsOf(lead);
return (
<li key={lead.id} className="border-b border-[var(--ns-line-soft)] last:border-b-0">
<SwipeActions label={fill(w.more, { who: lead.who })} swipe="any" keys show={opened === lead.id ? "short" : undefined} leading={leading} trailing={trailing} arriveFrom={back?.id === lead.id ? back.side : undefined}>
<div tabIndex={0} aria-label={`${lead.who}, ${lead.co}. ${lead.subject}. ${lead.when}`} aria-keyshortcuts="Q A S E Delete Z" className="flex gap-3 py-3 ps-4 pe-2 outline-hidden select-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--ns-signal)]">
<span className="relative mt-0.5 size-10 shrink-0">
<Avatar name={lead.who} src={FACE[lead.who]} size="md" />
<span className="absolute -end-1 -bottom-1 rounded-[7px] ring-2 ring-[var(--ns-panel)]">
<CompanyMark name={lead.co} color={lead.color} glyph={brandGlyph(lead.co)} size="xs" />
</span>
</span>
<span className="flex min-w-0 flex-1 flex-col">
<span className="flex items-baseline gap-2">
<span className="min-w-0 flex-1 truncate font-[number:var(--ns-weight-strong)] text-[var(--ns-ink)]">
{lead.who} <span className="font-normal text-[var(--ns-ink-3)]">· {lead.co}</span>
</span>
<span className="shrink-0 text-[length:var(--ns-text-meta)] text-[var(--ns-ink-3)] tabular-nums">{lead.when}</span>
</span>
<span className="flex items-center gap-1.5">
<span className="min-w-0 flex-1 truncate text-[length:var(--ns-text-small)] font-[number:var(--ns-weight-medium)] text-[var(--ns-ink-2)]">{lead.subject}</span>
{lead.back && (
<span className="inline-flex h-5 shrink-0 items-center gap-1 rounded-full bg-[var(--ns-well)] ps-1.5 pe-2 text-[11px] font-[number:var(--ns-weight-strong)] text-[var(--ns-ink-2)] [animation:ns-swipe-land_420ms_cubic-bezier(.34,1.42,.64,1)_160ms_both] motion-reduce:animate-none">
<Clock aria-hidden className="size-3 stroke-[2.5]" />
{w.chip}
</span>
)}
{lead.owner && (
<span title={w.yours} className="inline-flex size-[18px] shrink-0 overflow-hidden rounded-full ring-2 ring-[var(--ns-panel)] [animation:ns-swipe-hop_520ms_cubic-bezier(.3,1.22,.5,1)_200ms_both] motion-reduce:animate-none">
<Avatar name={lead.owner} src={FACE[lead.owner]} size="xs" className="!size-full" />
</span>
)}
</span>
<span className="truncate text-[length:var(--ns-text-small)] text-[var(--ns-ink-3)]">{lead.preview}</span>
</span>
{/* the lead's menu: the same Menu a right-click or long press opens */}
<button
type="button"
aria-label={fill(w.more, { who: lead.who })}
onPointerDown={(e) => e.stopPropagation()}
onClick={(e) => {
const r = e.currentTarget.getBoundingClientRect();
e.currentTarget.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: r.left, clientY: r.bottom }));
}}
className="grid size-11 shrink-0 cursor-pointer place-items-center self-center rounded-[var(--ns-radius)] text-[var(--ns-ink-3)] outline-hidden hover:bg-[var(--ns-hover)] hover:text-[var(--ns-ink)] focus-visible:outline-2 focus-visible:outline-[var(--ns-signal)] [&_svg]:size-4"
>
<Ellipsis aria-hidden />
</button>
</div>
</SwipeActions>
</li>
);
})}
{!leads.length && (
<li className="flex flex-col items-center gap-1 px-6 py-16 text-center">
<b className="font-[number:var(--ns-weight-strong)] text-[var(--ns-ink)]">{w.clear}</b>
<span className="text-[length:var(--ns-text-small)] text-[var(--ns-ink-3)]">{w.clearHint}</span>
</li>
)}
</ul>
</div>
);
}/*
* The demos' real companies' own marks for CompanyMark's glyph: 24×24 paths, one copy, so every demo that shows one
* of these companies draws the same mark. Sample content, copied with a demo's usage; a buyer's app passes its own
* companies' marks: <CompanyMark name="Stripe" color="#635bff" glyph={brandGlyph("Stripe")} />
*/
const BRAND_GLYPHS = {
anthropic: "M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z",
airtable: "M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z",
calendly: "M19.655 14.262c.281 0 .557.023.828.064 0 .005-.005.01-.005.014-.105.267-.234.534-.381.786l-1.219 2.106c-1.112 1.936-3.177 3.127-5.411 3.127h-2.432c-2.23 0-4.294-1.191-5.412-3.127l-1.218-2.106a6.251 6.251 0 0 1 0-6.252l1.218-2.106C6.736 4.832 8.8 3.641 11.035 3.641h2.432c2.23 0 4.294 1.191 5.411 3.127l1.219 2.106c.147.252.271.519.381.786 0 .004.005.009.005.014-.267.041-.543.064-.828.064-1.816 0-2.501-.607-3.291-1.306-.764-.676-1.711-1.517-3.44-1.517h-1.029c-1.251 0-2.387.455-3.2 1.278-.796.805-1.233 1.904-1.233 3.099v1.411c0 1.196.437 2.295 1.233 3.099.813.823 1.949 1.278 3.2 1.278h1.034c1.729 0 2.676-.841 3.439-1.517.791-.703 1.471-1.306 3.287-1.301Zm.005-3.237c.399 0 .794-.036 1.179-.11-.002-.004-.002-.01-.002-.014-.073-.414-.193-.823-.349-1.218.731-.12 1.407-.396 1.986-.819 0-.004-.005-.013-.005-.018-.331-1.085-.832-2.101-1.489-3.03-.649-.915-1.435-1.719-2.331-2.395-1.867-1.398-4.088-2.138-6.428-2.138-1.448 0-2.855.28-4.175.841-1.273.543-2.423 1.315-3.407 2.299S2.878 6.552 2.341 7.83c-.557 1.324-.842 2.726-.842 4.175 0 1.448.281 2.855.842 4.174.542 1.274 1.314 2.423 2.298 3.407s2.129 1.761 3.407 2.299c1.324.556 2.727.841 4.175.841 2.34 0 4.561-.74 6.428-2.137a10.815 10.815 0 0 0 2.331-2.396c.652-.929 1.158-1.949 1.489-3.03 0-.004.005-.014.005-.018-.579-.423-1.255-.699-1.986-.819.161-.395.276-.804.349-1.218.005-.009.005-.014.005-.023.869.166 1.692.506 2.404 1.035.685.505.552 1.075.446 1.416C22.184 20.437 17.619 24 12.221 24c-6.625 0-12-5.375-12-12s5.37-12 12-12c5.398 0 9.963 3.563 11.471 8.464.106.341.239.915-.446 1.421-.717.529-1.535.873-2.404 1.034.128.716.128 1.45 0 2.166-.387-.074-.782-.11-1.182-.11-4.184 0-3.968 2.823-6.736 2.823h-1.029c-1.899 0-3.15-1.357-3.15-3.095v-1.411c0-1.738 1.251-3.094 3.15-3.094h1.034c2.768 0 2.552 2.823 6.731 2.827Z",
dropbox: "M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z",
"google drive": "M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z",
figma: "M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z",
framer: "M4 0h16v8h-8zM4 8h8l8 8H4zM4 16h8v8z",
linear: "M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z",
notion: "M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z",
openai: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",
posthog: "M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z",
raycast: "M6.004 15.492v2.504L0 11.992l1.258-1.249Zm2.504 2.504H6.004L12.008 24l1.253-1.253zm14.24-4.747L24 11.997 12.003 0 10.75 1.251 15.491 6h-2.865L9.317 2.692 8.065 3.944l2.06 2.06H8.691v9.31H18v-1.432l2.06 2.06 1.252-1.252-3.312-3.32V8.506ZM6.63 5.372 5.38 6.625l1.342 1.343 1.251-1.253Zm10.655 10.655-1.247 1.251 1.342 1.343 1.253-1.251zM3.944 8.059 2.692 9.31l3.312 3.314v-2.506zm9.936 9.937h-2.504l3.314 3.312 1.25-1.252z",
revolut: "M20.9133 6.9566C20.9133 3.1208 17.7898 0 13.9503 0H2.424v3.8605h10.9782c1.7376 0 3.177 1.3651 3.2087 3.043.016.84-.2994 1.633-.8878 2.2324-.5886.5998-1.375.9303-2.2144.9303H9.2322a.2756.2756 0 0 0-.2755.2752v3.431c0 .0585.018.1142.052.1612L16.2646 24h5.3114l-7.2727-10.094c3.6625-.1838 6.61-3.2612 6.61-6.9494zM6.8943 5.9229H2.424V24h4.4704z",
sentry: "M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z",
shopify: "M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z",
slack: "M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z",
snowflake: "M24 3.459c0 .646-.418 1.18-1.141 1.18-.723 0-1.142-.534-1.142-1.18 0-.647.419-1.18 1.142-1.18.723 0 1.141.533 1.141 1.18zm-.228 0c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0 .533.38.952.913.952.57 0 .913-.419.913-.951zm-1.37-.533h.495c.266 0 .456.152.456.38 0 .153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114 0 .152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602 12.4c.038-.151.076-.304.076-.456 0-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153 1.56.532 1.94l2.701 1.56-2.701 1.56c-.685.38-.913 1.256-.533 1.94.38.685 1.256.914 1.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332 2.626c-.266-.038-.57.038-.837.19l-4.832 2.777c-.685.38-.913 1.256-.532 1.94.38.686 1.255.914 1.94.533l2.701-1.56v3.12c0 .8.647 1.408 1.446 1.408.799 0 1.407-.647 1.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701 1.56V1.975c0-.799-.647-1.408-1.446-1.408-.799 0-1.446.609-1.446 1.408V7.53c0 .76.609 1.37 1.332 1.407zM3.265 5.97l4.832 2.777c.266.152.533.19.837.19.723-.038 1.331-.684 1.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799 0-1.446.647-1.446 1.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19 1.521.494 1.902zm9.093 6.011a.412.412 0 00-.114-.266l-.57-.571a.346.346 0 00-.267-.114.412.412 0 00-.266.114l-.571.57a.411.411 0 00-.114.267c0 .076.038.19.114.267l.57.57a.345.345 0 00.267.114c.076 0 .19-.038.266-.114l.571-.57a.412.412 0 00.114-.267zm1.598.533L11.94 14.53c-.039.038-.153.114-.229.114h-.608a.411.411 0 01-.267-.114L8.82 12.514a.408.408 0 01-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41 0 01.267-.114h.608a.41.41 0 01.267.114l2.016 2.016a.347.347 0 01.114.267v.608c-.076.077-.114.19-.19.229zm5.593 5.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332 1.408v5.554c0 .8.647 1.408 1.408 1.408.799 0 1.446-.647 1.446-1.408v-3.12l2.7 1.56c.686.38 1.561.152 1.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701 1.56 2.7 1.56c.686.38.914 1.256.533 1.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644 1.644 0 01-.647-.798c-.037-.153-.076-.305-.076-.457 0-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38 1.56-.152 1.94.533.457.609.19 1.484-.494 1.864",
strava: "M15.387 17.944l-2.089-4.116h-3.065L15.387 24l5.15-10.172h-3.066m-7.008-5.599l2.836 5.598h4.172L10.463 0l-7 13.828h4.169",
stripe: "M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z",
vercel: "m12 1.608 12 20.784H0Z",
visa: "M9.112 8.262L5.97 15.758H3.92L2.374 9.775c-.094-.368-.175-.503-.461-.658C1.447 8.864.677 8.627 0 8.479l.046-.217h3.3a.904.904 0 01.894.764l.817 4.338 2.018-5.102zm8.033 5.049c.008-1.979-2.736-2.088-2.717-2.972.006-.269.262-.555.822-.628a3.66 3.66 0 011.913.336l.34-1.59a5.207 5.207 0 00-1.814-.333c-1.917 0-3.266 1.02-3.278 2.479-.012 1.079.963 1.68 1.698 2.04.756.367 1.01.603 1.006.931-.005.504-.602.725-1.16.734-.975.015-1.54-.263-1.992-.473l-.351 1.642c.453.208 1.289.39 2.156.398 2.037 0 3.37-1.006 3.377-2.564m5.061 2.447H24l-1.565-7.496h-1.656a.883.883 0 00-.826.55l-2.909 6.946h2.036l.405-1.12h2.488zm-2.163-2.656l1.02-2.815.588 2.815zm-8.16-4.84l-1.603 7.496H8.34l1.605-7.496z",
/* Zoom's app icon: its camera (the body and the lens), drawn on Zoom's blue tile; the wordmark is unreadable at 16px */
zoom: "M6.5 7h7A2.5 2.5 0 0 1 16 9.5v5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 4 14.5v-5A2.5 2.5 0 0 1 6.5 7Zm10.5 3.6 2.4-1.75c.66-.48 1.6-.01 1.6.81v6.68c0 .82-.94 1.29-1.6.81L17 15.4Z",
webflow: "m24 4.515-7.658 14.97H9.149l3.205-6.204h-.144C9.566 16.713 5.621 18.973 0 19.485v-6.118s3.596-.213 5.71-2.435H0V4.515h6.417v5.278l.144-.001 2.622-5.277h4.854v5.244h.144l2.72-5.244H24Z",
yelp: "m7.6885 15.1415-3.6715.8483c-.3769.0871-.755.183-1.1452.155-.2611-.0188-.5122-.0414-.7606-.213a1.179 1.179 0 0 1-.331-.3594c-.3486-.5519-.3656-1.3661-.3697-2.0004a6.2874 6.2874 0 0 1 .3314-2.0642 1.857 1.857 0 0 1 .1073-.2474 2.3426 2.3426 0 0 1 .1255-.2165 2.4572 2.4572 0 0 1 .1563-.1975 1.1736 1.1736 0 0 1 .399-.2831 1.082 1.082 0 0 1 .4592-.0837c.2355.0016.5139.052.91.1734.0555.0191.1237.0382.1856.0572.3277.1013.7048.2404 1.1499.3987.6863.2404 1.3663.487 2.0463.7397l1.2117.4423c.2217.0807.4363.18.6412.297.174.0984.3273.2298.4512.387a1.217 1.217 0 0 1 .192.4309 1.2205 1.2205 0 0 1-.872 1.4522c-.0468.0151-.0852.0239-.1085.0293l-1.105.2553-.0031-.001zM18.8208 7.565a1.8506 1.8506 0 0 0-.2042-.1754 2.4082 2.4082 0 0 0-.2077-.1394 2.3607 2.3607 0 0 0-.2269-.109 1.1705 1.1705 0 0 0-.482-.0796 1.0862 1.0862 0 0 0-.4498.1263c-.2107.1048-.4388.2732-.742.5551-.042.0417-.0947.0886-.142.133-.2502.2351-.5286.5252-.8599.863a114.6363 114.6363 0 0 0-1.5166 1.5629l-.8962.9293a4.1897 4.1897 0 0 0-.4466.5483 1.541 1.541 0 0 0-.2364.5459 1.2199 1.2199 0 0 0 .0107.4518l.0046.02a1.218 1.218 0 0 0 1.4184.923 1.162 1.162 0 0 0 .1105-.0213l4.7781-1.104c.3766-.087.7587-.1667 1.097-.3631.2269-.1316.4428-.262.5909-.5252a1.1793 1.1793 0 0 0 .1405-.4683c.0733-.6512-.2668-1.3908-.5403-1.963a6.2792 6.2792 0 0 0-1.2001-1.7103zM8.9703.0754a8.6724 8.6724 0 0 0-.83.1564c-.2754.066-.548.1383-.8146.2236-.868.2844-2.0884.8063-2.295 1.8065-.1165.5655.1595 1.1439.3737 1.66.2595.6254.614 1.1889.9373 1.7777.8543 1.5545 1.7245 3.0993 2.5922 4.6457.259.4617.5416 1.0464 1.043 1.2856a1.058 1.058 0 0 0 .1013.0383c.2248.0851.4699.1016.7041.0471a4.3015 4.3015 0 0 0 .0418-.0097 1.2136 1.2136 0 0 0 .5658-.3397 1.1033 1.1033 0 0 0 .079-.0822c.3463-.435.3454-1.0833.3764-1.6134.1042-1.771.2139-3.5423.3009-5.3142.0332-.6712.1055-1.3333.0655-2.0096-.0328-.5579-.0368-1.1984-.3891-1.6563-.6218-.8073-1.9476-.741-2.8523-.6158zm2.084 15.9505a1.1053 1.1053 0 0 0-1.2306-.4145 1.1398 1.1398 0 0 0-.1526.0633 1.4806 1.4806 0 0 0-.2171.1354c-.1992.1475-.3668.3392-.5196.5315-.0386.049-.074.1143-.12.1562l-.7686 1.0573a113.9168 113.9168 0 0 0-1.2913 1.789c-.278.3895-.5184.7184-.7083 1.0094-.036.0547-.0734.116-.1075.1647-.2277.3522-.3566.6092-.4228.8381a1.0945 1.0945 0 0 0-.046.4721c.0211.1655.0768.3246.1635.467.046.0715.0957.1406.1487.207a2.334 2.334 0 0 0 .1754.1825 1.843 1.843 0 0 0 .2108.1732c.5304.369 1.1112.6342 1.722.8391a6.0958 6.0958 0 0 0 1.5716.3004c.091.0046.1821.0025.2728-.006a2.3878 2.3878 0 0 0 .2506-.0351 2.3862 2.3862 0 0 0 .2447-.071 1.1927 1.1927 0 0 0 .4175-.2658c.1127-.113.1994-.249.2541-.3989.0889-.2214.1473-.5026.1857-.92.0034-.0593.0118-.1305.0177-.1958.0304-.3463.0443-.7531.0666-1.2315.0375-.7357.067-1.4681.0903-2.2026 0 0 .0495-1.3053.0494-1.306.0113-.3008.002-.6342-.0814-.9336a1.396 1.396 0 0 0-.1756-.4054zm8.6754 2.0439c-.1605-.176-.3878-.3514-.7462-.5682-.0518-.0288-.1124-.0674-.1684-.1009-.2985-.1795-.658-.3684-1.078-.5965a120.7615 120.7615 0 0 0-1.9427-1.042l-1.1515-.6107c-.0597-.0175-.1203-.0607-.1766-.0878-.2212-.1058-.4558-.2045-.6992-.2498a1.4915 1.4915 0 0 0-.2545-.0265 1.1527 1.1527 0 0 0-.1648.01 1.1077 1.1077 0 0 0-.9227.9133 1.4186 1.4186 0 0 0 .0159.439c.0563.3065.1932.6096.3346.875l.615 1.1526c.3422.65.6884 1.2963 1.0435 1.9406.229.4202.4196.7799.5982 1.078.0338.056.0721.1163.1011.1682.2173.3584.392.584.569.7458.1146.1107.252.195.4026.247.1583.0525.326.071.4919.0546a2.368 2.368 0 0 0 .251-.0435c.0817-.022.1622-.048.241-.0784a1.863 1.863 0 0 0 .2475-.1143 6.1018 6.1018 0 0 0 1.2818-.9597c.4596-.4522.8659-.9454 1.182-1.51.044-.08.0819-.163.1138-.2483a2.49 2.49 0 0 0 .0773-.2411c.0186-.083.033-.1669.0429-.2513a1.188 1.188 0 0 0-.0565-.491 1.0933 1.0933 0 0 0-.248-.4041zm2.86 3.742a.8523.8523 0 0 1-.111.4236c-.074.132-.178.2377-.3115.3172a.8428.8428 0 0 1-.4385.119.847.847 0 0 1-.4373-.1179.8526.8526 0 0 1-.3125-.3171.8548.8548 0 0 1-.111-.4248c0-.1526.038-.2958.1143-.4294a.8405.8405 0 0 1 .315-.3159.849.849 0 0 1 .4315-.1156.8514.8514 0 0 1 .4294.1144.84.84 0 0 1 .316.3148.8494.8494 0 0 1 .1156.4317zm-.1202 0c0-.1328-.0332-.256-.0996-.3698s-.1564-.2038-.2702-.2702a.7125.7125 0 0 0-.371-.1007.7204.7204 0 0 0-.3698.0996.7487.7487 0 0 0-.2713.2702.7181.7181 0 0 0-.0996.3709c0 .132.0332.2557.0996.371a.7355.7355 0 0 0 .2713.2713.7354.7354 0 0 0 .3698.0985.7205.7205 0 0 0 .3698-.0996.7423.7423 0 0 0 .2702-.2691.7186.7186 0 0 0 .1008-.3721zm-.577.0584.2724.4522h-.1922l-.237-.4052h-.1546v.4052h-.1695v-1.02h.2988c.1268 0 .2195.0247.2783.0744.0595.0496.0892.1252.0892.2267a.2785.2785 0 0 1-.0492.1625c-.032.0466-.0775.0813-.1362.1042zm-.0412-.1408a.1532.1532 0 0 0 .056-.1214c0-.0573-.0164-.0981-.0491-.1225-.0329-.0251-.0847-.0377-.1557-.0377h-.1214v.3285h.1237c.061 0 .1098-.0157.1465-.047z",
} as const satisfies Record<string, string>;
type BrandName = keyof typeof BRAND_GLYPHS;
/** A real company's mark by its name, case-insensitive ("Stripe", "stripe"); undefined for one with none, which then shows its initial. */
const brandGlyph = (name: string): string | undefined => BRAND_GLYPHS[name.trim().toLowerCase() as BrandName];
export { BRAND_GLYPHS, brandGlyph };"use client";
import * as React from "react";
/*
* A demo that plays itself until the first touch: the script lives in the demo, never in the piece, which only gets
* the props a person would give it. It moves 0.4 s after the piece is first seen, then takes each step on its beat;
* off screen or paused it waits. The first press, key or focus on the piece (bind `handOver` to it; a scroll over it never counts) makes it the
* visitor's for good and drops every queued step; with less motion (`off`) it never plays and rests in its first frame.
* A host can hand it over from outside the piece too (a settings panel beside it the visitor has used): under
* <HandedOver value>, it never plays, a remount included.
*
* const play = useSelfPlay(root, { beats: [2800, 2800], loop: true, off: less });
* <div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} onFocusCapture={play.handOver}>
* play.step // the step it is at, -1 before its first
* play.control // "pause" while it plays, "play" once paused (a new take), "replay" once it is over or yours
*
* Each step presses the piece's own controls (pressIn), so the script shows exactly what a hand can do.
*
* A host that shows the piece once (<PlayOnce value={{ settle }}>) changes three things: the script starts when the
* piece is first half in view and never again on coming back, it never loops, and with less motion (or `settle`) it
* takes every step at once, so the piece rests on the END of its moment. `hold` is a reason not to play at all that is
* not motion (a mode with nothing to show): it holds in every host. Under <PlayOnce value={{ active: false }}> (a look
* that is mounted but not shown) it waits until it is shown.
*/
type SelfPlayOptions = {
/** how long each step waits after the one before it, in ms; the first step waits 0.4 s after the piece is seen */
beats: readonly number[];
/** starts over after the last step; without it the script plays once and rests */
loop?: boolean | undefined;
/** no self-play at all (less motion): the piece is the visitor's from the start */
off: boolean;
/** no self-play for a reason other than motion (a mode with nothing to show), in every host */
hold?: boolean | undefined;
};
/** How a host shows the piece: once on arrival (see useSelfPlay). */
type PlayOnceHost = {
/** rest on the end at once, without playing (less motion, or a reset) */
settle?: boolean | undefined;
/** false while the piece is mounted but not shown: it waits */
active?: boolean | undefined;
};
const START = 400;
/**
* Whether a demo plays itself at all. Off: every piece rests in its first frame and is
* the visitor's from the start; nothing presses its controls for them.
*/
const SELF_PLAY: boolean = false;
/** True where the visitor has already taken the piece from outside it: nothing under it plays itself. */
const HandedOver = React.createContext(false);
/** A host that shows the piece once: play once on arrival, rest on the end (null: play as the demo asks). */
const PlayOnce = React.createContext<PlayOnceHost | null>(null);
function useSelfPlay(root: React.RefObject<Element | null>, { beats, loop: looped = false, off: still, hold = false }: SelfPlayOptions) {
const once = React.useContext(PlayOnce);
const active = once?.active !== false;
/* shown once: less motion (or a settled host) takes every step at once and rests on the end */
const quick = once != null && (still || Boolean(once.settle));
const loop = once == null && looped;
/* the first touch hands it over for good */
const [mine, setMine] = React.useState(false);
const handOver = React.useCallback(() => setMine(true), []);
const handedOver = React.useContext(HandedOver);
const off = !SELF_PLAY || hold || (quick ? false : still) || mine || (handedOver && !quick);
const [seen, setSeen] = React.useState(false);
const [paused, setPaused] = React.useState(false);
const [taken, setTaken] = React.useState(0);
const n = Math.max(1, beats.length);
const done = !loop && taken >= n;
React.useEffect(() => {
const el = root.current;
if (!active) return;
/* without an observer (an old browser, a test) it counts as seen */
if (!el || typeof IntersectionObserver === "undefined" || quick) {
const t = window.setTimeout(() => setSeen(true));
return () => window.clearTimeout(t);
}
/* shown once: first half in view starts it, and leaving never stops or restarts it */
const io = once
? new IntersectionObserver((es) => {
if (es.some((e) => e.isIntersecting && e.intersectionRatio >= 0.5)) {
setSeen(true);
io.disconnect();
}
}, { threshold: 0.5 })
: new IntersectionObserver((es) => setSeen(es.some((e) => e.isIntersecting)));
io.observe(el);
return () => io.disconnect();
}, [root, active, once, quick]);
const playing = !off && seen && active && !paused && !done;
const delay = quick ? 0 : taken === 0 ? START : (beats[taken % n] ?? START);
React.useEffect(() => {
if (!playing) return;
const t = window.setTimeout(() => setTaken((k) => k + 1), delay);
return () => window.clearTimeout(t);
}, [playing, taken, delay]);
/* one control in one place: Pause while it plays, Play (a new take) once paused, Replay once it is over or yours */
/* self-play off: never "over", so a demo rests in its FIRST frame, not its end frame */
const control: "pause" | "play" | "replay" = paused || !SELF_PLAY ? "play" : off || done ? "replay" : "pause";
return { step: taken === 0 ? -1 : (taken - 1) % n, taken, playing, control, mine, handOver, pause: () => setPaused(true) };
}
/**
* Presses a real control inside `root`, as the visitor would: the first match of `selector`, or the one whose text is
* `text`. A click only, so it never counts as the visitor's touch.
*/
function pressIn(root: Element | null, selector: string, text?: string) {
const all = [...(root?.querySelectorAll<HTMLElement>(selector) ?? [])];
(text == null ? all[0] : all.find((el) => el.textContent?.trim() === text))?.click();
}
export { HandedOver, PlayOnce, pressIn, useSelfPlay, type PlayOnceHost, type SelfPlayOptions };This example also uses Avatar, Card, Company mark, Toast. This command installs them with it, so the example pastes as it is:
pnpm dlx shadcn@latest add @notchset-pro/swipe-actions @notchset/avatar @notchset/card @notchset/company-mark @notchset/toastcomponents/ui/notchset/swipe-actions.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.
LevelOrganism: made of molecules or blocks.
Made ofKeyboard hint,Menu
Needs your registry key. Every components.json style gets the same files.
Works with React 18.3 or 19 on Tailwind CSS v4, in any shadcn project. What's tested
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
actions–
readonly SwipeAction[]The trailing tray (a swipe toward the row's start), start to end; the last, at the edge, takes the long swipe. Same as `trailing`.
trailing–
readonly SwipeAction[]The trailing tray; wins over `actions`.
leading[]
readonly SwipeAction[]The leading tray (a swipe toward the row's end), start to end; the first, at the edge, takes the long swipe.
label–
stringWhat the row is, heading its Menu as a sheet on a phone.
menu–
readonly MenuEntry[]The row's whole Menu when it has more than its swipe actions (Open, Assign…); it must carry them too. Default: the actions.
swipe"touch"
"touch" | "any" | "off"Which pointers swipe: "touch" (default: a finger or a pen; a mouse keeps its clicks), "any" (a demo a mouse can try), or "off".
keysfalse
booleanThe focused row runs its actions' shortcuts (and Delete or Backspace a `bad` one), played as the swipe would. Off by default (a list that binds its own keys).
arriveFrom–
SideIt arrives from this side (a row put back by Undo): its gap opens and it slides home.
show–
"rest" | "short" | "full"Holds one state until it is used (a preview, a demo's knob): at rest, opened to its trailing tray, or the long swipe lit.
Three usesan inbox's threads (Snooze, Archive) · a task list on a phone (Snooze, Delete) · an assistant's chats
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)One payment, lifetime.
v2.0.0 · 2026-10-13
Released with the Notchset system.