Widgets
Summary
The translucent card: Soma's basic content surface.
In Soma's shell the page itself is a transparent tint (navbar and
sidebar included); widgets are the only surfaces,
which is what gives the dashboard its airy look. A widget is a
header (title, optional subtitle) plus a body; compose freely
(toolbars in the header,
tables, charts and forms in the body)
and place widgets with soma-col-* inside the
12-column grid. Every example on
this page is itself a widget.
When to use
| Form | Use it for |
|---|---|
.soma-widget | Any block of page content: dashboard tiles, detail panels, chart cards. The workhorse surface. |
| Header-less (body only) | Self-titled content like stat tiles: the stat's own label does the naming. |
.soma-widget-solid | Content that must not let the page tint show through — dense imagery, embeds, editors. |
| Not a widget | Inline notices (message/banner) and the single centred task card (soma-page-focused, see Page layout). |
Examples
The three stat tiles above are header-less widgets placed with
soma-col-4; the chart and solid cards split
8 / 4. Spans are the consumer's layout call.
HTML
<section class="soma-widget">
<header class="soma-widget-header">
<h3 class="soma-widget-title">Visits today</h3>
<p class="soma-widget-subtitle">Compared to last week</p>
</header>
<div class="soma-widget-body">…</div>
</section>
<!-- placed in the grid -->
<div class="soma-grid">
<section class="soma-widget soma-col-8">…</section>
<section class="soma-widget soma-col-4">…</section>
</div>
Pick the title's heading level to fit the page outline;
h3 under a page title is the usual shape.
CSS classes
| Class | Effect |
|---|---|
.soma-widget | The card: translucent surface, soft shadow, rounded corners. Flex column, so bodies stretch in equal-height grid rows. |
.soma-widget-header | Padded header strip; omit it for self-titled content. |
.soma-widget-title | The heading (h3 typically): large, semibold, no margin. |
.soma-widget-subtitle | Muted subtitle — a block <p> under the title, or a <span> inline inside it. |
.soma-widget-body | The content area; extra bottom padding keeps Soma's airy proportions. |
.soma-widget-solid | Opaque variant, for content that must not let the page tint through. |
.soma-col-1 … .soma-col-12 | Grid placement inside .soma-grid (see Page layout). |
JavaScript
None. Widgets are pure CSS; behaviour belongs to the components composed inside them.