Sso stacked — Settings block
Prosettings-sso-stacked · for app, settings pages
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.
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-sso-stackedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import SettingsSsoStacked from '@/components/trame/blocks/settings/settings-sso-stacked.vue'
const props = {
title: "Single sign-on",
intro: "Let your team sign in to Fernhill with your company’s identity provider over SAML.",
provider: {},
serviceValues: [
{
label: "ACS URL (reply URL)",
value: "https://app.fernhill.example/sso/saml/acs/ws_4k2m9"
},
{
label: "Entity ID (audience)",
value: "https://app.fernhill.example/sso/saml/ws_4k2m9"
}
],
status: {
state: "not-set",
message: "Single sign-on is not set up yet. Members sign in with their password or Google."
},
domains: [
"fernhill.example"
],
enforce: {
value: false,
consequence: "Members with these domains can no longer sign in with a password or Google."
},
save: {
label: "Save settings",
action: "saveSso"
},
docs: {
label: "Read the setup guide",
action: "ssoGuide"
}
}
</script>
<template>
<SettingsSsoStacked v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe panel’s heading ("Single sign-on") |
| intro | string | Wordsa sentence under the heading on what single sign-on does for the workspace |
| provider* | Provider | the identity provider’s details as saved, empty until the admin fills them: the metadata URL, or the entity ID, sign-in URL and certificate |
| serviceValues* | ServiceValue[] | the workspace’s values the admin copies into the identity provider: each with a copy button once the page runs, selectable without it |
| status | Status | where single sign-on stands now, as the host knows it; absent, no status is shown |
| domains | string[] | Wordsthe verified e-mail domains single sign-on applies to: people whose address ends with one of them |
| enforce | Enforce | a switch that makes single sign-on the only way in, posted as `enforce` = "1" when on (absent when off); its consequence said in words |
| save* | Save | the save action: its words and the page action it runs |
| docs | Docs | a link to the setup guide ("Read the setup guide") |
| options | Options | the block’s settings, read by every variant |
Provider provider · 4 props
| Prop | Type | Description |
|---|---|---|
| metadataUrl | string | Datathe identity provider’s metadata URL saved now, posted as `metadataUrl`; it alone is enough |
| entityId | string | Datathe identity provider’s entity ID (issuer) saved now, posted as `entityId` |
| signInUrl | string | Datathe identity provider’s sign-in URL saved now, posted as `signInUrl` |
| certificate | string | Datathe identity provider’s X.509 signing certificate saved now, as PEM text, posted as `certificate` |
ServiceValue serviceValues[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the identity provider calls this value ("ACS URL", "Entity ID") |
| value* | string | Datathe workspace’s own value to copy into the identity provider ("https://app.example.com/sso/acs/ws_8f2k") |
Status status · 2 props
| Prop | Type | Description |
|---|---|---|
| state* | 'not-set' | 'active' | 'error' | where single sign-on stands: "not-set" never set up, "active" members sign in with it, "error" set up but failing |
| message | string | Wordsthe host’s own words on the state ("The certificate expired on March 3. Paste the new one.") |
Enforce enforce · 2 props
| Prop | Type | Description |
|---|---|---|
| value | boolean | true: everyone with a verified domain must sign in with single sign-on now |
| consequence | string | Wordsone line on what turning it on changes, the host’s words ("Passwords and Google sign-in stop working for these members.") |
Save save · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe save button ("Save settings") |
| action* | string | Actionsaves the settings: posts `metadataUrl`, `entityId`, `signInUrl`, `certificate` and `enforce`; without it on the page, the settings are shown read-only |
Docs docs · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
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 |
| 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:
form.submit,docs - Reads
settingsfrom 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
- 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.
- Profile editor compact card: an account with few public fields: one narrow centred card, the portrait on top, a few fields and one full-width save button.
- 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.
- 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.
- 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.