Skip to main content
Login

Sign in to access your account

Content Placeholder - National Design System

A dashed box that marks where a real component goes, for templates, prototypes and demos

Overview

Content Placeholder is one class, nds-content-placeholder, on an element that holds your own text. Each child element is one centered line.

Pick another component when:

  • the region is empty at runtime, such as a list with no results: Empty
  • the content is still loading: Loading

Markup

Preview
Swap with content component استبدل هذا العنصر بأي عنصر آخر
<div class="nds-content-placeholder"> <span>Swap with content component</span> <span>استبدل هذا العنصر بأي عنصر آخر</span> </div>

Built-in Features

  • CSS Only

    One class and no JavaScript. Remove the class and the element is a plain element again.

  • Fills Its Region

    It fills a parent that has a height, such as a panel body. In a parent that takes its height from its content, it is at least 120px tall.

  • Theme Colors

    The border, fill and text use the brand primary tokens, so the box changes with a custom theme.

  • Your Own Label

    The text is in your markup, so you can write it in any language.

Best Practices

  • Use it in a page template to mark a region that a real component replaces later. Reviewers can then check the layout before the content exists.
  • Put it inside a surface that is still in design, such as a Panel body, a Modal or a Card. Reviewers then see the surface at its real size.
  • Name the component that goes there, not “content here”. The person who fills in the template then knows what to add.
  • Remove every placeholder before the page goes live.
  • Keep the text to one or two lines. The layout sets the size of the box, not the text.
  • For a bilingual team, add a second line in the other language.

API

CSS Custom Properties

Set them in the style attribute of the placeholder. On a parent, they change only the default-size placeholders inside it: nds-sm and nds-lg set their own values on the placeholder.

Property Default Controls
--placeholder-FS var(--typo-text-xs-FS) The font size of the text
--placeholder-LH var(--typo-text-xs-LH) The line height of the text. Set it with --placeholder-FS
Last Modified Date: 10/10/2026 - 05:28 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks