Synertech Web/ui v0.57.5 Site Storybook

Documentation / Feedback & overlays

Banner

Client@synertech/uiOpen in Storybook

A full-width banner for a message that concerns the whole page, in three variants:

  • "notification" (default): a status message coloured by type (info, success, warning, error, neutral), with its icon and role="alert";
  • "hero": a large centred title, on a dark background or a darkened backgroundImage;
  • "promotion": a gradient line with a badge, for an offer or something new.

With closable, the cross hides the banner (the state is internal) then calls onClose: remember that choice yourself if the banner must not come back on the next load. For a transient message triggered by an action, prefer a Toast.

Examples

Notification

type gives the colour and the icon; description (or children) the text.

Open in a tab
import { Banner } from "@synertech/ui";

export function Notification() {
  return (
    <Banner
      type="info"
      title="Maintenance prévue"
      description="Le service sera indisponible dimanche de 2 h à 4 h."
    />
  );
}

The five types

A banner without a title shows its text directly.

Open in a tab
import { Banner } from "@synertech/ui";

export function Types() {
  return (
    <div className="space-y-3">
      <Banner type="default">Vous consultez une version archivée de ce document.</Banner>
      <Banner type="info">Une nouvelle version de l’application est disponible.</Banner>
      <Banner type="success">Votre domaine est vérifié.</Banner>
      <Banner type="warning">Votre essai gratuit se termine dans 3 jours.</Banner>
      <Banner type="error">La synchronisation a échoué : vérifiez vos identifiants.</Banner>
    </div>
  );
}

Closable, with an action

closable adds the cross and onClose notifies you; action holds a button.

Open in a tab
import { Banner, Button } from "@synertech/ui";

export function ClosableWithAction() {
  return (
    <Banner
      type="warning"
      title="Facture impayée"
      description="Réglez la facture de mars pour conserver l’accès à votre espace."
      closable
      onClose={() => console.log("Bandeau masqué")}
      action={<Button size="sm">Payer maintenant</Button>}
    />
  );
}

Hero

The title becomes a centred h2; backgroundImage is covered with a dark veil to keep the text readable.

Open in a tab
import { Banner, Button } from "@synertech/ui";

export function Hero() {
  return (
    <Banner
      variant="hero"
      title="Pilotez vos projets en équipe"
      description="Planning, tâches et documents réunis au même endroit."
      backgroundImage="https://picsum.photos/1200/400"
      action={<Button size="lg">Commencer gratuitement</Button>}
    />
  );
}

Full-width promotion

badge labels the offer; fullWidth removes the rounding to sit flush with the page edges.

Open in a tab
import { Banner, Button } from "@synertech/ui";

export function Promotion() {
  return (
    <Banner
      variant="promotion"
      fullWidth
      badge="Nouveau"
      title="Les tableaux de bord arrivent"
      description="Créez vos premiers graphiques en deux clics."
      closable
      action={
        <Button size="sm" bgColor="bg-white hover:bg-gray-100" textColor="text-indigo-700">
          Découvrir
        </Button>
      }
    />
  );
}

API reference

Components

ComponentClient
import { Banner } from "@synertech/ui";

Props — BannerProps

PropTypeDefaultDescription

+ 277 inherited native attributes from HTMLAttributes, AriaAttributes, DOMAttributes (className, id, aria-*, event handlers…).

Types

type BannerType = "info" | "success" | "warning" | "error" | "default"
type BannerVariant = "notification" | "hero" | "promotion"