Expired link form — Error block

Pro

error-expired-link-form · for any pages

Expired link form

A link that ran out (sign-in, invitation, share): what the app recorded about it and a form for a fresh one

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/error-expired-link-form

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ErrorExpiredLinkForm from '@/components/trame/blocks/error/error-expired-link-form.vue'

const props = {
code: "Link expired",
title: "This sign-in link has done its job",
text: "Sign-in links only last fifteen minutes, so a forwarded email never turns into a key. Yours ran out; getting a new one takes a single click.",
home: {
label: "Back to home",
action: "home"
},
facts: [
{
label: "Link sent",
value: "9:14 a.m."
},
{
label: "First opened",
value: "9:47 a.m."
}
],
submit: "sign-in-link",
options: {
emailLabel: "Your email address",
submitLabel: "Send me a new link",
note: "A new link makes all the old ones unusable."
}
}
</script>

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

Props

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

PropTypeDescription
codestringWordsthe short code or word that names the page ("404", "Offline")
title*stringWordswhat happened, plainly ("This page cannot be found")
text*stringWordsone sentence: why, and what the visitor can do
home*Homethe link home: its words and the page action it runs
facts*Fact[]Datawhat the app recorded about a dead link (sent, opened, expired)
submit*stringActionthe action an email form posts to (a fresh link)
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Home home · 3 props
PropTypeDescription
label*stringWordswhat happens ("Back to the home page")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (a category), if any
Fact facts[] · 2 props
PropTypeDescription
label*stringWordswhat the value is about
value*stringWordsthe value, as the merchant states it
Options options · 7 props
PropTypeDescription
emailLabelstringWordsthe email field’s label
submitLabelstringWordsthe email form’s button ("Send me a new link")
notestringWordsthe reassurance under the form or the request ("A new link makes the old ones unusable")
contactContactthe contact action: its words and the page action it runs
reportReportthe report action: its words and the page action it runs
statusStatusthe link to the status page: its words and the page action
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
Contact options.contact · 3 props
PropTypeDescription
label*stringWordswhat happens ("Back to the home page")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (a category), if any
Report options.report · 3 props
PropTypeDescription
label*stringWordswhat happens ("Back to the home page")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (a category), if any
Status options.status · 3 props
PropTypeDescription
label*stringWordswhat happens ("Back to the home page")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (a category), if any
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
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: home, submit, options.contact, options.report, options.status
  • Reads categories from your app

A error section, for any pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

More error blocks

  • Access denied gatekeeper card: a page the account cannot open: who is signed in, who can grant the access, and the way to ask.
  • Message centered: a 404 or 500 that keeps to the point: a big code, the reason, the way home.
  • Page full bleed: a page with one strong picture: the words laid over it on a scrim.
  • Recovery search links: a lost visitor on a shop with a catalogue: a search field and helpful links, plus a way to report a broken link.
  • Way back split image: a page with room for the shop’s mood: the words and the ways back on one side, its picture on the other.

All 6 error blocks