App authorization card — Sign in and sign up block

Pro

auth-app-authorization-card · for app, account pages

App authorization card

A third-party app asks to connect to the visitor’s account: both marks joined at the top, what it will be able to do as a tick list, cancel or allow at the foot of a centred card; the permissions really requested only

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/auth-app-authorization-card

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import AuthAppAuthorizationCard from '@/components/trame/blocks/auth/auth-app-authorization-card.vue'

const props = {
client: {
name: "Route Book",
publisher: "Published by Slate Studio"
},
brand: {
name: "Lumiere Studio"
},
title: "Route Book wants to access your account",
lead: "The app prepares your shipments from your orders. You can remove this access at any time.",
account: "[email protected]",
scopes: [
"See your orders and their tracking",
"Read the shipping addresses on your orders"
],
allow: {
label: "Allow access",
action: "app.authorize"
},
cancel: {
label: "Cancel",
action: "app.deny"
},
note: "You’ll find this app under Settings › Connected apps, where you can remove its access in one click."
}
</script>

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

Props

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

PropTypeDescription
client*Clientthe third-party app asking for access
brandBrandthe merchant’s own app, the one the account belongs to
title*stringWordsthe request, said plainly ("Tour Notebook wants to access your account")
leadstringWordsone sentence on why and what follows
accountstringWordsthe account that will be connected, as the app shows it (an address, a shop’s name)
scopes*string[]Wordsthe permissions really requested, in the order the request lists them
allow*Allowgrants the access
cancel*Cancelrefuses and goes back
notestringWordshow to take the access back later, in the app’s own words
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Client client · 3 props
PropTypeDescription
name*stringWordsthe name as it is shown to the visitor
logostringPictureits square mark; without it, its initials
publisherstringWordswho publishes the app, as the request declares it ("Published by Studio Ardoise")
Brand brand · 2 props
PropTypeDescription
name*stringWordsthe name as it is shown to the visitor
logostringPictureits square mark; without it, its initials
Allow allow · 3 props
PropTypeDescription
label*stringWordswhat happens ("Allow", "Cancel")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe request the action answers, if any
Cancel cancel · 3 props
PropTypeDescription
label*stringWordswhat happens ("Allow", "Cancel")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe request the action answers, if any
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
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: allow, cancel

A sign in and sign up section, for app, account pages; it uses @lucide/vue, 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 sign in and sign up blocks

  • Accept invite card: a centred card: who invited, which space, the role and what it allows, one main action to accept — the default invitation.
  • Accept invite split panel: a full page split in two: the space large on a calm tinted panel with who invited, the role, its permissions and the decision beside it — a welcoming first visit.
  • Account merge side by side: two identities that turn out to be one person: both shown side by side, one action to join them.
  • Account recovery ranked: a first way in (an address to find the account), then the other ways ranked by how long they take, and why the slow one is slow.
  • Code bare: no card at all: the code field on the page, the legal links in a band at the foot.
  • Code centered card: a card centered on a quiet page: the default for any shop, the same card as its sign-in.
  • Code modal over app: the card over a blurred page: a second factor asked again in the middle of a session, a gated area.
  • Code quote panel: form beside a contained panel where the shop speaks in its own voice, signed by a person; with nothing to put beside it, the quiet card.

All 30 sign in and sign up blocks