Skip to main content Home
About About the Design SystemRoadmap
Get started OverviewDesignersDevelopers
Foundations OverviewColorGridIconographyInteractionsSpacingTypography
Tokens Overview Global colorbox shadowTypographyborderopacityspacelengthIconBreakpointsMedia Queries
Elements 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 Navigation (primary) Navigation (secondary) Pagination PopoverPlanned Progress stepsPlanned Site status Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Theming OverviewColor PalettesCustomizingDevelopers
Patterns All PatternsCardTabsFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTile
Personalization All Personalization PatternsAnnouncement
Accessibility FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers
Design/code status Release notes Get support

Surface

OverviewStyleGuidelinesCodeDemos
OverviewStatusWhen to useStatus checklistOverviewStatusWhen to useStatus checklist

Overview

Surfaces are content containers with a color palette which provide a theme (i.e. a background color as well as accessible font colors) to their child elements. Use surface only when other containers like card or accordion are inappropriate.

#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>

Sets color palette, which affects the element's styles as well as descendants' color theme. The default surface color palette is 'lightest', 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

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.

© 2025 Red Hat Deploys by Netlify