Logo
Wraps a link to the homepage around one or two logo slots (primary/secondary) - the consumer supplies the image markup (<picture>, inline SVG, plain <img>, whatever format is needed). Supports a responsive mobile/desktop image swap, an automatic light/dark image swap, and vertical or horizontal arrangement of the two slots.
Usage
When to use
- The primary site identity in the header or masthead
- Any standalone placement of the organization logo that links to the homepage
- When the consumer wants a consistent responsive behavior and dark-mode swap
When not to use
- For a strip of partner / sponsor logos - use the
brandspattern - For inline body imagery - use the
imagecomponent - For the organization bar above the header - use the
mastheadcomponent; the masthead embeds a logo
Do
- Use a descriptive
altvalue (organization name), not the word "logo" - Provide a dark-mode image where the light-mode logo would not have enough contrast against a dark background - mark the two images
.logo-image-light/.logo-image-darkand the matching one is shown per active color scheme - Combine the two swaps where both matter: mark all four images
.logo-image-light/.logo-image-darkand.logo-image-mobile/.logo-image-desktop, and one image shows per slot. An image marked on neither axis shows in every scheme at every width - Wrap the logo in a link pointing at the homepage
Don't
- Use "logo" as the alt text
- Add multiple competing logos to the same header
- Rely on color alone to distinguish the logo from its surroundings
API
Slots
| Slot | Required | Description |
|---|---|---|
primary | Yes | Primary logo slot. Accepts any HTML, typically an image or SVG. |
secondary | - | Secondary logo slot. When both slots are populated, a stripe separator is rendered between them. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
url | string | - | Optional homepage URL. When set, the root element is an anchor; otherwise a div. |
title | string | Click to go to the homepage | Title attribute on the wrapping anchor. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.sm | Size | - | Small. |
.md | Size | Yes | Medium. |
.lg | Size | - | Large. |
.horizontal | Orientation | Yes | Children flow along the horizontal axis. |
.vertical | Orientation | - | Children flow along the vertical axis. |
Examples
Vertical
Image with organization text below.
Horizontal
Image with organization text beside.
Primary
Only the primary slot filled, for a site with a single identity and no partner mark.
Secondary
Only the secondary slot filled, for a sub-site whose own mark stands alone.
Narrow
Below 1024px each slot swaps to its .logo-image-mobile artwork, in the scheme the page is currently in.
Accessibility
- WCAG 2.2 AA
- The logo link has an accessible name from one of: visible text, the linked image's
altattribute (containing the organization name for image-only logos), oraria-labelfor icon-only cases. - Image
altis the organization name, not "logo". - Sufficient contrast for the logo on both light and dark schemes - mark the two images
.logo-image-light/.logo-image-darkso the correct one shows per active color scheme - The logo link is keyboard focusable and shows a visible focus ring.