Announcement banner
Use an announcement banner to highlight new features, releases, or important information. The banner appears at the top of every page, above the navigation bar.
Readers can dismiss the banner. It stays hidden until you update the message, then reappears automatically.
Setup
Add an announcement object with a message to docslit.json:
The message supports Markdown and HTML. You can include links, emphasis, and other inline formatting.
Configuration options
Banner types
Dismissal behavior
When a reader dismisses the banner, DocsLit stores a hash of the current message in localStorage. The banner stays hidden on future visits until you change the message in docslit.json and rebuild (or refresh in dev mode). Updating the message is how you publish a new announcement.
Version-specific announcements
On versioned sites, you can show different announcements per version. A version-level announcement overrides the site-wide fallback.
Version v1 shows the maintenance notice. Version v2 inherits the site-wide welcome message.
Migrating from Fern
When you run docslit import on a Fern project, DocsLit reads announcement.message from fern/docs.yml and adds it to the generated docslit.json. See Migrate from Fern.
In-page banners vs site-wide banners
DocsLit also includes <wc-banner> for banners inside page content. Use docslit.json announcement for site-wide notices that appear on every page. Use <wc-banner> in Markdown for page-specific callouts.
Next steps
- Set your site logo in the navigation bar
- Configure versioning for multi-release documentation