Skip to content
Notra logoNotra UI
Esc
↑↓navigate↵open⌘Jpreview
On this page

Template Card

A workflow template card with a playable preview dialog.

"use client";

import { useState } from "react";
import { toast } from "sonner";

import {
  WorkflowTemplateCard,
  WorkflowTemplateDialog,
} from "../components/workflow-template-card";
import {
  LISTICLE_OUTREACH_WORKFLOW,
  VISIBILITY_MONITOR_WORKFLOW,
} from "../constants/workflow-templates";
import type { WorkflowTemplate } from "../types/workflow";

export default function WorkflowTemplateCardExample() {
  const [open, setOpen] = useState(false);
  const [preview, setPreview] = useState<WorkflowTemplate>();
  return (
    <div className="grid w-full max-w-2xl gap-3 sm:grid-cols-2">
      {[LISTICLE_OUTREACH_WORKFLOW, VISIBILITY_MONITOR_WORKFLOW].map(
        (template) => (
          <WorkflowTemplateCard
            key={template.id}
            onUse={(next) => {
              setPreview(next);
              setOpen(true);
            }}
            template={template}
          />
        )
      )}
      <WorkflowTemplateDialog
        onOpenChange={setOpen}
        onUse={(template) => {
          setOpen(false);
          toast.success(`Created “${template.title}”`);
        }}
        open={open}
        template={preview}
      />
    </div>
  );
}
$ bunx --bun shadcn@latest add @notra/workflow-template-card

WorkflowTemplateCard shows a template’s logos, category, step count, AI step count and estimated run time. WorkflowTemplateDialog opens the template in a shadcn Dialog with a canvas you can play before using it.

Used in

GEO Workflow Builder

A workflow builder with a block palette, a playable canvas, a run log and a node sheet.