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
SurfaceColor PalettesNested Combination ElementsSurfaceColor PalettesNested Combination Elements

Surface

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

Color Palettes

import '@rhds/elements/rh-surface/rh-surface.js';
import '@rhds/elements/rh-cta/rh-cta.js';
<rh-surface id="surface" color-palette="darkest">
  <h2>Darkest</h2>
  <rh-cta><a href="#">Call to Action</a></rh-cta>
</rh-surface>

<rh-surface color-palette="darker">
  <h2>Darker</h2>
  <rh-cta><a href="#">Call to Action</a></rh-cta>
</rh-surface>

<rh-surface color-palette="dark">
  <h2>Dark</h2>
  <rh-cta><a href="#">Call to Action</a></rh-cta>
</rh-surface>

<rh-surface color-palette="light">
  <h2>Light</h2>
  <rh-cta><a href="#">Call to Action</a></rh-cta>
</rh-surface>

<rh-surface color-palette="lighter">
  <h2>Lighter</h2>
  <rh-cta><a href="#">Call to Action</a></rh-cta>
</rh-surface>

<rh-surface color-palette="lightest">
  <h2>Lightest</h2>
  <rh-cta><a href="#">Call to Action</a></rh-cta>
</rh-surface>

Nested Combination Elements

import '@rhds/elements/rh-surface/rh-surface.js';
import '@rhds/elements/rh-card/rh-card.js';
import '@rhds/elements/rh-cta/rh-cta.js';
a {
  color: var(--rh-color-interactive-primary-default);
  &:hover { color: var(--rh-color-interactive-primary-hover); }
  &:active { color: var(--rh-color-interactive-primary-active); }

  &:focus-within {
    color: var(--rh-color-interactive-primary-focus);
    &:hover { color: var(--rh-color-interactive-primary-focus); }
  }

  &:visited { /* stylelint-disable-line no-descending-specificity */
    color: var(--rh-color-interactive-primary-visited-default);
    &:hover { color: var(--rh-color-interactive-primary-visited-hover); }
  }
}
<rh-surface color-palette="darkest">
  <rh-card>
    <p>The card has no color-palette. It's nested CTA should therefore inherit
       context from the grandparent, rh-surface.</p>
    <rh-surface color-palette="light">
      <p>The nested surface should have lighter color <a href="#">even for links</a></p>
      <rh-card color-palette="dark">
        <p>and the nested card should likewise set it's own <a href="#">scheme</a></p>
      </rh-card>
      <rh-cta href="#">light</rh-cta>
    </rh-surface>
    <rh-cta href="#">Should be on dark</rh-cta>
  </rh-card>
</rh-surface>

Other libraries

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

© 2025 Red Hat Deploys by Netlify