Trigger list

Everything that starts an agent, from schedules to webhooks to app events, with when each last fired and when it runs next.

Loading preview…

Install

  1. 1

    Run this command in your Tailwind CSS project. It adds components/ai/trigger-list-list.tsx and installs its dependencies.

    $ npx shadcn@latest add https://gradientdeck.com/ai-components/r/trigger-list-list.json

Usage & API

Example

trigger-list-list.tsx
import { TriggerGlyph } from "@/components/ai/trigger-list-list"

<TriggerGlyph
  kind={kind}
/>

Props TriggerGlyph

PropType & descriptionRequired
kindTriggerKindRequired
appTriggerAppOptional
sizenumberOptional

Dependencies

  • React
  • Tailwind CSS
  • motion
  • lucide-react
Implementation notes

The list is headed Triggers, with a count of how many are on, and Add trigger. The menu adds a schedule, a webhook, an event or an email. Each row shows the glyph, the title, the detail, last fired and next run. A switch turns it on. Off rows are marked Paused. A failure note such as failing twice is visible on the row. The overflow menu renames in place, duplicates, runs now, or deletes. Run now can show a starting state. Delete raises an undo that lasts a few seconds and then calls restore with the row and its old index if the person clicks it. No triggers is the empty state. The preview is the settings of a release-notes agent.

Choosing a layout

Use the list on the agent's settings, next to where a schedule is edited or a webhook URL is copied. Use activity when the question is what fired today and which of those runs failed, not whether the trigger is switched on. The two share the same four kinds and the same glyphs, so a row in the log is recognizable as a row in the list.

Editing the cadence itself, with the next five runs and a holiday switch, is the schedule card. Copying the URL and reading one delivery's body is the webhook trigger. Building the when-where-then rule for an app event is the event trigger. This list is the index of all of them, plus the log of firings.

Does Run now wait for the run to finish?

Run now calls onRunNow with the trigger id. The row can show a running flag while you say so. The list does not poll the run. Opening the resulting run is the activity view, which has an optional onOpenRun.

What comes back if a deleted trigger is restored?

onRestore receives the trigger and the index it had. The undo stays up for a few seconds and then clears. Turning a trigger off is a different action, the switch, and it keeps the row in place as paused.