Profile editor with preview — Settings block
Freesettings-profile-editor-with-preview · for account, app pages
Profile editor with preview
A creator, seller or member profile that others see: the form in cards, and beside it a card that repeats exactly what is typed
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-profile-editor-with-previewUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import SettingsProfileEditorWithPreview from '@/components/trame/blocks/settings/settings-profile-editor-with-preview.vue'
const props = {
title: "Your public profile",
lead: "What customers see on your pieces and on your workshop page.",
values: {
name: "Elise Garnier",
handle: "elise.terre",
email: "[email protected]",
headline: "Ceramicist, hand-thrown stoneware",
bio: "I throw stoneware bowls and mugs in my workshop in Portland’s Pearl District. Every piece is glazed and fired on site.",
location: "Portland",
avatar: "https://images.unsplash.com/photo-1580489944761-15a19d654956?w=400&q=80",
cover: "https://images.unsplash.com/photo-1676125105332-608345abe20e?w=1200&q=80",
links: [
{
label: "Workshop website",
url: "https://atelier-garnier.example"
},
{
label: "Firing journal",
url: "https://atelier-garnier.example/carnet"
}
]
},
upload: "profile.picture",
save: "profile.save",
changeEmail: "account.email",
cancel: "account.home",
options: {
accept: "PNG or JPG, 2 MB max"
}
}
</script>
<template>
<SettingsProfileEditorWithPreview v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe page’s heading ("Your public profile") |
| lead | string | Wordswhat the profile is for, in a sentence |
| values* | Values | Datathe profile as the account holds it now |
| fields | ('cover' | 'headline' | 'location' | 'links')[] | which optional parts the profile has; all of them by default |
| upload* | string | Actionposts the form with a new picture (field `avatar` or `cover`) or a removal; the host stores it and answers the page |
| save* | string | Actionposts the profile |
| changeEmail | string | Actionthe page that changes the account’s address |
| cancel | string | Actionwhere "Cancel" leads |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Values values · 9 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe name shown to others |
| handle | string | Wordsthe public handle, without @ |
| email* | string | Datathe account’s address, changed elsewhere |
| headline | string | Wordsa short line under the name ("Ceramicist in Lyon") |
| bio | string | Wordsthe bio the profile holds now |
| location | string | Wordsthe location the profile holds now |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| cover | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| links | Link[] | the value’s links, in order |
Link values.links[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words"Site", "Portfolio" |
| url* | string | Designthe address |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| bioMax | number | the bio’s length limit, 160 by default |
| accept | string | Wordsthe pictures accepted, in words ("PNG or JPG, 2 MB at most") |
| 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 |
| Link | your router’s link component |
| 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
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
upload,save,changeEmail,cancel - Reads
accountfrom your app
A settings section, for account, app 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
- Opening hours compact: one card: the days as a row of chips that open or close them, then only the open days’ hours, the exceptions as short lines: a settings panel or an onboarding step where space is short.
- Opening hours week rows: a ruled row per day, its open switch and its ranges side by side, the exceptions listed under the week: the full settings page of a shop, a restaurant or a practice.
- Opening hours with exceptions: the week in a narrow column beside the dated exceptions, each one a card with its date as a calendar leaf: a business whose year has many closed days and special hours.
- Sso split: A settings page with room to the side: the values to copy in a quiet panel on one side, the provider’s form on the other, so the admin copies and pastes across without scrolling.
- Sso stacked: Single sign-on among other settings pages: one column of cards, the status first, then the values to copy, the provider’s details and the switch, saved at the foot.
- Sso steps: A first setup, or an admin who has never done it: the same settings as three numbered steps (copy these, paste yours, turn it on) along a rail.
- Translations editor: A key-by-key source and translation table with local drafts and host-controlled saving.
- Translations review: Paired source and translation cards with context for careful review of the app’s own words.