Markup
Preview
Swap with content component
استبدل هذا العنصر بأي عنصر آخر
Variants
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Size | MD (default) | — | — | Most regions: a panel body, a card, a page section |
| Size | SM | .nds-sm |
.nds-content-placeholder |
Tight regions, such as a Toolbar slot. The text drops to the 2xs size and the box is at least 40px tall, the height of a default button |
| Size | LG | .nds-lg |
.nds-content-placeholder |
Large regions, where the default text looks too small. The text grows to the sm size |
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 |