Skip to content

Commit 6f77c1f

Browse files
Update components/banner.mdx
1 parent e52b7ab commit 6f77c1f

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

components/banner.mdx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: 'Banner'
3+
description: 'Use banners to display important site-wide announcements and notifications'
4+
icon: 'megaphone'
5+
---
6+
7+
Use banners to display important announcements, updates, or notifications across your entire documentation site. Banners appear at the top of every page and support Markdown formatting.
8+
9+
## Configuration
10+
11+
Add a banner to your `docs.json` file. The banner supports Markdown formatting and can be made dismissible:
12+
13+
```json
14+
{
15+
"banner": {
16+
"content": "🚀 **New feature released!** [Check out our latest updates](/changelog)",
17+
"dismissible": true
18+
}
19+
}
20+
```
21+
22+
When `dismissible` is `true`, users can close the banner and it won't reappear for their session.
23+
24+
## Examples
25+
26+
<Tabs>
27+
<Tab title="Product announcements">
28+
```json
29+
{
30+
"banner": {
31+
"content": "🚀 Version 2.0 is now live! [See what's new](/changelog)",
32+
"dismissible": true
33+
}
34+
}
35+
```
36+
</Tab>
37+
<Tab title="Maintenance notices">
38+
```json
39+
{
40+
"banner": {
41+
"content": "⚠️ Scheduled maintenance: API will be unavailable Dec 15, 2-4 AM UTC",
42+
"dismissible": false
43+
}
44+
}
45+
```
46+
</Tab>
47+
<Tab title="Migration alerts">
48+
```json
49+
{
50+
"banner": {
51+
"content": "📋 **Action required:** Migrate to our new API by Jan 1st. [Migration guide](/migration)",
52+
"dismissible": true
53+
}
54+
}
55+
```
56+
</Tab>
57+
</Tabs>
58+
59+
## Properties
60+
61+
<ResponseField name="content" type="string" required>
62+
The banner message. Supports plain text and Markdown formatting including links, bold text, and emojis.
63+
</ResponseField>
64+
65+
<ResponseField name="dismissible" type="boolean">
66+
Whether users can dismiss the banner. When `true`, users can close the banner and it won't reappear for their session. Defaults to `false`.
67+
</ResponseField>

0 commit comments

Comments
 (0)