Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Generic block-level container. In Vanilla Breeze, div usage is discouraged — prefer semantic elements and VB layout primitives.
Vanilla Breeze takes an intentional stance: <div> is a last resort, not a default. The VB conformance checker flags every <div> as a warning, and the semantic check raises it as an error for new code.
This is not about being pedantic — semantic elements provide:
<nav>, <main>, <aside>)For every common <div> pattern, a semantic element exists:
| Instead of | Use |
|---|---|
<div class="card"> | <article> |
<div class="sidebar"> | <aside> |
<div class="nav"> | <nav> |
<div class="header"> | <header> |
<div class="footer"> | <footer> |
<div class="main"> | <main> |
<div class="section"> | <section> |
<div class="actions"> | <footer> or <menu> |
<div class="group"> | <fieldset> |
<div data-layout="stack"> | Put data-layout on the semantic parent |
<!-- Instead of <div class="card"> --><article> <h3>Card Title</h3> <p>Self-contained content.</p></article> <!-- Instead of <div class="sidebar"> --><aside> <p>Tangentially related content.</p></aside> <!-- Instead of <div class="nav"> --><nav aria-label="Primary"> <ul class="unstyled"> <li><a href="#">Home</a></li> </ul></nav> <!-- Instead of <div class="footer"> / <div class="actions"> --><footer> <button type="button">Save</button></footer>
VB's layout attributes (data-layout) and custom elements (<layout-stack>, <layout-grid>, etc.) can be applied directly to semantic elements:
<!-- Instead of <div data-layout="stack"> --><section data-layout="stack" data-layout-gap="m"> <p>Content with vertical spacing.</p> <p>No wrapper div needed.</p></section> <!-- Instead of <div data-layout="grid"> --><ul data-layout="grid" data-layout-gap="m"> <li>Grid item one</li> <li>Grid item two</li></ul>
When no semantic element fits, VB layout custom elements (<layout-stack>, <layout-grid>, <layout-cluster>) serve as the container — they are more descriptive than <div> because they declare layout intent.
There are a few cases where <div> is the correct choice:
<dl> grouping: HTML5 allows <div> inside <dl> to group <dt>/<dd> pairs (for striped styling)<form-field><!-- dl grouping (HTML5 spec allows div inside dl) --><dl data-striped> <div> <dt>Term</dt> <dd>Description</dd> </div></dl> <!-- Radio/checkbox group wrapper for form-field --><form-field> <fieldset> <legend>Options</legend> <div> <label><input type="radio" name="opt" /> Option A</label> <label><input type="radio" name="opt" /> Option B</label> </div> </fieldset></form-field>
VB enforces semantic HTML through automated tooling:
# VB conformance checker flags divs: vb/no-div — Any <div> element (warning → error)vb/no-div-wrapper — <div> wrapping a single semantic childsemantic/no-div — Semantic check for div elements
vb/no-div — Flags any <div> element. Suggests semantic alternatives.vb/no-div-wrapper — Flags <div> wrapping a single semantic child (the div is unnecessary)..claude/vb-conformance-allowlist.jsonRun npm run conformance to check your HTML files.
When auditing existing code with divs, follow this order:
data-layout on a div when it could be on the semantic parent?form.stacked)?<footer> replace a button group div? Can <header> replace a title wrapper?<div> has no implicit ARIA role — it is invisible to screen readers<span> — Generic inline container (same philosophy: last resort)<section> — Thematic grouping of content<article> — Self-contained content<aside> — Tangentially related content<nav> — Navigation sections<header> — Introductory content<footer> — Footer content and action groups<main> — Dominant content of the page<menu> — Action button groups<fieldset> — Form field grouping