brand-mark

Inert custom element for brand/logo display. Use in headers, footers, and anywhere you need consistent brand representation.

Overview

The <brand-mark> element provides a consistent way to display your brand name and logo. It handles typography, spacing, and link styling automatically.

Attributes

Attribute Values Default Description
src URL - Path to logo image (SVG preferred). JS enhancement injects an <img> element.
alt string text content Alt text for the logo image. Defaults to the element's text content.
wordmark boolean - Show text alongside the image logo. Without this, only the image is shown.
height number (px) - Explicit pixel height for the logo image.
data-size s, l, xl - Adjust brand mark size
data-stack boolean - Stack logo and text vertically

Basic Usage

Wrap your brand name in the element, optionally with a logo image. Use an empty alt on the image since the brand name provides the text alternative.

Image Logo via src

Use the src attribute to load a logo image. The JS enhancement injects an <img> element automatically. Without JS, the text content renders as a fallback — this is progressive enhancement.

By default, only the image is shown. The text content becomes the alt text or aria-label.

Image + Wordmark

Add the wordmark attribute to show the brand name text alongside the logo image.

Use height to control the image size explicitly. The CSS token --brand-mark-height can also be set by themes.

Sizes

Use data-size to adjust the brand mark for different contexts.

Stacked Layout

Use data-stack for vertical logo and text arrangement. Useful for centered layouts like login pages or footers.

As a Link

Wrap in an anchor to make the brand mark clickable. The element automatically removes link underlines and adjusts hover states.

In a Header

Common usage in site headers with navigation.

Accessibility

  • When using the src attribute without wordmark, the text content is used as aria-label or image alt
  • When using wordmark, the image gets alt="" (decorative) since the visible text provides the label
  • When manually adding an <img> child, set alt="" since the brand name text provides the text alternative
  • When wrapped in a link, the brand name serves as the link text
  • Ensure sufficient color contrast between brand text and background
  • Focus states are handled automatically when wrapped in a link
  • Without JS, the src attribute has no effect — text content always provides a readable fallback

Content Model

Permitted Content

  • Text (brand name)
  • Optional <img> or <svg> (logo)

Permitted Parents

Any flow content. Commonly placed inside <a>, <header>, or <nav>.

CSS Tokens

TokenDefaultDescription
--brand-mark-height 2rem Height of the logo image (set by themes)

Related

  • <header> — Sectioning element for page headers
  • <nav> — Navigation container
  • <a> — Anchor element for links