Domain setup steps — Settings block

Pro

settings-domain-setup-steps · for app, settings pages

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.

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-domain-setup-steps

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import SettingsDomainSetupSteps from '@/components/trame/blocks/settings/settings-domain-setup-steps.vue'

const props = {
domain: {
id: "dom_7h2k",
name: "mail.larkspur.example",
status: "pending",
message: "We have not seen these records yet. They can take a few hours to appear.",
checkedAt: "Last checked 12 minutes ago"
},
records: [
{
id: "spf",
type: "TXT",
name: "send",
value: "v=spf1 include:spf.mailpost.example ~all",
ttl: 3600,
status: "pending"
},
{
id: "dkim",
type: "TXT",
name: "mp._domainkey",
value: "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7mZk2Lw8e",
ttl: 3600,
status: "pending"
}
],
verify: {
label: "Verify DNS records",
action: "verifyDomain"
},
remove: {
label: "Remove domain",
action: "removeDomain"
},
docs: {
label: "How to add DNS records",
action: "dnsGuide"
},
title: "Sending domain",
intro: "Send email from your own address. Add these records where you bought the domain, then verify."
}
</script>

<template>
<SettingsDomainSetupSteps v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
domain*Domainthe domain being set up and where it stands, as the host knows it
records*Record[]the DNS records to add at the registrar, in the order to add them: each value with a copy button once the page runs, selectable whole without it
verifyVerifythe check the person runs once the records are in; absent, the block only shows the records and their status
removeRemovea link to remove the domain, e.g. "Remove domain"; the host confirms on its own page
docsDocsa link to the host’s guide for adding records, e.g. "How to add DNS records"
titlestringWordsthe block’s heading, e.g. "Sending domain"; absent, the domain’s name is the heading
introstringWordsa sentence under the heading on what the domain is for, e.g. "Send email from your own domain."
optionsOptionsthe block’s settings, read by every variant
Domain domain · 5 props
PropTypeDescription
id*stringDatathe domain’s id in the host, posted as `id` by the verify action
name*stringDatathe domain itself, e.g. "mail.northwind.example"
status*'pending' | 'verified' | 'failed'where the domain stands: "pending" records not all seen yet, "verified" ready to use, "failed" the last check found a problem
messagestringWordsthe host’s own words on the domain’s state, e.g. "We could not find the DKIM record. Check its name and value."
checkedAtstringWordswhen the host last checked, in its own words, e.g. "Last checked 4 minutes ago"
Record records[] · 8 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
type*'TXT' | 'CNAME' | 'A' | 'AAAA' | 'MX'the record’s type, as the registrar names it
name*stringDatathe host name to enter, as the registrar takes it, e.g. "@", "_dmarc" or "send"
value*stringDatathe value to enter, whole, e.g. "v=spf1 include:mail.example ~all" or "cname.app.example"
prioritynumberthe MX priority to enter, a whole number (lower first); MX records only
ttlnumberthe time to live to enter, in seconds; absent: the registrar’s default
status'pending' | 'verified' | 'failed'the host’s last check of this record: "pending" not seen yet, "verified" found as expected, "failed" found but wrong; absent: not checked
messagestringWordsthe host’s own words on this record’s check, e.g. "Found a different value: v=spf1 -all"
Verify verify · 2 props
PropTypeDescription
label*stringWordsthe verify button, e.g. "Verify DNS records"
action*stringActionasks the host to check the domain’s records now: posts `id`, the domain’s id; hidden when the page lacks it
Remove remove · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "See the collection"
actionstringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
urlstringDesignan address outside the app
Docs docs · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "See the collection"
actionstringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
urlstringDesignan address outside the app
Options options · 1 props
PropTypeDescription
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: domain.verify, remove, docs
  • Reads domains from 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

  • 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.
  • 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.
  • Danger zone explained: A page given to one grave step ("Delete workspace"): each action its own section, the consequences listed beside the typed name, the "I understand" box and the button, all on the page.
  • Display preferences panel: display preferences (text size, contrast, reduced motion) saved in the visitor’s browser.
  • Integration catalogue: services that can be connected, in a grid, each with a connect or disconnect button.
  • Integration requests request board: let people ask for a tool and vote on what to connect next.
  • Integration settings keys webhooks: what developers manage: masked API keys to rotate or revoke and the webhook endpoints.
  • Integration status list: connected services with the state their last check found, a degraded one explained.

All 38 settings blocks