Skip to main content

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 brands pattern
  • For inline body imagery - use the image component
  • For the organization bar above the header - use the masthead component; the masthead embeds a logo

Do

  • Use a descriptive alt value (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-dark and 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-dark and .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​

SlotRequiredDescription
primaryYesPrimary 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​

PropTypeDefaultDescription
urlstring-Optional homepage URL. When set, the root element is an anchor; otherwise a div.
titlestringClick to go to the homepageTitle attribute on the wrapping anchor.
classesarray-Additional CSS class words merged into the root element.
attributesobject-Additional HTML attributes spread on the root element.

Classes​

ClassCapabilityDefaultDescription
.smSize-Small.
.mdSizeYesMedium.
.lgSize-Large.
.horizontalOrientationYesChildren flow along the horizontal axis.
.verticalOrientation-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 alt attribute (containing the organization name for image-only logos), or aria-label for icon-only cases.
  • Image alt is 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-dark so the correct one shows per active color scheme
  • The logo link is keyboard focusable and shows a visible focus ring.
  • masthead - identity bar above the header, typically embedding a logo
  • header - primary site header, typically embedding a logo
  • brands - strip of partner or sponsor logos
  • image - generic content image