Prefer Box and other Pluma components over generic native HTML elements.
Raw div and span markup is where application styling drifts away from the
design system: the element carries no tokens, so spacing, color, and typography
end up as one-off CSS. Box is the Pluma primitive for that job — it renders any
element you ask for and exposes the token vocabulary through its props.
This rule covers the generic elements that
enforce-pluma-elements
deliberately leaves alone because they have no single prescribed replacement.
The suggested component is a starting point, not the only answer. A div that
exists purely to lay its children out should become Stack, InlineStack, or
Grid rather than a Box with flex props.
The rule reports the raw elements listed below wherever they appear in JSX or in
a Glimmer template. Elements with no Pluma counterpart, such as iframe, svg,
and video, are left alone.
It deliberately does not report polymorphic as / @as values, because for
most of these elements the polymorphic form is the recommendation — reporting
Box as="section" would contradict the rule's own advice. The trade-off is that
Box as="pre" and Text as="small" also go unreported, even though those
elements have a component of their own in the table below.
| HTML element | React | Ember |
|---|---|---|
address | Box as="address" | PlumaBox @as="address" |
article | Box as="article" | PlumaBox @as="article" |
aside | Box as="aside" | PlumaBox @as="aside" |
b | Text | PlumaText |
blockquote | Box as="blockquote" | PlumaBox @as="blockquote" |
div | Box | PlumaBox |
figcaption | Box as="figcaption" | PlumaBox @as="figcaption" |
figure | Box as="figure" | PlumaBox @as="figure" |
footer | Box as="footer" | PlumaBox @as="footer" |
header | Box as="header" | PlumaBox @as="header" |
i | Text | PlumaText |
main | Box as="main" | PlumaBox @as="main" |
nav | Box as="nav" | PlumaBox @as="nav" |
pre | CodeBlock | PlumaCodeBlock |
section | Box as="section" | PlumaBox @as="section" |
small | Text | PlumaText |
span | Text | PlumaText |
time | Box as="time" | PlumaBox @as="time" |