Display preferences panel — Settings block
Prosettings-display-preferences-panel · for landing, home, catalog, account pages
Display preferences panel
Display preferences (text size, contrast, reduced motion) saved in the visitor’s browser
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-display-preferences-panelUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import SettingsDisplayPreferencesPanel from '@/components/trame/blocks/settings/settings-display-preferences-panel.vue'
const props = {
title: "International shipping",
lead: "We ship from the United States to 28 countries. The rates and delivery times below are the shop’s own.",
switches: [
{
key: "large-text",
label: "Larger text",
text: "Increases the reading size across the whole site."
},
{
key: "high-contrast",
label: "Higher contrast"
}
],
footnote: "Rates in effect as of March 1, 2026. They may change for future orders, never for an order already paid."
}
</script>
<template>
<SettingsDisplayPreferencesPanel v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe service or policy, said plainly ("International delivery", "Repairs") |
| lead | string | Wordswhat this page tells, in one or two sentences |
| switches* | Switche[] | the display preferences, each a switch |
| footnote | string | Wordsa small closing line, the merchant’s own words (the rounding, the date of the rates) |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Switche switches[] · 3 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe preference’s name; saved in this browser and set on the page as data-pref-<key> |
| label* | string | Wordsthe preference ("Larger text") |
| text | string | Wordswhat it changes |
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 |
| 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
A settings section, for landing, home, catalog, account pages.
More settings blocks
- 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.
- 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.
- 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.
- Domain setup table: A domain’s settings page: the domain and its status in a header with "Verify", then every record as a row of a table (type, name, value to copy, status), turned into cards on a phone.
- Integration catalogue: services that can be connected, in a grid, each with a connect or disconnect button.