Skip to main content
FeedbackLevel 2

Banner

横幅提示

WebMobileDifficulty: Easy

A full-width strip pinned to the top or bottom of the page that carries a message about the whole app.

01

Live Demo

Actually clickable

You're offline — this content may be out of date

Page content goes here

A full-width, app-wide message. A Banner is for when "the entire app is affected", like losing connection.

What you just saw:The yellow strip at the top of a site reading "This site will be down tonight at 2:00", the bar at the top of an app reading "You are currently offline".

02

What it actually is

A banner is the global version of an alert: it belongs to no particular form or section, it speaks for the entire app or site — maintenance windows, network outages, new version notices.

bannerannouncement bartop barfull-width noticesite banner
03

Anatomy · What it's made of

  1. Strip条状容器

    Full width, solid color background

  2. Icon图标

    Optional

  3. Message消息

    Centered or left-aligned

  4. Dismiss关闭

    Optional ✕ the user can close it

  5. Action操作

    Such as "Update" or "Retry"

04

When to Use

When it fits, and when it doesn't
Banner usage recommendations
SituationUse it?
A condition affects the entire app (offline, under maintenance)Yes
The notice is global and unrelated to any specific piece of contentYes
Users should know about it, but it should not interrupt their workYes
The error belongs to one particular input fieldNo

A banner belongs above the content, at the top. Parked at the very bottom of the page it is the same as invisible.

Do not use a banner for marketing — that is the landing page hero banner’s job, not the product UI.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a global banner at the top of the page: "You are offline, content may be out of date" plus a "Retry" button. The user can dismiss it manually, and that dismissed state lasts for the current session.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Add a notice bar at the top.

Say this instead

Add a global banner (full width, role=status): show "You are offline" plus a "Retry" button, let the user dismiss it with the state stored in sessionStorage, and listen to online/offline events to show it automatically and swap the copy when connectivity returns.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.