Skip to content

UI Standards

Digital Delve UI follows a set of design standards to ensure consistency and accessibility across all projects.

Naming

Components use PascalCase class names. Child elements are separated with a hyphen. Variants and modifiers are lowercase words added alongside the component class.

html
<!-- Component -->
<div class="Card">…</div>

<!-- Component + child element -->
<div class="Card">
  <header class="Card-Header">…</header>
  <div class="Card-Content">…</div>
  <footer class="Card-Footer">…</footer>
</div>

<!-- Component + variant -->
<div class="Card profile">…</div>

Multi-word component names are written in PascalCase with no separator.

html
<div class="ToastRegion">…</div>
<div class="FileInput">…</div>

Variants

Variants are plain lowercase classes added alongside the component class. They describe the visual flavor or size — not transient state.

html
<button class="Button primary">…</button>
<button class="Button compact danger">…</button>
<span class="Tag success dot">…</span>
<nav class="Pagination compact">…</nav>

State

State is expressed with HTML data attributes, not classes. Use bare boolean attributes (no value needed in HTML; set "" in JS).

html
<input class="Input" data-invalid>
<button class="Button primary" data-active aria-pressed="true">Save</button>
<div class="Sidebar" data-open>…</div>
css
.Input[data-invalid]         { border-color: var(--danger); }
.Button.primary[data-active] { background: var(--primary); }
.Sidebar[data-open]          { transform: translateX(0); }

Common State Attributes

AttributeUsage
data-activeSelected or toggled on
data-disabledVisually disabled (non-native element)
data-invalidFailed validation
data-validPassed validation
data-openExpanded or visible (drawer, fallback modal)
data-loadingIn-progress, spinner overlay
data-enteringAnimating in
data-leavingAnimating out
data-dismissingBeing removed
data-dragoverDrag target is active
data-clickableRow or item is interactive

Accessibility

Always pair data-attribute state with the appropriate ARIA attribute where one exists.

  • data-active on a toggle button → also set aria-pressed="true"
  • data-disabled on a non-native element → also set aria-disabled="true"
  • data-open on a drawer → also update aria-expanded on the trigger
  • Use semantic HTML elements (<dialog>, <details>, <button>) before reaching for ARIA
html
<button class="Button info" data-active aria-pressed="true">Filter</button>
<a class="Pagination-Link" data-disabled aria-disabled="true">‹</a>

Variables

All colors, typography, and spacing values are CSS custom properties. Always use variables — never hardcode values.

css
/* Good */
color: var(--text-muted);
border-color: var(--danger);
font-family: var(--font);

/* Avoid */
color: #888;
border-color: red;

See the Variables reference for the full token list.