Change notice disclosure — Banner block

Free

banner-change-notice-disclosure · for home, catalog, product, cart, landing pages

Change notice disclosure

A price or policy change that needs up to three facts: a headline that opens a short panel

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/banner-change-notice-disclosure

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BannerChangeNoticeDisclosure from '@/components/trame/blocks/banner/banner-change-notice-disclosure.vue'

const props = {
message: "Fernbank card fees go down on November 1.",
action: {
label: "See the fee schedule",
action: "page",
record: {
id: "fees"
}
},
facts: [
{
title: "What’s changing",
text: "International card payments cost 1.2% instead of 1.5%; domestic transfers stay free."
},
{
title: "Starting when",
text: "For every payment made on or after November 1."
}
],
dismissible: true,
tone: "neutral"
}
</script>

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

Props

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

PropTypeDescription
message*stringWordsthe headline of the change, in one sentence, exactly as the merchant wrote it
detailstringWordswhat completes the headline, if it needs it
badgestringWordsa short tag before the message ("New")
iconstringDesignan icon before the message: info, truck, tag, bell, gift, globe, megaphone or alert
actionActionthe call to action: its words and the page action it runs
facts*Fact[]the facts shown, in order
dismissiblebooleantrue: the visitor can close the notice
tone'neutral' | 'brand' | 'inverse' | 'alert'the status colour
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Action action · 3 props
PropTypeDescription
label*stringWordswhat the link does ("Learn more")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Fact facts[] · 2 props
PropTypeDescription
title*stringWordswhat the fact is about ("What")
text*stringWordsthe fact itself
Options options · 2 props
PropTypeDescription
stickybooleantrue: the notice stays in view while the page scrolls
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
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
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: action

A banner section, for home, catalog, product, cart, landing 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 banner blocks

  • Announcement capsule: a light rounded capsule centred at the top of the page, badge, message and a text link between hairlines: a release or a new collection that should not look like an alert.
  • Announcement docked: an app download or an upgrade: a bar fixed to the bottom of the screen, with its button.
  • Announcement floating: a pill that floats at the bottom of the page without covering the content: a short offer, dismissed easily.
  • Announcement top bar: the usual strip above the header: one sentence and a link, for a promotion or a piece of news.
  • Countdown cutoff line: the delivery promise, to the minute ("Order within 3 h 12 min for delivery on …"): the shop’s real last order time for a date.
  • Countdown inline digits: one quiet centred line with the time left as digits: the end of a sale the merchant really set, above the header.
  • Countdown unit boxes: the time left as boxed days, hours, minutes and seconds beside the message: a short sale or a launch the merchant wants seen.
  • Free shipping progress: the shop has a free-shipping rule: a progress bar reading the cart’s total, or the rule alone without a cart.

All 14 banner blocks