From 1f8c11b67cf9260879dd62aa06e4efa4be25b946 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:46:59 +0100 Subject: [PATCH] Update banners.md --- .../access-security/interface/banners.md | 325 ++++++++++++++---- 1 file changed, 264 insertions(+), 61 deletions(-) diff --git a/docs/features/access-security/interface/banners.md b/docs/features/access-security/interface/banners.md index 1cf97761..058d39fe 100644 --- a/docs/features/access-security/interface/banners.md +++ b/docs/features/access-security/interface/banners.md @@ -5,120 +5,323 @@ title: "Customizable Banners" ## Overview -Open WebUI allows administrators to display custom banners to logged-in users. This feature is useful for making announcements, displaying system-wide alerts, or sharing important information. Banners are persistent and can be configured to be dismissible by users. +Open WebUI allows administrators to display custom banners to logged-in users. Banners are useful for announcements, system-wide alerts, maintenance notices, and other important messages. -You can configure banners in two ways: through the Admin Panel for a user-friendly experience, or via environment variables for automated or GitOps-style deployments. +Banners are persistent and can optionally be **dismissible** by users. You can configure banners in two ways: -## Configuring Banners +1. **Admin Panel** (recommended for quick edits and experimentation) +2. **Environment variable (`WEBUI_BANNERS`)** (recommended for automated / GitOps-style deployments) + +--- + +## When to use banners + +Banners are best for short, high-visibility messages such as: + +- Scheduled maintenance and planned downtime windows +- Incident notifications (degraded performance, partial outages) +- Policy reminders (acceptable use, data handling, retention) +- Major changes (new models, feature rollouts, UI changes) +- Links to your internal comms channels for updates and Q&A + +**Tip:** Keep banners concise and link to more detailed information (status page, release notes, support channel). + +--- + +## Configuring banners ### Option 1: Using the Admin Panel -This is the most straightforward way to manage banners. +This is the most straightforward way to manage banners: -1. **Log in** to your Open WebUI instance as an administrator. -2. Navigate to the **Admin Panel** > **Settings** > **General**. -3. Locate the **"Banners"** section. -4. Click the **+** icon to add a new banner. +1. Log in to your Open WebUI instance as an administrator. +2. Navigate to **Admin Panel** → **Settings** → **General**. +3. Locate the **Banners** section. +4. Click the **+** icon to add a new banner. +5. Click **Save** to apply your changes. -You can then configure the following options for each banner: +You can configure the following options for each banner: -- **Type:** The color and style of the banner. Choose from: - - `info` (Blue) - - `success` (Green) - - `warning` (Yellow) - - `error` (Red) -- **Title:** The main heading of the banner. -- **Content:** The main text or message of the banner. -- **Dismissible:** If toggled on, users can close the banner. Dismissed banners are stored in the user's browser, so they will not reappear for that user unless their browser cache is cleared. If toggled off, the banner will always be visible. +- **Type:** The color and style of the banner: + - `info` (Blue) + - `success` (Green) + - `warning` (Yellow) + - `error` (Red) +- **Title:** The main heading of the banner. +- **Content:** The main message (HTML only). +- **Dismissible:** If enabled, users can close the banner. -5. Click **"Save"** at the bottom of the page to apply your changes. +#### How dismissing works -### Option 2: Using Environment Variables +Dismissed banners are stored in the user’s browser (client-side). This means: -For automated deployments, you can configure banners using the `WEBUI_BANNERS` environment variable. The variable should be a JSON string representing a list of banner objects. +- A dismissed banner may reappear if the user clears site data / cache +- A dismissed banner may reappear on a different device or browser +- Dismissal is per-banner `id` (if the `id` changes, the banner is treated as new) -**Environment Variable:** +If you need the banner to remain visible for everyone, set `dismissible: false`. -- `WEBUI_BANNERS` - - **Type:** `string` (containing a JSON list of objects) - - **Default:** `[]` - - **Description:** A list of banner objects to be displayed to users. +--- -**Example:** +### Option 2: Using environment variables (`WEBUI_BANNERS`) -Here is an example of how to set the `WEBUI_BANNERS` variable in a `docker-compose.yml` file: +For automated deployments, configure banners using the `WEBUI_BANNERS` environment variable. The value must be a **JSON string** representing a **list** (array) of banner objects. + +**Environment variable:** + +- `WEBUI_BANNERS` + - **Type:** `string` (containing a JSON list of objects) + - **Default:** `[]` + - **Description:** A list of banner objects to be displayed to users + +#### Example (Docker Compose) ```yaml services: open-webui: image: ghcr.io/open-webui/open-webui:main environment: - - 'WEBUI_BANNERS=[{"id":"update-2024-07-26","type":"info","title":"System Update","content":"A system update is scheduled for this Friday at 10 PM. Expect brief downtime.","dismissible":true},{"id":"policy-reminder","type":"warning","title":"Policy Reminder","content":"Please remember to adhere to the company-wide usage policy.","dismissible":false}]' + - 'WEBUI_BANNERS=[{"id":"maintenance-2026-03","type":"warning","title":"Maintenance","content":"A maintenance window is planned this week. Expect brief interruptions. See status page.","dismissible":true,"timestamp":1772500000}]' ``` -## Banner Object Properties +> Note: Because `WEBUI_BANNERS` is a JSON string inside YAML, you must ensure it remains valid JSON (see "Common pitfalls" below). -Each banner object in the JSON list has the following properties: +--- -- `id` (string, required): A unique identifier for the banner. This is used to track which banners a user has dismissed. -- `type` (string, required): The style of the banner. Must be one of `info`, `success`, `warning`, or `error`. -- `title` (string, optional): The title text displayed on the banner. -- `content` (string, required): The main message of the banner. -- `dismissible` (boolean, required): Determines if the user can close the banner. `true` means it can be dismissed; `false` means it cannot. -- `timestamp` (integer, required): **Note:** While this field is present in the configuration, it is not currently used by the frontend. The timestamp does not affect whether a banner is displayed or not. +## Banner object properties -## Supported Content Formatting +Each banner object supports the following properties: -Banner content supports a subset of **HTML only** — Markdown syntax is not rendered. The following elements work in the `title` and `content` fields: +- `id` (string, required): Unique identifier for the banner. Used to track whether a user has dismissed it. +- `type` (string, required): Banner style. Must be one of: `info`, `success`, `warning`, `error`. +- `title` (string, optional): Title text. +- `content` (string, required): Main banner message (HTML only). +- `dismissible` (boolean, required): Whether the user can dismiss the banner. +- `timestamp` (integer, required): Present in configuration, but currently not used by the frontend to control display timing. -### Text Formatting +### Recommended `id` strategy (important) + +Pick an `id` format that supports safe updates and avoids accidental re-showing or permanent hiding: + +- Stable `id` for small text edits: `policy-reminder` +- Versioned `id` for "show again to everyone" updates: `incident-2026-03-06-v2` +- Time-bucketed `id` for recurring events: `maintenance-2026-03` + +If users dismissed a banner and you want them to see an updated message, change the `id`. + +--- + +## Supported content formatting (HTML only) + +Banner `title` and `content` support a subset of **HTML only** — Markdown syntax is not rendered. Unsupported tags may render as plain text or break the layout. + +### Text formatting | HTML | Effect | -|------|--------| -| `` / `` | **Bold** | -| `` / `` | *Italic* | +| --- | --- | +| `` / `` | Bold | +| `` / `` | Italic | | `` | Underline | -| `` / `` | ~~Strikethrough~~ | +| `` / `` | Strikethrough | | `` | Highlight | | `` | Slightly smaller text | | `` / `` | Subscript / Superscript | -| `` / `` | `Monospace inline code` | +| `` / `` | Monospace inline code | | `` | Hover tooltip | ### Structure | HTML | Effect | -|------|--------| +| --- | --- | | `
` or literal newlines | Line break | | `
` | Horizontal rule | | `
Click...
` | Collapsible section | -### Links & Media +### Links & media | HTML | Effect | -|------|--------| +| --- | --- | | `` | Clickable link | | `` | Inline image | -### Custom Styling +### Custom styling -Any inline `style=""` attribute works on allowed tags: +Inline styles are supported on allowed tags: ```html -Colored text -Size override -Gradient +Colored text +Heavier weight +Gradient background ``` -:::warning Unsupported Content -Headings (`

`–`

`), lists (`