Canvas Design System
Main Site Tokens

Banner

Full-width announcement strip for the top of pages. Use for site-wide promotions, new feature callouts, maintenance notices, or calls-to-action.

When to Use

Use Banner when: Site-wide announcements, promotions, new feature launches, or time-limited notices that should appear at the very top of a page.
Don't use when: Inline feedback or status messages — use Alert instead. Landing page headers — use Hero instead.

Variants

Five colour variants for different contexts.

This is a default announcement banner.
New feature: Custom Exercise Builder is now live!
Your workshop has been saved successfully.
Scheduled maintenance this Saturday 2–4 AM UTC.
Limited time: 30% off annual plans.
<?= ws_banner('Default announcement.') ?>
<?= ws_banner('Brand message!', ['variant' => 'brand', 'icon' => 'auto_awesome']) ?>
<?= ws_banner('Success message.', ['variant' => 'success', 'icon' => 'check_circle']) ?>
<?= ws_banner('Warning message.', ['variant' => 'warning', 'icon' => 'schedule']) ?>
<?= ws_banner('Dark banner.', ['variant' => 'dark', 'icon' => 'local_offer']) ?>

With Action

Add an action link to direct users somewhere.

New: Run Mode lets you present your workshop like a pro. Try it now
Workshop planning just got easier with drag-and-drop. Open Planner
<?= ws_banner('New feature announcement.', [
    'variant' => 'brand',
    'icon' => 'slideshow',
    'action' => 'Try it now',
    'href' => '/planner/',
]) ?>

Dismissible

Add a close button so users can dismiss the banner.

Maintenance window: Saturday 2–4 AM UTC.
Welcome back! Your 3 saved workshops are ready. View workshops
<?= ws_banner('Dismissible banner.', [
    'variant' => 'warning',
    'icon' => 'construction',
    'dismissible' => true,
]) ?>

Left Aligned

Set centered to false for left-aligned text.

Left-aligned banner for contextual pages. Learn more
<?= ws_banner('Left-aligned banner.', [
    'centered' => false,
    'action' => 'Learn more',
    'href' => '/docs/',
]) ?>

Parameters

Parameter Type Default Description
$messagestringBanner text (supports inline HTML)
variantstring'default'default | brand | success | warning | dark
iconstring''Material icon name
actionstring''Action link text
hrefstring'#'Action link URL
onclickstring''JS onclick handler for the action
dismissibleboolfalseShow close button
centeredbooltrueCenter-align content
idstring''Element ID
classstring''Additional CSS classes

Anatomy

.ws-banner — Outer wrapper with background colour
.ws-banner__inner — Centred flex container (max-width 1200px)
.ws-banner__icon — Optional leading icon
.ws-banner__message — Text content
.ws-banner__action — Optional CTA link with arrow
.ws-banner__close — Optional dismiss button

CSS Classes

ClassPurpose
.ws-bannerBase wrapper
.ws-banner--defaultLight neutral background
.ws-banner--brandBrand gradient background
.ws-banner--successGreen tint background
.ws-banner--warningAmber tint background
.ws-banner--darkDark background
.ws-banner--centeredCentre-align inner content

Files

FilePurpose
includes/components/helpers.phpws_banner() helper function
includes/components/banner.phpBanner template
includes/components/components.cssBanner CSS