Saved query card
One saved query in a list: name, owner, source, last run and SQL preview.
<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
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | '' | The saved query's name. |
description | description | string | '' | One sentence on what it answers. |
sql | sql | string | '' | The SQL. The first three lines are previewed. |
owner | owner | string | '' | Owner's name: a person ("Jane Doe") or an agent ("support-triage-agent"). |
ownerKind | owner-kind | 'person' | 'agent' | 'person' | person (default) or agent. |
source | source | string | '' | Source name, such as shop-postgres. |
provider | provider | string | '' | Provider key for the source's logo, such as postgresql. |
lastRunStatus | last-run-status | SavedQueryRunStatus | '' | Status of the last run. Empty when it has never run. |
lastRunAt | last-run-at | string | '' | When it last ran: ISO string or epoch milliseconds. |
href | href | string | '' | Link for Open. Without it, Open fires mm-open-query. |
level | level | number | 3 | Heading level of the name, 2 to 6. Defaults to 3. |
now | now | number | undefined | Reference time for the relative last-run time, in epoch milliseconds. Defaults to now. |
Events
| Event | Detail | Description |
|---|---|---|
mm-open-query | CustomEvent<{ 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-run | CustomEvent<{ sql: string }> | Run was activated. |
Slots
| Slot | Description |
|---|---|
menu | An mm-menu of secondary actions (Duplicate, Share, Delete saved query). |
description | The description, if you need markup. Otherwise use description. |
CSS parts
| Part | Description |
|---|---|
card | The card. |
name | The name heading. |
owner | The owner chip. |
preview | The SQL preview. |
actions | The action buttons. |
Examples
Every state of mm-saved-query-card in Storybook, with keyboard and screen reader tests.