App authorization card — Sign in and sign up block
Proauth-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-cardUsage
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.
| Prop | Type | Description |
|---|---|---|
| client* | Client | the third-party app asking for access |
| brand | Brand | the merchant’s own app, the one the account belongs to |
| title* | string | Wordsthe request, said plainly ("Tour Notebook wants to access your account") |
| lead | string | Wordsone sentence on why and what follows |
| account | string | Wordsthe 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* | Allow | grants the access |
| cancel* | Cancel | refuses and goes back |
| note | string | Wordshow to take the access back later, in the app’s own words |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Client client · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe name as it is shown to the visitor |
| logo | string | Pictureits square mark; without it, its initials |
| publisher | string | Wordswho publishes the app, as the request declares it ("Published by Studio Ardoise") |
Brand brand · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe name as it is shown to the visitor |
| logo | string | Pictureits square mark; without it, its initials |
Allow allow · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Allow", "Cancel") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe request the action answers, if any |
Cancel cancel · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Allow", "Cancel") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe request the action answers, if any |
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 |
| 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:
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.