Danger zone card rows — Settings block
Prosettings-danger-zone-card-rows · for app, settings pages
Danger zone card rows
At the foot of a settings page: one bordered danger card, a row per action with one sentence and an outlined destructive button that opens its confirmation in place.
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/settings-danger-zone-card-rowsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import SettingsDangerZoneCardRows from '@/components/trame/blocks/settings/settings-danger-zone-card-rows.vue'
const props = {
title: "Danger zone",
intro: "These actions cannot be undone. Take a moment before you go on.",
actions: [
{
id: "leave",
kind: "leave",
title: "Leave workspace",
text: "You lose access to Fernhill Studio until someone invites you again.",
consequences: [
"You can no longer open its 48 projects or their files",
"Tasks assigned to you stay in place, unassigned"
],
action: "workspace.leave"
},
{
id: "transfer",
kind: "transfer",
title: "Transfer ownership",
text: "Hand Fernhill Studio to another admin. You stay on as an admin.",
consequences: [
"The new owner controls billing, the plan and deleting the workspace",
"You can no longer delete or transfer the workspace"
],
confirmText: "Fernhill Studio",
members: [
{
id: "u-ada",
name: "Ada Whitlock",
role: "Admin"
},
{
id: "u-bruno",
name: "Bruno Okafor",
role: "Admin"
}
],
action: "workspace.transfer"
}
]
}
</script>
<template>
<SettingsDangerZoneCardRows v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title | string | Wordsthe zone’s heading ("Danger zone") |
| intro | string | Wordsa sentence under the heading on what lives here |
| actions* | Action[] | the irreversible actions, in the order they are shown; delete usually last |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Action actions[] · 10 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe action’s key, sent as `id` with its form so the host knows which one ran |
| kind* | 'leave' | 'transfer' | 'delete' | Designwhat the action does: leave the workspace, transfer its ownership, or delete something for good |
| title* | string | Wordsthe action, said as its button says it ("Delete workspace") |
| text | string | Wordsone sentence on what happens ("Everything in Northwind Studio is erased for every member.") |
| consequences* | string[] | Wordswhat the action destroys or changes, one line each, the most serious first |
| confirmText | string | Wordsthe exact words to type before the action runs, usually the workspace’s name ("Northwind Studio"); matched exactly, case included, spaces around ignored |
| reasons | string[] | Wordsan optional survey: reasons to tick, sent as `reasons`; never required |
| members | Member[] | for a transfer: the members who can become the owner, one to choose, sent as `newOwner` |
| locked | string | Wordswhy this person cannot take the action now ("Only the owner can delete the workspace") |
| action* | string | Actionruns the action: through the host it receives the form’s fields `id`, `confirm` (the typed words), `reasons` (a list), `newOwner` and `acknowledge`; posted natively, the same names. The host checks them again: the block only holds the button until they match. Without it, or when the page lacks it, the action is not shown |
Member actions[].members[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe member’s id, sent as `newOwner` when they are chosen |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
form.submit - Reads
membersfrom your app
A settings section, for app, settings pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More settings blocks
- API keys overview: Two parallel registers of credentials and event destinations for the merchant’s own integrations only.
- API keys webhooks: Endpoint cards with event subscriptions and delivery status for the merchant’s own webhooks only.
- Appearance preview beside: The brand colour is the point: the controls in a column beside a live drawing of the app (sidebar, header, a button, a badge) coloured by the chosen colour, with its contrast checked.
- Appearance rows: Appearance among other settings pages: one quiet row per setting, its label and explanation on the left and its control on the right.
- Appearance theme cards: The app offers preset themes: large mode cards (System, Light, Dark) each drawing the app, theme cards with their colours, then the brand colour and the logo below.
- Display preferences panel: display preferences (text size, contrast, reduced motion) saved in the visitor’s browser.
- Domain setup compact: A domain already set up among other settings: one line with its name, status and "Verify", the records folded under a disclosure, open while the domain is not verified.
- Domain setup steps: Right after the person adds a domain, or someone who has never edited DNS: a numbered guide, first the records to add one by one, then the check.