Profile editor cover header — Settings block

Free

settings-profile-editor-cover-header · for account, app pages

Profile editor cover header

A profile with a cover picture: a wide card with the cover and the portrait over its edge, each with its own button, the fields in cards under it

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-cover-header

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import SettingsProfileEditorCoverHeader from '@/components/trame/blocks/settings/settings-profile-editor-cover-header.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>
<SettingsProfileEditorCoverHeader v-bind="props" />
</template>

Props

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

PropTypeDescription
title*stringWordsthe page’s heading ("Your public profile")
leadstringWordswhat the profile is for, in a sentence
values*ValuesDatathe profile as the account holds it now
fields('cover' | 'headline' | 'location' | 'links')[]which optional parts the profile has; all of them by default
upload*stringActionposts the form with a new picture (field `avatar` or `cover`) or a removal; the host stores it and answers the page
save*stringActionposts the profile
changeEmailstringActionthe page that changes the account’s address
cancelstringActionwhere "Cancel" leads
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Values values · 9 props
PropTypeDescription
name*stringWordsthe name shown to others
handlestringWordsthe public handle, without @
email*stringDatathe account’s address, changed elsewhere
headlinestringWordsa short line under the name ("Ceramicist in Lyon")
biostringWordsthe bio the profile holds now
locationstringWordsthe location the profile holds now
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
coverstringPicturea picture: a root-relative path (/media/…) or an absolute URL
linksLink[]the value’s links, in order
Link values.links[] · 2 props
PropTypeDescription
label*stringWords"Site", "Portfolio"
url*stringDesignthe address
Options options · 3 props
PropTypeDescription
bioMaxnumberthe bio’s length limit, 160 by default
acceptstringWordsthe pictures accepted, in words ("PNG or JPG, 2 MB at most")
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
asseta picture’s address as your app serves it
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: upload, save, changeEmail, cancel
  • Reads account from 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

  • Notification preferences switch groups: notification choices as switches grouped by channel, each with the reason it exists.
  • 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.

All 38 settings blocks