Skip to content
v0.9.1
Layout

Announcement bar

One line at the very top of a website for news: a launch, a sale, a new version. It goes above the navbar and scrolls away with the page. A close button hides it, and with data-momo-dismiss it stays hidden on later visits.

Announcement bar

New Momo 1.0 is out, with a site sidebar and mega menus. Read the post

Spring sale: 30% off every plan until Friday.

Get the deal

Heads up: the dashboard will be down for upkeep on Sunday, 2:00 to 3:00. Status page

We're hiring designers and developers. See open roles

<div class="stack gap-3">
  <div class="announce">
    <p><span class="badge badge-yellow">New</span> Momo 1.0 is out, with a site sidebar and mega menus. <a href="#">Read the post</a></p>
    <button class="announce-close" type="button" aria-label="Dismiss"><i class="mi mi-x" aria-hidden="true"></i></button>
  </div>
  <div class="announce announce-yellow">
    <p><i class="mi mi-tag" aria-hidden="true"></i> Spring sale: 30% off every plan until Friday.</p>
    <a class="btn btn-ink" href="#">Get the deal</a>
    <button class="announce-close" type="button" aria-label="Dismiss"><i class="mi mi-x" aria-hidden="true"></i></button>
  </div>
  <div class="announce announce-violet-soft announce-start">
    <p><b>Heads up:</b> the dashboard will be down for upkeep on Sunday, 2:00 to 3:00. <a href="#">Status page</a></p>
    <button class="announce-close" type="button" aria-label="Dismiss"><i class="mi mi-x" aria-hidden="true"></i></button>
  </div>
  <div class="announce announce-surface">
    <p>We're hiring designers and developers. <a href="#">See open roles <i class="mi mi-arrow-right rtl-flip" aria-hidden="true"></i></a></p>
  </div>
</div>

Press × to see it go. Leave the close button out for a bar that always shows.

Remember it was closed

Give the bar a data-momo-dismiss name. Once a reader closes it, Momo remembers that in their browser and keeps it hidden on every page. Use a new name for the next announcement so it shows again.

Close me, then reload the page: I stay closed.

<div class="announce announce-green" data-momo-dismiss="docs-demo-1">
  <p><i class="mi mi-sparkles" aria-hidden="true"></i> Close me, then reload the page: I stay closed.</p>
  <button class="announce-close" type="button" aria-label="Dismiss"><i class="mi mi-x" aria-hidden="true"></i></button>
</div>
<button class="btn btn-sm mt-3" type="button" onclick="try{localStorage.removeItem('momo-dismiss:docs-demo-1')}catch(e){};document.querySelector('[data-momo-dismiss=&quot;docs-demo-1&quot;]').hidden=false">Bring it back</button>

Closing a bar sends a momo:dismiss event, in case you want to count it.

On a page

<body>
  <div class="announce" data-momo-dismiss="v1-launch">…</div>
  <header class="navbar navbar-sticky">…</header>
  …

The docs site example has one above its sticky navbar.

Classes

ClassDoes
.announceThe bar: dark by default, text in the middle (at the start on phones)
.announce-closeThe × button at the end
.announce-startText at the start
.announce-brand / -surface / -paperBrand color / white / page color (with a line under it)
.announce-<color> / .announce-<color>-softAny Momo color, full or soft
data-momo-dismiss="name"Stays hidden once closed (saved in this browser)

Accessibility

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close