Skip to main content

Saved query card

One saved query in a list: name, owner, source, last run and SQL preview.

Duplicate Delete saved query
<mm-saved-query-card
name="Weekly revenue by region"
description="Completed orders only, joined to the customer dimension for region."
owner="Jane Doe" owner-kind="person"
source="shop-postgres" provider="postgresql"
last-run-status="succeeded" last-run-at="2026-10-27T07:30:00Z"
href="/query/saved/weekly-revenue">
<mm-menu slot="menu">
<mm-menu-item icon="content-copy">Duplicate</mm-menu-item>
<mm-menu-separator></mm-menu-separator>
<mm-menu-item icon="delete" danger>Delete saved query</mm-menu-item>
</mm-menu>
</mm-saved-query-card>

Guidance​

A saved query card shows one saved query as an item in a list of saved queries, never as one of a grid of identical cards: its name, a one-sentence description, then one quiet line of plain text (no chips): the owner (a person or an agent, told apart by icon), the source with its provider logo, and when it last ran, with a status pill only when the run needs attention (a succeeded run gets none). The first three lines of SQL follow on the code ground, in mono. Open, Run and a More menu sit at the top.

The card's border darkens on hover; it never lifts. Put several in a list with space-3 between.

Properties​

PropertyAttributeTypeDefaultDescription
namenamestring''The saved query's name.
descriptiondescriptionstring''One sentence on what it answers.
sqlsqlstring''The SQL. The first three lines are previewed.
ownerownerstring''Owner's name: a person ("Jane Doe") or an agent ("support-triage-agent").
ownerKindowner-kind'person' | 'agent''person'person (default) or agent.
sourcesourcestring''Source name, such as shop-postgres.
providerproviderstring''Provider key for the source's logo, such as postgresql.
lastRunStatuslast-run-statusSavedQueryRunStatus''Status of the last run. Empty when it has never run.
lastRunAtlast-run-atstring''When it last ran: ISO string or epoch milliseconds.
hrefhrefstring''Link for Open. Without it, Open fires mm-open-query.
levellevelnumber3Heading level of the name, 2 to 6. Defaults to 3.
nownownumber | undefinedReference time for the relative last-run time, in epoch milliseconds. Defaults to now.

Events​

EventDetailDescription
mm-open-queryCustomEvent<{ sql: string }>Open was activated (unless href is set, which navigates instead). Named so it never mixes with the More menu's own mm-open.
mm-runCustomEvent<{ sql: string }>Run was activated.

Slots​

SlotDescription
menuAn mm-menu of secondary actions (Duplicate, Share, Delete saved query).
descriptionThe description, if you need markup. Otherwise use description.

CSS parts​

PartDescription
cardThe card.
nameThe name heading.
ownerThe owner chip.
previewThe SQL preview.
actionsThe action buttons.

Examples​

Every state of mm-saved-query-card in Storybook, with keyboard and screen reader tests.