AI & workflow
Sequence Step
One card per step: channel tile, title, timing meta, content preview and optional stats. Channels: email · LinkedIn · call · task.
react-aria-componentslucide-react
Preview
{{variables}} in templates are highlighted.
Email · Intro
Day 1 · Automatic
Quick question about {{company}}’s SDR ramp
Hi {{first_name}}, congrats on the {{recent_signal}}…
- Sent
- 128
- Opened
- 64%
- Replied
- 7.8%
"use client";
import { SequenceStep, SequenceWait } from "@/components/ui/sequence-step";
export default function Example() {
return (
<div className="flex w-full max-w-lg flex-col items-center gap-3">
<SequenceStep
className="w-full"
step={1}
channel="email"
name="Intro"
timing="Day 1 · Automatic"
subject="Quick question about {{company}}’s SDR ramp"
preview="Hi {{first_name}}, congrats on the {{recent_signal}}…"
stats={[
{ label: "Sent", value: 128 },
{ label: "Opened", value: "64%" },
{ label: "Replied", value: "7.8%" },
]}
/>
<SequenceWait>Wait 2 days</SequenceWait>
</div>
);
}Installation
Components are copied into your project — no runtime package.
Install the following dependencies:
terminalnpm install react-aria-components lucide-reactCreate a
sequence-step.tsxfile and paste the following code into it.src/components/ui/sequence-step.tsx"use client"; import { CheckSquare, Clock, Mail, MoreHorizontal, Phone } from "lucide-react"; import type { ReactNode } from "react"; import { cx } from "@/utils/cx"; import { IconButton } from "./icon-button"; import { Menu, MenuItem, MenuSeparator, MenuTrigger } from "./menu"; export type SequenceChannel = "email" | "linkedin" | "call" | "task"; function LinkedinGlyph(props: { "aria-hidden"?: boolean }) { return ( <span {...props} className="text-[11px] font-bold leading-none"> in </span> ); } const channels: Record<SequenceChannel, { label: string; Icon: React.ComponentType<{ "aria-hidden"?: boolean }> }> = { email: { label: "Email", Icon: Mail }, linkedin: { label: "LinkedIn", Icon: LinkedinGlyph }, call: { label: "Call", Icon: Phone }, task: { label: "Task", Icon: CheckSquare }, }; export interface SequenceStepProps { step: number; channel: SequenceChannel; /** e.g. "Intro" — rendered as "Email · Intro". */ name: string; /** Timing meta, e.g. "Day 1 · Automatic". */ timing: string; subject?: string; preview?: string; stats?: { label: string; value: ReactNode }[]; className?: string; } /** Highlights {{variables}} in templates. */ function Template({ text }: { text: string }) { return ( <> {text.split(/(\{\{[^}]+\}\})/g).map((part, i) => part.startsWith("{{") ? ( <span key={i} className="rounded-xs bg-accent-soft px-0.5 text-accent-text"> {part} </span> ) : ( part ), )} </> ); } /** One card per step: channel tile, title, timing meta, content preview and optional stats. */ export function SequenceStep({ step, channel, name, timing, subject, preview, stats, className }: SequenceStepProps) { const ch = channels[channel]; return ( <article className={cx("overflow-hidden rounded-lg border border-line bg-surface shadow-card", className)}> <div className="flex gap-3 p-4"> <span className="flex size-8 shrink-0 items-center justify-center rounded-[10px] bg-accent-soft text-accent [&_svg]:size-4"> <ch.Icon aria-hidden /> </span> <div className="min-w-0 flex-1"> <div className="flex items-start gap-2"> <div className="min-w-0 flex-1"> <h4 className="truncate text-base font-medium text-fg"> {ch.label} · {name} </h4> <p className="text-sm text-fg-muted">{timing}</p> </div> <span className="pt-0.5 text-sm text-fg-muted">Step {step}</span> <MenuTrigger> <IconButton variant="ghost" size="xs" aria-label={`Step ${step} options`}> <MoreHorizontal /> </IconButton> <Menu> <MenuItem>Edit step</MenuItem> <MenuItem>Duplicate</MenuItem> <MenuSeparator /> <MenuItem danger>Delete</MenuItem> </Menu> </MenuTrigger> </div> {(subject || preview) && ( <div className="mt-3"> {subject && ( <p className="truncate text-base font-medium text-fg"> <Template text={subject} /> </p> )} {preview && ( <p className="mt-0.5 truncate text-base text-fg-secondary"> <Template text={preview} /> </p> )} </div> )} </div> </div> {stats && ( <dl className="flex gap-5 border-t border-line bg-subtle px-4 py-2.5 pl-15 text-sm"> {stats.map((s) => ( <div key={s.label} className="flex gap-1.5"> <dt className="text-fg-muted">{s.label}</dt> <dd className="font-medium tabular text-fg">{s.value}</dd> </div> ))} </dl> )} </article> ); } /** Wait pill on the connector between steps. */ export function SequenceWait({ children }: { children: ReactNode }) { return ( <span className="inline-flex h-8 items-center gap-2 rounded-full border border-line bg-surface px-3 text-sm font-medium text-fg-secondary"> <Clock aria-hidden className="size-3.5" /> {children} </span> ); }Create a
menu.tsxfile and paste the following code into it.src/components/ui/menu.tsx"use client"; import type { ReactNode } from "react"; import { Menu as AriaMenu, MenuItem as AriaMenuItem, type MenuItemProps as AriaMenuItemProps, type MenuProps as AriaMenuProps, MenuTrigger, Popover, Separator, } from "react-aria-components"; import { cx } from "@/utils/cx"; import { Kbd } from "./kbd"; export { MenuTrigger }; export function Menu<T extends object>({ className, ...props }: Omit<AriaMenuProps<T>, "className"> & { className?: string }) { return ( <Popover placement="bottom end" offset={6} className="min-w-48 rounded-md bg-surface p-1 shadow-popover outline-none"> <AriaMenu {...props} className={cx("outline-none", className)} /> </Popover> ); } export interface MenuItemProps extends Omit<AriaMenuItemProps, "children" | "className"> { icon?: ReactNode; shortcut?: string; danger?: boolean; children: ReactNode; className?: string; } /** 36px items, radius 8, 16px icon, optional shortcut. */ export function MenuItem({ icon, shortcut, danger, children, className, ...props }: MenuItemProps) { const textValue = props.textValue ?? (typeof children === "string" ? children : undefined); return ( <AriaMenuItem {...props} textValue={textValue} className={cx( "flex h-9 cursor-default items-center gap-2.5 rounded-sm px-2.5 text-base outline-none [&_svg]:size-4 [&_svg]:shrink-0", danger ? "text-error-text data-focused:bg-error-soft [&_svg]:text-error" : "text-fg data-focused:bg-muted [&_svg]:text-fg-secondary", "data-disabled:text-fg-disabled", className, )} > {icon} <span className="flex-1">{children}</span> {shortcut && <Kbd className="border-0 bg-transparent">{shortcut}</Kbd>} </AriaMenuItem> ); } export function MenuSeparator() { return <Separator className="mx-1 my-1 border-t border-line" />; }Create a
icon-button.tsxfile and paste the following code into it.src/components/ui/icon-button.tsx"use client"; import type { ReactNode } from "react"; import { Button as AriaButton, type ButtonProps as AriaButtonProps } from "react-aria-components"; import { cx } from "@/utils/cx"; export interface IconButtonProps extends Omit<AriaButtonProps, "className" | "children"> { /** Accessible name — icon buttons have no visible text. */ "aria-label": string; variant?: "secondary" | "ghost"; size?: "xs" | "sm" | "md"; className?: string; children: ReactNode; } const sizes = { xs: "size-7 rounded-sm", sm: "size-8 rounded-sm", md: "size-9 rounded-[10px]" }; /** Compact square action used in toolbars, topbars and table rows. */ export function IconButton({ variant = "secondary", size = "md", className, children, ...props }: IconButtonProps) { return ( <AriaButton {...props} className={cx( "inline-flex shrink-0 cursor-default items-center justify-center text-fg-secondary outline-none transition-colors", "data-focus-visible:ring-3 data-focus-visible:ring-accent/25 data-disabled:text-fg-disabled [&_svg]:size-4", variant === "secondary" ? "bg-surface shadow-button data-hovered:bg-subtle data-hovered:text-fg data-pressed:bg-active" : "data-hovered:bg-muted data-hovered:text-fg data-pressed:bg-active", sizes[size], className, )} > {children} </AriaButton> ); }Add the theme tokens and the
cxhelper from Installation if you haven’t yet, then update the import paths to match your project setup.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| step | number | — | Step number. |
| channel | "email" | "linkedin" | "call" | "task" | — | Picks the icon and label. |
| name | string | — | Step name, shown as “Email · Intro”. |
| timing | string | — | e.g. “Day 1 · Automatic”. |
| subject / preview | string | — | Content preview. |
| stats | { label, value }[] | — | Footer stats. |