Skip to main content Home About the Design SystemRoadmap OverviewDesignersDevelopers OverviewColorGridIconographyInteractionsSpacingTypography Overview Global colorBox shadowTypographyBorderOpacitySpaceLengthIconBreakpointsMedia queries All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Menu dropdown Navigation link Navigation (primary) Navigation (secondary) Navigation (vertical) Pagination PopoverPlanned Progress stepper Scheme toggle Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed OverviewColor PalettesCustomizingDevelopers All PatternsAccordionCall to ActionCardFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTabsTagTile All Personalization PatternsAnnouncement FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers Design/code status Release notes Get support

Surface

OverviewStyleGuidelinesCodeDemos
OverviewStatusWhen to useStatus checklistOverviewStatusWhen to useStatus checklist

Overview

A surface provides color context to descendants via color-palette. Authors must set a color-palette and should use surface only when containers like rh-card are not appropriate. Each palette provides WCAG-compliant contrast when using the default theme. Surface is non-interactive: Tab and focus pass through to focusable children. Users of AT perceive no additional semantics from this element.

#surface {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  justify-items: center;
  align-items: center;
  padding: var(--rh-space-xl);
}
import '@rhds/elements/rh-surface/rh-surface.js';
import '@rhds/elements/rh-blockquote/rh-blockquote.js';
import '@rhds/elements/rh-spinner/rh-spinner.js';
import '@rhds/elements/rh-tag/rh-tag.js';
<rh-surface id="surface" color-palette="darkest">
  <rh-blockquote align="inline-start" size="default">
    <p>Surface is used to provide a theme to children</p>
  </rh-blockquote>
  <rh-spinner size="lg">Loading...</rh-spinner>
  <rh-tag color="green">Sold</rh-tag>
</rh-surface>
import { Blockquote } from "@rhds/elements/react/rh-blockquote/rh-blockquote.js";
import { Spinner } from "@rhds/elements/react/rh-spinner/rh-spinner.js";
import { Surface } from "@rhds/elements/react/rh-surface/rh-surface.js";
import { Tag } from "@rhds/elements/react/rh-tag/rh-tag.js";

// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.

export const Demo = () => (
  <Surface id="surface" color-palette="darkest">
    <Blockquote align="inline-start" size="default">
      <p>Surface is used to provide a theme to children</p>
    </Blockquote>
    <Spinner size="lg">Loading...</Spinner>
    <Tag color="green">Sold</Tag>
  </Surface>
);

Sets the color palette, which controls the element's background color and propagates accessible text and interactive colors to descendants. Accepted values are lightest, lighter, light, dark, darker, and darkest. Surface always overrides the parent's color context. Your theme will influence these colors so check there first if you are seeing inconsistencies. See CSS Custom Properties for default values.

View source on GitHub

Status

When to use

  • When you want a styled background that fits well into RHDS' theming system.
  • When you want to provide theming tokens to elements without using a styled container.

Status checklist

Other libraries

To learn more about our other libraries, visit the getting started page.

© 2026 Red Hat Deploys by Netlify