Redmaterials by Redooor
A Bootstrap 5.3 theme inspired by Google Material Design. Version 0.2.0.
Redmaterials restyles Bootstrap's components with a Material look and adds a few of its own: a navigation sidebar, corner ribbons, the ripple effect, shadow depths and wells. This site shows the components Redmaterials restyles and the ones it adds, each with a live example and the markup to copy. For Bootstrap's own defaults, see the official Bootstrap documentation.
Redmaterials is a consolidation of many works by various people; see the acknowledgements. Source code and issues are on GitHub.
Install
Copy dist/css and dist/js to your project and use redmaterials.min.css and redmaterials.min.js. Redmaterials requires Bootstrap 5.3.x and must be loaded after Bootstrap. Use Bootstrap's bundle JavaScript, which includes Popper. Neither Bootstrap 5 nor Redmaterials needs jQuery.
In your <head>:
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="dist/css/redmaterials.min.css">
Before the closing </body>:
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script>
<script src="dist/js/redmaterials.min.js"></script>
Roboto is not bundled with Redmaterials, so add the font link above (or load it with Web Font Loader). Material Icons is optional; it is used for the icons on this site.
Customising
The theme colours and sizes are Sass variables. Load the variables module with your values first, then Redmaterials, and compile with Sass (sass --load-path=path/to/redmaterials/scss theme.scss theme.css):
@use "variables" with ($brand-primary: #e91e63, $brand-secondary: #455a64);
@use "redmaterials";
Compatibility and upgrading
| Redmaterials | Bootstrap |
|---|---|
| 0.2.x | 5.3.x |
| 0.1.x | 4 |
| 0.0.x | 3 |
Upgrading from an earlier version? Read UPGRADE.md for the steps and BREAKING.md for the removed classes. Changes in each release are listed in the change log.
Note to users
Components that Redmaterials inherits from Bootstrap are kept as close to Bootstrap as possible. The elements Redmaterials adds on top of Bootstrap (nav sidebar, corner ribbons, ripple effect, shadows, wells) are its own and may change in a future release. Contributions are welcome.
Colours
Redmaterials adds the 19 Google Material Design palette colours as background utilities, alongside Bootstrap's contextual colours and a small set of light/dark design tokens. No data attribute or JavaScript is required: the utility class alone enables a swatch.
Compared with stock Bootstrap. Stock Bootstrap has no .bg-red … .bg-blue-grey palette utilities, so those fills are absent; its contextual .bg-primary family uses Bootstrap's own colours, while Redmaterials adds the palette and maps .bg-primary to the Material brand.
Palette swatches
Every Material palette colour is available as .bg-{colour}; the utility name is printed below each swatch.
.bg-red.bg-pink.bg-purple.bg-deep-purple.bg-indigo.bg-blue.bg-light-blue.bg-cyan.bg-teal.bg-green.bg-light-green.bg-lime.bg-yellow.bg-amber.bg-orange.bg-deep-orange.bg-brown.bg-grey.bg-blue-grey<div class="row row-cols-2 row-cols-sm-3 row-cols-lg-4 row-cols-xl-5 g-3">
<div class="col">
<div class="card h-100">
<div class="bg-red" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-red</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-pink" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-pink</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-purple" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-purple</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-deep-purple" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-deep-purple</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-indigo" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-indigo</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-blue" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-blue</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-light-blue" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-light-blue</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-cyan" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-cyan</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-teal" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-teal</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-green" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-green</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-light-green" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-light-green</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-lime" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-lime</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-yellow" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-yellow</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-amber" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-amber</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-orange" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-orange</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-deep-orange" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-deep-orange</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-brown" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-brown</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-grey" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-grey</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-blue-grey" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-blue-grey</code></div>
</div>
</div>
</div>
Shade scale
The palette ships the Material shade scale—50 through 900, plus the A100, A200, A400 and A700 accents where Material defines them—as Sass variables. Each cell shows the shade in its own colour, with its hex value from scss/colors.scss. The colours are split into five tables to fit the page; brown, grey and blue-grey have no accent shades.
| Shade | red |
pink |
purple |
deep-purple |
|---|---|---|---|---|
| 50 | #FFEBEE | #FCE4EC | #F3E5F5 | #EDE7F6 |
| 100 | #FFCDD2 | #F8BBD0 | #E1BEE7 | #D1C4E9 |
| 200 | #EF9A9A | #F48FB1 | #CE93D8 | #B39DDB |
| 300 | #E57373 | #F06292 | #BA68C8 | #9575CD |
| 400 | #EF5350 | #EC407A | #AB47BC | #7E57C2 |
| 500 | #F44336 | #E91E63 | #9C27B0 | #673AB7 |
| 600 | #E53935 | #D81B60 | #8E24AA | #5E35B1 |
| 700 | #D32F2F | #C2185B | #7B1FA2 | #512DA8 |
| 800 | #C62828 | #AD1457 | #6A1B9A | #4527A0 |
| 900 | #B71C1C | #880E4F | #4A148C | #311B92 |
| A100 | #FF8A80 | #FF80AB | #EA80FC | #B388FF |
| A200 | #FF5252 | #FF4081 | #E040FB | #7C4DFF |
| A400 | #FF1744 | #F50057 | #D500F9 | #651FFF |
| A700 | #D50000 | #C51162 | #AA00FF | #6200EA |
| Shade | indigo |
blue |
light-blue |
cyan |
|---|---|---|---|---|
| 50 | #E8EAF6 | #E3F2FD | #E1F5FE | #E0F7FA |
| 100 | #C5CAE9 | #BBDEFB | #B3E5FC | #B2EBF2 |
| 200 | #9FA8DA | #90CAF9 | #81D4FA | #80DEEA |
| 300 | #7986CB | #64B5F6 | #4FC3F7 | #4DD0E1 |
| 400 | #5C6BC0 | #42A5F5 | #29B6F6 | #26C6DA |
| 500 | #3F51B5 | #2196F3 | #03A9F4 | #00BCD4 |
| 600 | #3949AB | #1E88E5 | #039BE5 | #00ACC1 |
| 700 | #303F9F | #1976D2 | #0288D1 | #0097A7 |
| 800 | #283593 | #1565C0 | #0277BD | #00838F |
| 900 | #1A237E | #0D47A1 | #01579B | #006064 |
| A100 | #8C9EFF | #82B1FF | #80D8FF | #84FFFF |
| A200 | #536DFE | #448AFF | #40C4FF | #18FFFF |
| A400 | #3D5AFE | #2979FF | #00B0FF | #00E5FF |
| A700 | #304FFE | #2962FF | #0091EA | #00B8D4 |
| Shade | teal |
green |
light-green |
lime |
|---|---|---|---|---|
| 50 | #E0F2F1 | #E8F5E9 | #F1F8E9 | #F9FBE7 |
| 100 | #B2DFDB | #C8E6C9 | #DCEDC8 | #F0F4C3 |
| 200 | #80CBC4 | #A5D6A7 | #C5E1A5 | #E6EE9C |
| 300 | #4DB6AC | #81C784 | #AED581 | #DCE775 |
| 400 | #26A69A | #66BB6A | #9CCC65 | #D4E157 |
| 500 | #009688 | #4CAF50 | #8BC34A | #CDDC39 |
| 600 | #00897B | #43A047 | #7CB342 | #C0CA33 |
| 700 | #00796B | #388E3C | #689F38 | #AFB42B |
| 800 | #00695C | #2E7D32 | #558B2F | #9E9D24 |
| 900 | #004D40 | #1B5E20 | #33691E | #827717 |
| A100 | #A7FFEB | #B9F6CA | #CCFF90 | #F4FF81 |
| A200 | #64FFDA | #69F0AE | #B2FF59 | #EEFF41 |
| A400 | #1DE9B6 | #00E676 | #76FF03 | #C6FF00 |
| A700 | #00BFA5 | #00C853 | #64DD17 | #AEEA00 |
| Shade | yellow |
amber |
orange |
deep-orange |
|---|---|---|---|---|
| 50 | #FFFDE7 | #FFF8E1 | #FFF3E0 | #FBE9E7 |
| 100 | #FFF9C4 | #FFECB3 | #FFE0B2 | #FFCCBC |
| 200 | #FFF59D | #FFE082 | #FFCC80 | #FFAB91 |
| 300 | #FFF176 | #FFD54F | #FFB74D | #FF8A65 |
| 400 | #FFEE58 | #FFCA28 | #FFA726 | #FF7043 |
| 500 | #FFEB3B | #FFC107 | #FF9800 | #FF5722 |
| 600 | #FDD835 | #FFB300 | #FB8C00 | #F4511E |
| 700 | #FBC02D | #FFA000 | #F57C00 | #E64A19 |
| 800 | #F9A825 | #FF8F00 | #EF6C00 | #D84315 |
| 900 | #F57F17 | #FF6F00 | #E65100 | #BF360C |
| A100 | #FFFF8D | #FFE57F | #FFD180 | #FF9E80 |
| A200 | #FFFF00 | #FFD740 | #FFAB40 | #FF6E40 |
| A400 | #FFEA00 | #FFC400 | #FF9100 | #FF3D00 |
| A700 | #FFD600 | #FFAB00 | #FF6D00 | #DD2C00 |
| Shade | brown |
grey |
blue-grey |
|---|---|---|---|
| 50 | #EFEBE9 | #FAFAFA | #ECEFF1 |
| 100 | #D7CCC8 | #F5F5F5 | #CFD8DC |
| 200 | #BCAAA4 | #EEEEEE | #B0BEC5 |
| 300 | #A1887F | #E0E0E0 | #90A4AE |
| 400 | #8D6E63 | #BDBDBD | #78909C |
| 500 | #795548 | #9E9E9E | #607D8B |
| 600 | #6D4C41 | #757575 | #546E7A |
| 700 | #5D4037 | #616161 | #455A64 |
| 800 | #4E342E | #424242 | #37474F |
| 900 | #3E2723 | #212121 | #263238 |
Brand variables
The brand colours are Sass variables declared with !default in scss/variables.scss; they feed both the contextual utilities and Bootstrap's --bs-* theme variables. Each default is the shade of its palette colour nearest 500 that reaches AA with its label: $brand-primary is blue 700, $brand-danger red 700 and $brand-success green 800 under white labels, while $brand-info (cyan) and $brand-warning (amber) stay at 500 under black labels. Text and link colours walk the same scale: darker on a light page, lighter on a dark one.
| Variable | Default | Value |
|---|---|---|
$brand-default | $default | #f8f8f8 |
$brand-primary | $blue-700 | #1976D2 |
$brand-secondary | $grey-600 | #757575 |
$brand-warning | $amber | #FFC107 |
$brand-danger | $red-700 | #D32F2F |
$brand-success | $green-800 | #2E7D32 |
$brand-info | $cyan | #00BCD4 |
$brand-light | #f8f9fa | #f8f9fa |
$brand-dark | #343a40 | #343a40 |
$brand-white | #fff | #fff |
$brand-muted | $grey-600 | #757575 |
Customising the brand
The supported customisation is Sass: load variables with your own values first, then load redmaterials, and compile with the Sass CLI.
@use "variables" with (
$brand-primary: #e91e63,
$brand-secondary: #455a64
);
@use "redmaterials";
Compile the file with Redmaterials' scss directory on the load path; changing a brand variable updates Bootstrap's --bs-* vars, the contextual utilities and the components that derive from them in one pass.
sass --load-path=path/to/redmaterials/scss theme.scss theme.css
Bootstrap CSS variables
Redmaterials maps the Material brand onto Bootstrap's own CSS custom properties so utilities such as .text-bg-*, .link-* and the focus rings follow the theme.
| Variable | What it controls | Scope |
|---|---|---|
--bs-primary, --bs-primary-rgb | Theme colour palette; the same pair exists for secondary, success, info, warning, danger, light and dark | :root |
--bs-{colour}-text-emphasis, -bg-subtle, -border-subtle | Tints derived from the eight theme colours for subtle utilities and components | Light scope only; dark keeps Bootstrap's values |
--bs-body-font-family | Roboto stack for Bootstrap components | :root |
--bs-border-radius, --bs-border-radius-sm, --bs-border-radius-lg | Material's 2px corner radius | :root |
--bs-focus-ring-color | Theme primary at 25% for focus rings | :root |
--bs-link-color, --bs-link-color-rgb, --bs-link-hover-color, --bs-link-hover-color-rgb | Brand link colours | Light and dark; dark uses a lifted link colour |
--bs-warning-border-subtle | Darkened amber so white text meets AA in dark mode | Dark only |
--bs-btn-* on .btn-outline-{colour}, --bs-btn-focus-shadow-rgb on .btn-{colour} | Per-button colours that Bootstrap otherwise hard-codes | Scoped to the button class |
Light and dark tokens
Neutral colours are --rdm-* custom properties with a light value and a [data-bs-theme="dark"] override; brand and palette fills are not tokens, so they keep the same value in both modes.
| Tokens | Used for | Changes with the mode |
|---|---|---|
--rdm-text, --rdm-text-strong, --rdm-text-muted, --rdm-text-secondary, --rdm-text-subtle, --rdm-text-disabled | Neutral text | Yes |
--rdm-text-{colour}-rgb, -hover-rgb, -anchor-rgb | Contextual .text-* and .link-* utilities | Yes, lifted for contrast |
--rdm-surface, --rdm-surface-translucent, --rdm-disabled-bg, --rdm-overlay, --rdm-card-cap-bg | Surfaces, disabled fills, overlays and card headers | Yes |
--rdm-default-*, --rdm-sidebar-default-*, --rdm-flat-*, --rdm-ink | Neutral buttons, sidebar default, flat-button washes and ripple ink | Yes |
--rdm-underline, --rdm-divider, --rdm-chevron, --rdm-popover-border, --rdm-blockquote-border, --rdm-control-border, --rdm-control-subtle, --rdm-focus-gap, --rdm-select-arrow, --rdm-select-arrow-focus | Dividers, borders, control chrome and select arrows | Yes |
--rdm-hover-bg, --rdm-table-striped-bg, --rdm-table-hover-bg, --rdm-table-active-bg, --rdm-table-border, --rdm-table-text, --rdm-table-header-color | Interaction surfaces and table colours | Yes |
--rdm-tooltip-bg, --rdm-tooltip-color | Tooltips | Yes; dark tooltips stay light |
--rdm-shadow-depth-1 … -5, --rdm-shadow-navbar, --rdm-shadow-dropdown, --rdm-shadow-ribbon | Material shadow depths | Yes, deepened for dark surfaces |
--rdm-ctx-{name} and --rdm-pal-{colour} with -hover, -active, -focus | Flat and outline button text, .text-* and palette interaction states | Yes; palette fills themselves do not |
Dark mode
Neutral tokens follow the data-bs-theme attribute: surfaces, text, dividers, control chrome, interaction washes and shadows switch to their dark values. Brand and palette fills such as .bg-red or .bg-primary are identity colours and stay the same in both modes. When a brand colour is used as text—.text-primary, .link-primary or a flat button—the --rdm-text-* and --rdm-pal-* tokens lift it towards white until it reaches 4.5:1 on the dark surface, with hover states that stay lighter than the base. The derived --bs-*-bg-subtle and --bs-*-border-subtle values are light-only, so Bootstrap's own dark values remain in force.
Utilities
Redmaterials extends Bootstrap's colour utilities with the 19-colour Material palette and a neutral default and muted variant for backgrounds, text and borders. No data attribute or JavaScript is required: the utility classes work on their own.
Compared with stock Bootstrap. Stock Bootstrap has no .bg-red palette family, .bg-default, .bg-muted, .border-default, .border-muted or .text-default, and does not restyle .text-muted; its contextual .text-* and .border-* utilities use Bootstrap's own colours, while Redmaterials adds the extra utilities and the Material palette.
Background colours
Use .bg-{colour} for any of the 19 palette colours, plus .bg-default and .bg-muted for neutral fills.
.bg-default.bg-red.bg-pink.bg-purple.bg-deep-purple.bg-indigo.bg-blue.bg-light-blue.bg-cyan.bg-teal.bg-green.bg-light-green.bg-lime.bg-yellow.bg-amber.bg-orange.bg-deep-orange.bg-brown.bg-grey.bg-blue-grey.bg-muted<div class="row row-cols-2 row-cols-sm-3 row-cols-lg-4 row-cols-xl-5 g-3">
<div class="col">
<div class="card h-100">
<div class="bg-default" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-default</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-red" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-red</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-pink" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-pink</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-purple" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-purple</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-deep-purple" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-deep-purple</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-indigo" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-indigo</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-blue" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-blue</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-light-blue" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-light-blue</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-cyan" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-cyan</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-teal" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-teal</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-green" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-green</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-light-green" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-light-green</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-lime" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-lime</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-yellow" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-yellow</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-amber" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-amber</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-orange" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-orange</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-deep-orange" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-deep-orange</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-brown" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-brown</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-grey" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-grey</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-blue-grey" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-blue-grey</code></div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="bg-muted" style="height: 3rem;"></div>
<div class="card-body p-2"><code class="small">.bg-muted</code></div>
</div>
</div>
</div>
.bg-default is the palette neutral (#f8f8f8); .bg-muted is the contextual muted colour (#757575). They are fills, so they keep the same value in light and dark mode.
Contextual backgrounds
Bootstrap's contextual background utilities are restyled with the Material palette. Pair each fill with a text utility that stays legible on it, and add .border to .bg-white so the box keeps an edge on a light surface.
.bg-primary with .text-white.bg-secondary with .text-white.bg-dark with .text-white.bg-light with .text-dark.bg-white with .text-dark and .border<div class="row g-3">
<div class="col-md-4">
<div class="bg-primary text-white p-3 rounded"><code class="text-white">.bg-primary</code> with <code class="text-white">.text-white</code></div>
</div>
<div class="col-md-4">
<div class="bg-secondary text-white p-3 rounded"><code class="text-white">.bg-secondary</code> with <code class="text-white">.text-white</code></div>
</div>
<div class="col-md-4">
<div class="bg-dark text-white p-3 rounded"><code class="text-white">.bg-dark</code> with <code class="text-white">.text-white</code></div>
</div>
<div class="col-md-4">
<div class="bg-light text-dark p-3 rounded"><code class="text-dark">.bg-light</code> with <code class="text-dark">.text-dark</code></div>
</div>
<div class="col-md-4">
<div class="bg-white text-dark border p-3 rounded"><code class="text-dark">.bg-white</code> with <code class="text-dark">.text-dark</code> and <code class="text-dark">.border</code></div>
</div>
</div>
Contextual text colours
The contextual text utilities are shown on .bg-body, the page surface, so you can compare them against the background they actually sit on.
.text-primary — primary text
.text-secondary — secondary text
.text-success — success text
.text-info — info text
.text-warning — warning text
.text-danger — danger text
.text-muted — muted text
<div class="bg-body rounded p-3">
<p class="text-primary mb-2"><code>.text-primary</code> — primary text</p>
<p class="text-secondary mb-2"><code>.text-secondary</code> — secondary text</p>
<p class="text-success mb-2"><code>.text-success</code> — success text</p>
<p class="text-info mb-2"><code>.text-info</code> — info text</p>
<p class="text-warning mb-2"><code>.text-warning</code> — warning text</p>
<p class="text-danger mb-2"><code>.text-danger</code> — danger text</p>
<p class="text-muted mb-0"><code>.text-muted</code> — muted text</p>
</div>
.text-primary … .text-danger follow the --rdm-text-* tokens and are lifted in dark mode; .text-muted is restyled to the Material grey (#9E9E9E).
Fixed text colours
.text-default, .text-light and .text-white are light values and .text-dark is dark, so each is shown on .bg-body inside the colour mode where it stays readable.
.text-default — default text
.text-light — light text
.text-white — white text
.text-dark — dark text
<div class="bg-body rounded p-3" data-bs-theme="dark">
<p class="text-default mb-2"><code>.text-default</code> — default text</p>
<p class="text-light mb-2"><code>.text-light</code> — light text</p>
<p class="text-white mb-0"><code>.text-white</code> — white text</p>
</div>
<div class="bg-body rounded p-3 mt-3" data-bs-theme="light">
<p class="text-dark mb-0"><code>.text-dark</code> — dark text</p>
</div>
These are fixed utility values, not tokens: they do not change with the page's colour mode and they do not honour --bs-text-opacity.
Text opacity
The token-driven .text-primary … .text-danger utilities use rgba(var(--rdm-text-<name>-rgb), var(--bs-text-opacity, 1)), so Bootstrap's .text-opacity-* utilities work on them.
Primary text at .text-opacity-100
Primary text at .text-opacity-75
Primary text at .text-opacity-50
Primary text at .text-opacity-25
<div class="bg-body rounded p-3">
<p class="text-primary text-opacity-100 mb-2">Primary text at <code>.text-opacity-100</code></p>
<p class="text-primary text-opacity-75 mb-2">Primary text at <code>.text-opacity-75</code></p>
<p class="text-primary text-opacity-50 mb-2">Primary text at <code>.text-opacity-50</code></p>
<p class="text-primary text-opacity-25 mb-0">Primary text at <code>.text-opacity-25</code></p>
</div>
.text-default, .text-muted, .text-light, .text-dark and .text-white set a fixed colour and ignore the opacity utilities.
Border colours
The contextual set also works on borders, and Redmaterials adds .border-default and .border-muted. Each set is shown on a scoped surface where the near-white and near-black borders stay visible.
Light-scoped surface
.border-default.border-muted.border-primary.border-secondary.border-success.border-info.border-warning.border-danger.border-light.border-dark.border-whiteDark-scoped surface
.border-default.border-muted.border-primary.border-secondary.border-success.border-info.border-warning.border-danger.border-light.border-dark.border-white<div class="bg-body-secondary rounded p-3" data-bs-theme="light">
<p class="small fw-semibold mb-2">Light-scoped surface</p>
<div class="row row-cols-2 row-cols-sm-3 row-cols-lg-4 g-2">
<div class="col"><div class="border border-2 border-default rounded p-2"><code class="text-reset">.border-default</code></div></div>
<div class="col"><div class="border border-2 border-muted rounded p-2"><code class="text-reset">.border-muted</code></div></div>
<div class="col"><div class="border border-2 border-primary rounded p-2"><code class="text-reset">.border-primary</code></div></div>
<div class="col"><div class="border border-2 border-secondary rounded p-2"><code class="text-reset">.border-secondary</code></div></div>
<div class="col"><div class="border border-2 border-success rounded p-2"><code class="text-reset">.border-success</code></div></div>
<div class="col"><div class="border border-2 border-info rounded p-2"><code class="text-reset">.border-info</code></div></div>
<div class="col"><div class="border border-2 border-warning rounded p-2"><code class="text-reset">.border-warning</code></div></div>
<div class="col"><div class="border border-2 border-danger rounded p-2"><code class="text-reset">.border-danger</code></div></div>
<div class="col"><div class="border border-2 border-light rounded p-2"><code class="text-reset">.border-light</code></div></div>
<div class="col"><div class="border border-2 border-dark rounded p-2"><code class="text-reset">.border-dark</code></div></div>
<div class="col"><div class="border border-2 border-white rounded p-2"><code class="text-reset">.border-white</code></div></div>
</div>
</div>
<div class="bg-body rounded p-3 mt-3" data-bs-theme="dark">
<p class="small fw-semibold mb-2">Dark-scoped surface</p>
<div class="row row-cols-2 row-cols-sm-3 row-cols-lg-4 g-2">
<div class="col"><div class="border border-2 border-default rounded p-2"><code class="text-reset">.border-default</code></div></div>
<div class="col"><div class="border border-2 border-muted rounded p-2"><code class="text-reset">.border-muted</code></div></div>
<div class="col"><div class="border border-2 border-primary rounded p-2"><code class="text-reset">.border-primary</code></div></div>
<div class="col"><div class="border border-2 border-secondary rounded p-2"><code class="text-reset">.border-secondary</code></div></div>
<div class="col"><div class="border border-2 border-success rounded p-2"><code class="text-reset">.border-success</code></div></div>
<div class="col"><div class="border border-2 border-info rounded p-2"><code class="text-reset">.border-info</code></div></div>
<div class="col"><div class="border border-2 border-warning rounded p-2"><code class="text-reset">.border-warning</code></div></div>
<div class="col"><div class="border border-2 border-danger rounded p-2"><code class="text-reset">.border-danger</code></div></div>
<div class="col"><div class="border border-2 border-light rounded p-2"><code class="text-reset">.border-light</code></div></div>
<div class="col"><div class="border border-2 border-dark rounded p-2"><code class="text-reset">.border-dark</code></div></div>
<div class="col"><div class="border border-2 border-white rounded p-2"><code class="text-reset">.border-white</code></div></div>
</div>
</div>
Typography
Redmaterials sets Roboto as the document and component font, keeps Bootstrap's heading scale, and leaves code and blockquote typography to Bootstrap with a small Material adjustment. No JavaScript is required for any of it.
Compared with stock Bootstrap. Bootstrap alone renders its system font stack at 16px; Redmaterials renders Roboto at 14px with a 1.4 line height, so the same text looks slightly smaller with Material's letterforms. The heading scale itself is Bootstrap's in both cases.
Roboto and body text
Load the Roboto stylesheet before Redmaterials' stylesheet; the font is not bundled with the theme.
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
scss/scaffolding.scss sets the body to "Roboto", 'Helvetica Neue', Helvetica, Arial, sans-serif at 400 weight, 14px, line height 1.4, colour var(--rdm-text), .1px letter spacing and antialiased smoothing. scss/_bootstrap5-theme.scss maps the same stack to --bs-body-font-family, so Bootstrap components inherit Roboto too. scss/type.scss contains only two rules: links use var(--bs-link-color) and .blockquote-footer uses var(--rdm-text-secondary).
Body copy
Body text renders at the 14px Roboto base; .lead, .small, mark, strong and em keep Bootstrap's styles.
A lead paragraph introduces a section with slightly larger, lighter text.
Regular body copy shows the 14px Roboto base and the 1.4 line height. It also shows bold text, italic text, highlighted text and a default link inside a paragraph.
Small text uses Bootstrap's .small size on top of the same Roboto stack.
<p class="lead">A lead paragraph introduces a section with slightly larger, lighter text.</p>
<p>Regular body copy shows the 14px Roboto base and the 1.4 line height. It also shows <strong>bold text</strong>, <em>italic text</em>, <mark>highlighted text</mark> and a <a href="#">default link</a> inside a paragraph.</p>
<p class="small mb-0">Small text uses Bootstrap's <code>.small</code> size on top of the same Roboto stack.</p>
Headings
Redmaterials does not redefine the heading scale, so Bootstrap 5.3's responsive h1–h6, heading classes and display headings render unchanged on top of Roboto.
h1. Redmaterials heading
h2. Redmaterials heading
h3. Redmaterials heading
h4. Redmaterials heading
h5. Redmaterials heading
h6. Redmaterials heading
.h3 paragraph heading
Display 4
<h1>h1. Redmaterials heading</h1>
<h2>h2. Redmaterials heading</h2>
<h3>h3. Redmaterials heading</h3>
<h4>h4. Redmaterials heading</h4>
<h5>h5. Redmaterials heading</h5>
<h6>h6. Redmaterials heading</h6>
<p class="h3">.h3 paragraph heading</p>
<p class="display-4 mb-0">Display 4</p>
Links
Links use the brand primary through var(--bs-link-color), and Bootstrap's contextual link utilities (.link-primary … .link-danger) are restyled through the --rdm-text-* tokens so they stay readable in dark mode.
Default link uses the theme's link colour and hover colour.
Body-emphasis link is the link style used in this documentation's prose.
Primary link, secondary link, success link, info link, warning link and danger link use the contextual link tokens.
<p><a href="#">Default link</a> uses the theme's link colour and hover colour.</p>
<p><a href="#" class="link-body-emphasis link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover">Body-emphasis link</a> is the link style used in this documentation's prose.</p>
<p class="mb-0"><a href="#" class="link-primary">Primary link</a>, <a href="#" class="link-secondary">secondary link</a>, <a href="#" class="link-success">success link</a>, <a href="#" class="link-info">info link</a>, <a href="#" class="link-warning">warning link</a> and <a href="#" class="link-danger">danger link</a> use the contextual link tokens.</p>
Code and keyboard
scss/code.scss removes the border from pre and gives it a 2px radius; inline code, kbd and samp keep Bootstrap's styling.
Use var(--rdm-text) for body text, press Ctrl + C to copy,
and read program output as docs built.
@use "redmaterials";
.card {
border-radius: 2px;
}
$ npm run build:docs:html docs built
<p>Use <code>var(--rdm-text)</code> for body text, press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy,
and read program output as <samp>docs built</samp>.</p>
<pre class="mb-3"><code>@use "redmaterials";
.card {
border-radius: 2px;
}</code></pre>
<pre class="mb-0"><samp>$ npm run build:docs:html
docs built</samp></pre>
Blockquotes
Bootstrap's .blockquote is unchanged; Redmaterials sets .blockquote-footer to var(--rdm-text-secondary) so the attribution stays readable in dark mode, and a .well blockquote uses var(--rdm-blockquote-border) for its border.
Material design is a visual language that synthesises the classic principles of good design with the innovation and possibility of technology and science.
<figure class="mb-0">
<blockquote class="blockquote">
<p>Material design is a visual language that synthesises the classic principles of good design with the innovation and possibility of technology and science.</p>
</blockquote>
<figcaption class="blockquote-footer">Material Design guidelines in <cite title="Material Design">Material Design</cite></figcaption>
</figure>
Ripples
The ripple is a Material ink animation that starts where the pointer clicks. Add .ripple-effect to a button, link or card and load dist/js/redmaterials.min.js; the script creates the .ink element at run time, so it never appears in your markup.
Compared with stock Bootstrap. Stock Bootstrap has no ripple of its own and no .ripple-effect styling, so a click leaves no visible ink; Redmaterials adds both the .ripple-effect styling and the script that creates the .ink element at run time.
Buttons
Add .ripple-effect to any .btn; the ink uses the button's own ink colour, so it stays visible on every contextual variant.
<button type="button" class="btn btn-primary btn-raised ripple-effect mb-2 me-2">Primary</button>
<button type="button" class="btn btn-secondary btn-raised ripple-effect mb-2 me-2">Secondary</button>
<button type="button" class="btn btn-success btn-raised ripple-effect mb-2 me-2">Success</button>
<button type="button" class="btn btn-danger btn-raised ripple-effect mb-2 me-2">Danger</button>
<button type="button" class="btn btn-primary btn-flat ripple-effect mb-2 me-2">Flat</button>
Links
The same class works on a link button and on an inline text link; use a real <a href> or <button> so the control is keyboard operable.
<a href="#rdm-ripples" class="btn btn-primary btn-raised ripple-effect mb-2 me-2">Link button</a>
<a href="#rdm-ripples" class="btn btn-outline-primary ripple-effect mb-2 me-2">Outline link</a>
<a href="#rdm-ripples" class="link-primary link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover ripple-effect">Inline ripple link</a>
Cards
Apply .ripple-effect to a card or any other positioned container to ripple across its whole area.
<a href="#rdm-ripples" class="card ripple-effect text-decoration-none text-body mb-3" style="max-width: 22rem;">
<div class="card-body">
<h5 class="card-title">Ripple card</h5>
<p class="card-text mb-0">Click anywhere on the card and the ink starts from that point.</p>
</div>
</a>
How the script works
On every click a delegated listener finds the closest .ripple-effect, creates a <span class="ink"> if there is not one already, sizes it to the larger side of the element, places it at the pointer, forces a reflow and adds the animate class; removing and re-adding that class restarts the CSS keyframes on a rapid second click. The script has no dependencies and does not use jQuery.
Keyboard activation. There is no separate key handler: pressing Enter on a link or button (or Space on a button) dispatches a click with detail === 0 and no pointer coordinates, and the listener places the ink in the centre of the element for that case. A non-interactive element would need its own keyboard handling, so use a native <button> or <a href>.
Both behaviours auto-initialise: the file attaches its two document-level click listeners as soon as it runs, with no init() call to write. One listener handles .ripple-effect and the other handles [data-toggle=nav-sidebar-toggle] (with a data-bs-target fallback), so the ripple and the nav sidebar work as soon as the script is loaded.
Adding the script
Load Redmaterials' JavaScript after Bootstrap's bundle, before the closing </body>:
<script src="dist/js/redmaterials.min.js"></script>
No ink element is written by hand; a ripple control only needs the class:
<button type="button" class="btn btn-primary btn-raised ripple-effect">Click me</button>
<a href="#" class="btn btn-flat btn-primary ripple-effect">Or a link</a>
<div class="card ripple-effect">…</div>
Forms
Redmaterials restyles Bootstrap's form controls instead of adding new classes: text inputs and textareas lose their box and get a 1px underline that thickens and turns primary on focus; selects keep an arrow; checks, radios, switches, the range and input-group addons all follow the Material treatment. No data attribute or JavaScript is needed, and validation uses Bootstrap's .is-valid and .is-invalid classes.
Compared with stock Bootstrap. Stock Bootstrap gives every control its default styling: boxed inputs with rounded borders, the default blue focus ring and Bootstrap's own check, switch and range colours; Redmaterials removes the box for a 1px underline that thickens and turns primary on focus, keeps the select arrow, and restyles checks, radios, switches, the range and input-group addons. The markup and the .form-label, .form-check, .form-switch, .form-range and validation classes are Bootstrap 5 throughout.
Text inputs
Use Bootstrap's .form-control with a .form-label; the theme removes the border and draws a single underline instead.
<div class="mb-3">
<label for="rdm-forms-name" class="form-label">Name</label>
<input type="text" class="form-control" id="rdm-forms-name" placeholder="Ada Lovelace">
</div>
<div class="mb-3">
<label for="rdm-forms-email" class="form-label">Email address</label>
<input type="email" class="form-control" id="rdm-forms-email" placeholder="ada@example.com">
</div>
<div>
<label for="rdm-forms-notes" class="form-label">Notes</label>
<textarea class="form-control" id="rdm-forms-notes" rows="2" placeholder="A short note"></textarea>
</div>
Selects
.form-select keeps Bootstrap's arrow but drops its box for the same underline; a plain <select> gets the theme's own arrow from the stylesheet.
<div class="mb-3">
<label for="rdm-forms-select" class="form-label">Form select</label>
<select class="form-select" id="rdm-forms-select">
<option selected>Choose a framework…</option>
<option value="bootstrap">Bootstrap 5.3</option>
<option value="redmaterials">Redmaterials</option>
</select>
</div>
<div>
<label for="rdm-forms-native-select" class="form-label">Native select</label>
<select id="rdm-forms-native-select" class="d-block w-100">
<option selected>Choose a colour…</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
</select>
</div>
Checks and radios
Keep Bootstrap's .form-check markup: the theme squares the checkbox, rounds the radio and paints both with the Material primary when checked.
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" id="rdm-forms-check">
<label class="form-check-label" for="rdm-forms-check">Checkbox</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" id="rdm-forms-check-checked" checked>
<label class="form-check-label" for="rdm-forms-check-checked">Checked checkbox</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="rdm-forms-radio" id="rdm-forms-radio-1" checked>
<label class="form-check-label" for="rdm-forms-radio-1">Radio one</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="rdm-forms-radio" id="rdm-forms-radio-2">
<label class="form-check-label" for="rdm-forms-radio-2">Radio two</label>
</div>
Switches
A .form-check.form-switch keeps the native checkbox but restyles it as a track and thumb; give the input role="switch" for assistive technology.
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="rdm-forms-switch">
<label class="form-check-label" for="rdm-forms-switch">Enable notifications</label>
</div>
<div class="form-check form-switch mt-2">
<input class="form-check-input" type="checkbox" role="switch" id="rdm-forms-switch-checked" checked>
<label class="form-check-label" for="rdm-forms-switch-checked">Switch on by default</label>
</div>
Range
.form-range uses the theme primary for the thumb and a translucent primary for the track; label it like any other control.
<label for="rdm-forms-range" class="form-label">Volume</label>
<input type="range" class="form-range" id="rdm-forms-range" min="0" max="10" value="5">
File input
Bootstrap's file input keeps its button, and the field underneath takes the theme's underline like a text input.
<label for="rdm-forms-file" class="form-label">Upload a file</label>
<input class="form-control" type="file" id="rdm-forms-file">
Input groups
Add text or a button with .input-group; the theme gives the addon the same underline as the field instead of a separate box.
<div class="mb-3">
<label for="rdm-forms-url" class="form-label">Website</label>
<div class="input-group">
<span class="input-group-text" id="rdm-forms-url-addon">https://</span>
<input type="text" class="form-control" id="rdm-forms-url" aria-describedby="rdm-forms-url-addon">
</div>
</div>
<div>
<label for="rdm-forms-search" class="form-label">Search</label>
<div class="input-group">
<input type="search" class="form-control" id="rdm-forms-search">
<button class="btn btn-outline-primary" type="button">Go</button>
</div>
</div>
Validation states
Bootstrap's .is-valid and .is-invalid classes keep their feedback icons and text while the theme colours the underline green or red.
<div class="row g-3">
<div class="col-md-6">
<label for="rdm-forms-valid" class="form-label">Valid input</label>
<input type="text" class="form-control is-valid" id="rdm-forms-valid" value="Redmaterials">
<div class="valid-feedback">Looks good.</div>
</div>
<div class="col-md-6">
<label for="rdm-forms-invalid" class="form-label">Invalid input</label>
<input type="text" class="form-control is-invalid" id="rdm-forms-invalid" value="Bootstrap" aria-invalid="true" aria-describedby="rdm-forms-invalid-feedback">
<div class="invalid-feedback" id="rdm-forms-invalid-feedback">Choose the themed value.</div>
</div>
</div>
The legacy form-control-focus mixin in scss/mixins/forms.scss is still defined but no current rule calls it; the live focus state is the 2px primary underline from scss/forms.scss.
Validated form
Add .was-validated to a form to show Bootstrap's :valid and :invalid feedback on every control at once, without JavaScript; pair each control with .valid-feedback or .invalid-feedback. The first field below is empty and required, so it shows the invalid state, while the filled second field is valid.
<form class="was-validated" novalidate>
<div class="mb-3">
<label for="rdm-forms-was-validated-name" class="form-label">Full name</label>
<input type="text" class="form-control" id="rdm-forms-was-validated-name" required>
<div class="invalid-feedback">Please enter your name.</div>
</div>
<div class="mb-0">
<label for="rdm-forms-was-validated-email" class="form-label">Email address</label>
<input type="email" class="form-control" id="rdm-forms-was-validated-email" value="ada@example.com" required>
<div class="valid-feedback">Looks good.</div>
</div>
</form>
Floating labels
Bootstrap's .form-floating wrapper still works: the label floats on focus and the field keeps the theme underline.
<div class="form-floating mb-3">
<input type="email" class="form-control" id="rdm-forms-floating-email" placeholder=" ">
<label for="rdm-forms-floating-email">Email address</label>
</div>
<div class="form-floating">
<select class="form-select" id="rdm-forms-floating-select">
<option selected>Choose a colour…</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
</select>
<label for="rdm-forms-floating-select">Favourite colour</label>
</div>
Alerts & badges
scss/alerts.scss restyles Bootstrap's alert with 2em padding, 2px corners and the Material palette for the primary, success, info, warning and danger variants; scss/badges.scss keeps Bootstrap's .badge and adds the neutral .badge-default. Both keep Bootstrap's markup and need no JavaScript, except the dismissible alert's data-bs-dismiss.
Compared with stock Bootstrap. Stock Bootstrap uses its own alert padding, corners and colours; Redmaterials uses 2em padding, 2px corners and the Material palette for the primary, success, info, warning and danger alerts, while .alert-secondary, .alert-light and .alert-dark already match stock. Stock Bootstrap also has no .badge-default; Redmaterials adds it for a grey fill. The dismiss behaviour and all text-bg-* and bg-* badge markup are Bootstrap 5.
Contextual alerts
Use one of Bootstrap's eight contextual classes; Redmaterials retints primary through danger and leaves secondary, light and dark to Bootstrap.
<div class="alert alert-primary" role="alert">A simple primary alert—check it out!</div>
<div class="alert alert-secondary" role="alert">A simple secondary alert—check it out!</div>
<div class="alert alert-success" role="alert">A simple success alert—check it out!</div>
<div class="alert alert-danger" role="alert">A simple danger alert—check it out!</div>
<div class="alert alert-warning" role="alert">A simple warning alert—check it out!</div>
<div class="alert alert-info" role="alert">A simple info alert—check it out!</div>
<div class="alert alert-light" role="alert">A simple light alert—check it out!</div>
<div class="alert alert-dark" role="alert">A simple dark alert—check it out!</div>
Alert links
Add .alert-link to a link inside an alert so it takes the alert's link colour.
<div class="alert alert-primary" role="alert">
A primary alert with <a href="#rdm-alerts" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-success" role="alert">
A success alert with <a href="#rdm-alerts" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-danger" role="alert">
A danger alert with <a href="#rdm-alerts" class="alert-link">an example link</a>. Give it a click if you like.
</div>
Dismissible alert
Add .alert-dismissible and a .btn-close with data-bs-dismiss="alert" to let the reader remove an alert.
<div id="rdm-alerts-dismissible" class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
Badges
.badge-default paints the Material grey ($grey-600) and needs .text-white for its label; contextual badges use Bootstrap's .text-bg-*, palette badges use .bg-*, and .rounded-pill makes a pill.
<span class="badge badge-default text-white me-1">Default</span>
<span class="badge text-bg-primary me-1">Primary</span>
<span class="badge text-bg-success me-1">Success</span>
<span class="badge text-bg-danger me-1">Danger</span>
<span class="badge bg-red me-1">Red</span>
<span class="badge bg-yellow me-1">Yellow</span>
<span class="badge bg-blue me-1">Blue</span>
<span class="badge rounded-pill text-bg-primary">Pill</span>
Badges in buttons
Put a badge inside a button to show a count; the badge keeps its own colours and the button text provides the accessible name.
<button type="button" class="btn btn-primary me-2 mb-2">Notifications <span class="badge text-bg-light ms-1">4</span></button>
<button type="button" class="btn btn-outline-secondary me-2 mb-2">Messages <span class="badge text-bg-secondary ms-1">8</span></button>
<button type="button" class="btn btn-dark mb-2">Updates <span class="badge bg-yellow ms-1">2</span></button>
Dropdowns
Redmaterials keeps Bootstrap's dropdown markup and restyles the menu: square corners, no border, the Material depth shadow and roomier items. The menu is opened by Bootstrap's bundle JavaScript through data-bs-toggle="dropdown"; no Redmaterials script or extra data attribute is needed. Add data-bs-theme="dark" to a .dropdown-menu for a dark menu.
Compared with stock Bootstrap. Stock Bootstrap's menu uses a 1px border, rounded corners, its lighter shadow and tighter item padding; Redmaterials removes the border, squares the corners, uses the Material depth shadow and roomier items. The markup, placement classes and data-bs-* options are Bootstrap 5 throughout.
Basic dropdown
Put .dropdown-toggle and data-bs-toggle="dropdown" on the trigger and a .dropdown-menu next to it; Redmaterials supplies the square, borderless menu and depth shadow.
<div class="dropdown" id="rdm-dropdowns-basic">
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Dropdown button</button>
<ul class="dropdown-menu" id="rdm-dropdowns-basic-menu">
<li><a class="dropdown-item" href="#rdm-dropdowns">Action</a></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Another action</a></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Something else here</a></li>
</ul>
</div>
Dark menu
Add data-bs-theme="dark" to the .dropdown-menu only, so its items use the dark surface and light text while the surrounding page keeps its own colour mode.
<div class="dropdown" id="rdm-dropdowns-dark">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Dark dropdown</button>
<ul class="dropdown-menu" data-bs-theme="dark" id="rdm-dropdowns-dark-menu">
<li><a class="dropdown-item" href="#rdm-dropdowns">Action</a></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Something else here</a></li>
</ul>
</div>
Headers and states
Use .dropdown-header for a non-interactive label, .dropdown-divider to separate groups, .dropdown-item-text for plain text, and .active or .disabled on an item to show its state.
<div class="dropdown" id="rdm-dropdowns-items">
<button class="btn btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Menu items</button>
<ul class="dropdown-menu">
<li><h6 class="dropdown-header">Dropdown header</h6></li>
<li><a class="dropdown-item active" href="#rdm-dropdowns" aria-current="true">Active item</a></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Regular item</a></li>
<li><a class="dropdown-item disabled" href="#rdm-dropdowns" aria-disabled="true" tabindex="-1">Disabled item</a></li>
<li><hr class="dropdown-divider"></li>
<li><span class="dropdown-item-text">Plain text item</span></li>
</ul>
</div>
Split button and alignment
A split button keeps the main action separate from the menu trigger, and .dropdown-menu-end aligns the menu to the right edge of its trigger.
<div class="btn-group" id="rdm-dropdowns-split">
<button type="button" class="btn btn-primary">Split action</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">Toggle split dropdown</span>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="#rdm-dropdowns">Action</a></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#rdm-dropdowns">Separated link</a></li>
</ul>
</div>
List group
Redmaterials keeps Bootstrap's list-group markup and adjusts the Material look: roomier .list-group-item padding, square first and last corners, a Material blue active item and a .list-group-item-heading helper for custom rows. No data attribute or JavaScript is required.
Compared with stock Bootstrap. Stock Bootstrap uses tighter padding, rounded outer corners and a #0d6efd active fill; Redmaterials uses roomier .list-group-item padding, square first and last corners and a Material blue active item. The .list-group-item-heading spacing is Redmaterials-only; the list, active, action and disabled classes are Bootstrap 5.
Items
Use a ul or div with .list-group and give every row .list-group-item.
- First item
- Second item
- Third item
<ul class="list-group">
<li class="list-group-item">First item</li>
<li class="list-group-item">Second item</li>
<li class="list-group-item">Third item</li>
</ul>
Active item
Add .active and aria-current="true" to mark the current item; Redmaterials paints it with its Material blue instead of Bootstrap's default blue.
- An active item
- A second item
- A third item
<ul class="list-group">
<li class="list-group-item active" aria-current="true">An active item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
Action states
Use links or buttons with .list-group-item-action for rows that respond to hover and focus; add .active for the current row and disabled or .disabled for an unavailable one.
<div class="list-group">
<a href="#rdm-list-group" class="list-group-item list-group-item-action active" aria-current="true">The current link item</a>
<a href="#rdm-list-group" class="list-group-item list-group-item-action">A second link item</a>
<a href="#rdm-list-group" class="list-group-item list-group-item-action">A third link item</a>
<button type="button" class="list-group-item list-group-item-action">A button item</button>
<button type="button" class="list-group-item list-group-item-action" disabled>A disabled button item</button>
</div>
Custom content with a heading
Put .list-group-item-heading on a heading inside a custom .list-group-item to get a half-em gap below it; pair it with a paragraph and any Bootstrap utility.
Heading
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Heading
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
<div class="list-group" style="max-width: 32rem;">
<div class="list-group-item">
<h5 class="list-group-item-heading">Heading</h5>
<p class="mb-0">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</div>
<div class="list-group-item">
<h5 class="list-group-item-heading">Heading</h5>
<p class="mb-0">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</div>
</div>
Pagination
Redmaterials keeps Bootstrap's pagination markup and gives the page links a Material treatment: borderless cells with 2px corners, roomier 0.8em 1.5em padding, the Material primary for the active page and a soft focus ring. No data attribute or JavaScript is needed.
Compared with stock Bootstrap. Stock Bootstrap uses a 1px border, 0.375rem corners, 0.375rem 0.75rem padding and a default blue active page; Redmaterials removes the border, uses 2px corners, 0.8em 1.5em padding and the Material primary for the active page, with a soft focus ring. The .pagination, .page-item, .page-link and size classes are Bootstrap 5 throughout.
Overview
Wrap the list in a nav with an aria-label, mark the current page with .active and aria-current="page", and add .flex-wrap so long pagers wrap on narrow screens.
<nav aria-label="Pagination example">
<ul class="pagination flex-wrap">
<li class="page-item disabled">
<a class="page-link" href="#rdm-pagination" tabindex="-1" aria-disabled="true">Previous</a>
</li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">1</a></li>
<li class="page-item active" aria-current="page">
<a class="page-link" href="#rdm-pagination">2 <span class="visually-hidden">(current)</span></a>
</li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">3</a></li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">Next</a></li>
</ul>
</nav>
Icons
Use an inline SVG for previous and next controls, hide the glyph from assistive technology and give each link an aria-label that names the destination.
<nav aria-label="Pagination with icons">
<ul class="pagination flex-wrap">
<li class="page-item">
<a class="page-link" href="#rdm-pagination" aria-label="Previous page">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
<path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"/>
</svg>
</a>
</li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">1</a></li>
<li class="page-item active" aria-current="page">
<a class="page-link" href="#rdm-pagination">2 <span class="visually-hidden">(current)</span></a>
</li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">3</a></li>
<li class="page-item">
<a class="page-link" href="#rdm-pagination" aria-label="Next page">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"/>
</svg>
</a>
</li>
</ul>
</nav>
Sizes
Add Bootstrap's .pagination-lg or .pagination-sm to the .pagination list; the Material colours, corners and padding scale with the size.
<nav aria-label="Large pagination example">
<ul class="pagination pagination-lg flex-wrap">
<li class="page-item"><a class="page-link" href="#rdm-pagination" aria-label="Previous page (large)">«</a></li>
<li class="page-item active" aria-current="page"><a class="page-link" href="#rdm-pagination">1 <span class="visually-hidden">(current)</span></a></li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">2</a></li>
<li class="page-item"><a class="page-link" href="#rdm-pagination" aria-label="Next page (large)">»</a></li>
</ul>
</nav>
<nav aria-label="Small pagination example">
<ul class="pagination pagination-sm flex-wrap">
<li class="page-item"><a class="page-link" href="#rdm-pagination" aria-label="Previous page (small)">«</a></li>
<li class="page-item active" aria-current="page"><a class="page-link" href="#rdm-pagination">1 <span class="visually-hidden">(current)</span></a></li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">2</a></li>
<li class="page-item"><a class="page-link" href="#rdm-pagination" aria-label="Next page (small)">»</a></li>
</ul>
</nav>
Active and disabled states
Use .active with aria-current="page" for the current page and .disabled with aria-disabled="true" plus tabindex="-1" for an unavailable control; the theme keeps the disabled background but mutes the label.
<nav aria-label="Pagination states example">
<ul class="pagination flex-wrap">
<li class="page-item disabled"><a class="page-link" href="#rdm-pagination" tabindex="-1" aria-disabled="true">Previous</a></li>
<li class="page-item active" aria-current="page"><a class="page-link" href="#rdm-pagination">1 <span class="visually-hidden">(current)</span></a></li>
<li class="page-item"><a class="page-link" href="#rdm-pagination">2</a></li>
<li class="page-item disabled"><a class="page-link" href="#rdm-pagination" tabindex="-1" aria-disabled="true">Next</a></li>
</ul>
</nav>
Modals
Redmaterials keeps Bootstrap's modal markup and restyles the dialog: a translucent Material surface, 2px corners, no border between the header, body and footer, and the deepest theme shadow on .modal-content from 768px up. Bootstrap's bundle JavaScript drives it through data-bs-toggle="modal" and data-bs-target; Redmaterials adds no script and no data attribute.
Compared with stock Bootstrap. Stock Bootstrap's dialog uses an opaque --bs-body-bg surface, 0.5rem corners and 1px header and footer borders, with its lighter default shadow; Redmaterials gives it a translucent Material surface, 2px corners, no border between the header, body and footer, and the deepest theme shadow on .modal-content from 768px up. The markup and every data-bs-* option are Bootstrap 5.
Header, footer and depth
The preview is the same dialog laid out inline with .position-static and .d-block, so the borderless header and footer and the depth shadow are visible without opening anything; the footer here uses text so the preview has no dead controls.
<div class="modal position-static d-block" tabindex="-1" aria-labelledby="modals-preview-title">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modals-preview-title">Modal title</h5>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<p class="mb-0">Modal footer content goes here.</p>
</div>
</div>
</div>
</div>
Live demo
The launch button opens a real modal with a dismissible close button and footer actions; both footer buttons dismiss it, and Esc or a click on the backdrop closes it as in Bootstrap.
<button type="button" class="btn btn-primary" id="modals-live-button" data-bs-toggle="modal" data-bs-target="#modals-live">Launch demo modal</button>
<div class="modal fade" id="modals-live" tabindex="-1" aria-labelledby="modals-live-title" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modals-live-title">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Modal body text goes here. The header and footer sit on the same translucent surface with no divider lines.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button>
</div>
</div>
</div>
</div>
Popovers & tooltips
Redmaterials keeps Bootstrap's popover and tooltip markup and restyles the generated elements in scss/popover.scss and scss/tooltip.scss: popovers get the translucent Material surface, 2px corners and the depth-2 shadow, while tooltips get the high-contrast tooltip token, 2px corners and full opacity. Bootstrap's bundle JavaScript creates both from data-bs-toggle="popover" and data-bs-toggle="tooltip"; docs-src/assets/js/docs.js initialises every trigger on the page, so the examples need no extra script.
Bootstrap's popovers open on click by default and tooltips on hover or focus, so the tooltip triggers below add data-bs-trigger="click" to make the interaction easy to repeat. Compared with stock Bootstrap. Stock Bootstrap's popover has an opaque light surface, 0.5rem corners and a Bootstrap border, and its tooltip has 0.875rem corners and 0.9 opacity; Redmaterials gives the popover the translucent Material surface, 2px corners and the depth-2 shadow, and the tooltip a high-contrast token, 2px corners and full opacity. All data-bs-* attributes and placement names are Bootstrap 5.
Popover: top
data-bs-placement="top" opens the popover above its trigger.
<button type="button" class="btn btn-primary" id="rdm-overlays-popover-top" data-bs-toggle="popover" data-bs-trigger="click" data-bs-placement="top" data-bs-title="Popover on top" data-bs-content="Popover content shown above the trigger.">Popover on top</button>
Popover: right
data-bs-placement="right" opens the popover to the right of its trigger.
<button type="button" class="btn btn-primary" id="rdm-overlays-popover-right" data-bs-toggle="popover" data-bs-trigger="click" data-bs-placement="right" data-bs-title="Popover on the right" data-bs-content="Popover content shown to the right of the trigger.">Popover on the right</button>
Popover: bottom
data-bs-placement="bottom" opens the popover below its trigger.
<button type="button" class="btn btn-primary" id="rdm-overlays-popover-bottom" data-bs-toggle="popover" data-bs-trigger="click" data-bs-placement="bottom" data-bs-title="Popover on the bottom" data-bs-content="Popover content shown below the trigger.">Popover on the bottom</button>
Popover: left
data-bs-placement="left" opens the popover to the left of its trigger.
<button type="button" class="btn btn-primary" id="rdm-overlays-popover-left" data-bs-toggle="popover" data-bs-trigger="click" data-bs-placement="left" data-bs-title="Popover on the left" data-bs-content="Popover content shown to the left of the trigger.">Popover on the left</button>
Tooltips
Tooltips use the same four Bootstrap placement values; each trigger opts into a click trigger so the tooltip stays open long enough to inspect.
Tooltip: top
data-bs-placement="top" shows the tooltip above its trigger.
<button type="button" class="btn btn-secondary" id="rdm-overlays-tooltip-top" data-bs-toggle="tooltip" data-bs-trigger="click" data-bs-placement="top" data-bs-title="Tooltip on top">Tooltip on top</button>
Tooltip: right
data-bs-placement="right" shows the tooltip to the right of its trigger.
<button type="button" class="btn btn-secondary" id="rdm-overlays-tooltip-right" data-bs-toggle="tooltip" data-bs-trigger="click" data-bs-placement="right" data-bs-title="Tooltip on the right">Tooltip on the right</button>
Tooltip: bottom
data-bs-placement="bottom" shows the tooltip below its trigger.
<button type="button" class="btn btn-secondary" id="rdm-overlays-tooltip-bottom" data-bs-toggle="tooltip" data-bs-trigger="click" data-bs-placement="bottom" data-bs-title="Tooltip on the bottom">Tooltip on the bottom</button>
Tooltip: left
data-bs-placement="left" shows the tooltip to the left of its trigger.
<button type="button" class="btn btn-secondary" id="rdm-overlays-tooltip-left" data-bs-toggle="tooltip" data-bs-trigger="click" data-bs-placement="left" data-bs-title="Tooltip on the left">Tooltip on the left</button>
Progress
Redmaterials keeps Bootstrap's .progress and .progress-bar markup and restyles the bar in scss/progress-bars.scss: 6px tall, square ends, no track shadow, and the Material brand primary as the default fill. Set the value with an inline width and describe it with role="progressbar" plus aria-valuenow, aria-valuemin, aria-valuemax and aria-label on the outer .progress. No data attribute or JavaScript is needed.
Compared with stock Bootstrap. Stock Bootstrap's track is 1rem tall with 0.375rem rounded ends and the inset track shadow, and its default fill is Bootstrap blue; Redmaterials makes the track 6px tall with square ends and no track shadow, and uses the Material brand primary as the default fill. The contextual .bg-*, striped and animated classes are Bootstrap 5 throughout.
Basic
A single bar at 25 per cent; the outer element carries the accessible name and value.
<div class="progress" id="rdm-progress-basic" role="progressbar" aria-label="Basic progress example" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar" style="width: 25%"></div>
</div>
Labels
The theme's 6px bar is too thin for readable text inside it, so put the label above the bar and keep the accessible name and value on the outer .progress.
<div class="d-flex justify-content-between small mb-1">
<span>Upload</span>
<span>50%</span>
</div>
<div class="progress mb-3" id="rdm-progress-label" role="progressbar" aria-label="Upload progress" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar" style="width: 50%"></div>
</div>
<div class="d-flex justify-content-between small mb-1">
<span>Import</span>
<span>100%</span>
</div>
<div class="progress" role="progressbar" aria-label="Import progress" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar bg-success" style="width: 100%"></div>
</div>
Contextual colours
Add a Bootstrap background utility to the bar to signal meaning; the track, height and square ends stay the same, and the label stays outside the thin bar.
<div class="d-flex justify-content-between small mb-1">
<span>Success</span>
<span>40%</span>
</div>
<div class="progress mb-3" id="rdm-progress-colours" role="progressbar" aria-label="Success progress example" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar bg-success" style="width: 40%"></div>
</div>
<div class="d-flex justify-content-between small mb-1">
<span>Info</span>
<span>55%</span>
</div>
<div class="progress mb-3" role="progressbar" aria-label="Info progress example" aria-valuenow="55" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar bg-info" style="width: 55%"></div>
</div>
<div class="d-flex justify-content-between small mb-1">
<span>Warning</span>
<span>70%</span>
</div>
<div class="progress mb-3" role="progressbar" aria-label="Warning progress example" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar bg-warning" style="width: 70%"></div>
</div>
<div class="d-flex justify-content-between small mb-1">
<span>Danger</span>
<span>85%</span>
</div>
<div class="progress" role="progressbar" aria-label="Danger progress example" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar bg-danger" style="width: 85%"></div>
</div>
Striped
.progress-bar-striped layers Bootstrap's diagonal stripe over the bar colour.
<div class="progress" id="rdm-progress-striped" role="progressbar" aria-label="Striped progress example" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-striped" style="width: 45%"></div>
</div>
Animated stripes
Add .progress-bar-animated to scroll the stripes; it is a Bootstrap animation and does not change the value.
<div class="progress" id="rdm-progress-animated" role="progressbar" aria-label="Animated progress example" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 75%"></div>
</div>
Multiple bars
Stack several bars inside one .progress to show parts of a whole; give the outer element the combined value.
<div class="progress" id="rdm-progress-multiple" role="progressbar" aria-label="Combined progress: 35 and 25 per cent" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar" style="width: 35%"></div>
<div class="progress-bar bg-success" style="width: 25%"></div>
</div>
Card with progress
There is no Redmaterials "card with progress" wrapper class: this is the stock .progress placed directly between .card-header and .card-body, and it inherits the same 6px square-ended bar. The .card supplies the surface and radius; add a .shadow-depth-* class when the card should sit above the page.
The stock progress bar runs the full width of the card with no extra wrapper.
<div class="card" id="rdm-progress-card">
<div class="card-header">Project status</div>
<div class="progress" role="progressbar" aria-label="Project completion" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar" style="width: 60%"></div>
</div>
<div class="card-body">
<p class="mb-0">The stock progress bar runs the full width of the card with no extra wrapper.</p>
</div>
</div>
Tables
scss/tables.scss builds on Bootstrap 5.3's variable-driven .table: transparent base, theme-aware borders, token-based striped, hover and active rows, and roomier 1.6rem cell padding. The palette tables add a .table-{colour} class that tints the striped and hover rows and keeps the theme's table text colour, so they stay readable in light and dark mode. No data attribute or JavaScript is needed.
The table palette covers 17 of the 19 Material colours. There is no .table-grey or .table-blue-grey: scss/tables.scss stops at .table-brown, so those two classes are not documented as if they existed.
Compared with stock Bootstrap. Stock Bootstrap has no .table-red … .table-brown palette classes, so its stripes and hover use its own colours, and its cell padding is tighter than the 1.6rem Redmaterials uses; Redmaterials adds the palette classes that tint the striped and hover rows. .table-sm is Bootstrap 5; .table-condensed, .table-no-border and .table-responsive-vertical are Redmaterials additions.
Palette tables
Each table combines the palette class with .table-striped and .table-hover so the tint is visible; the caption names the class.
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
<div class="table-responsive">
<table class="table table-striped table-hover table-red mb-3">
<caption class="text-body-secondary"><code>.table-red</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-pink mb-3">
<caption class="text-body-secondary"><code>.table-pink</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-purple mb-3">
<caption class="text-body-secondary"><code>.table-purple</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-deep-purple mb-3">
<caption class="text-body-secondary"><code>.table-deep-purple</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-indigo mb-3">
<caption class="text-body-secondary"><code>.table-indigo</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-blue mb-3">
<caption class="text-body-secondary"><code>.table-blue</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-light-blue mb-3">
<caption class="text-body-secondary"><code>.table-light-blue</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-cyan mb-3">
<caption class="text-body-secondary"><code>.table-cyan</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-teal mb-3">
<caption class="text-body-secondary"><code>.table-teal</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-green mb-3">
<caption class="text-body-secondary"><code>.table-green</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-light-green mb-3">
<caption class="text-body-secondary"><code>.table-light-green</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-lime mb-3">
<caption class="text-body-secondary"><code>.table-lime</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-yellow mb-3">
<caption class="text-body-secondary"><code>.table-yellow</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-amber mb-3">
<caption class="text-body-secondary"><code>.table-amber</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-orange mb-3">
<caption class="text-body-secondary"><code>.table-orange</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-deep-orange mb-3">
<caption class="text-body-secondary"><code>.table-deep-orange</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
<table class="table table-striped table-hover table-brown mb-3">
<caption class="text-body-secondary"><code>.table-brown</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
</div>
Bordered table
.table-bordered adds a border to every cell and around the table; the borders use the theme's token-based border colour and the table keeps the roomier cell padding.
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
<div class="table-responsive">
<table class="table table-bordered">
<caption class="text-body-secondary"><code>.table-bordered</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
</div>
Contextual rows
Bootstrap's eight contextual table classes tint a whole row (or cell) from the theme's status tokens, and the theme keeps the text colour readable in both colour modes.
| Class | Name | Role |
|---|---|---|
.table-primary | Ada Lovelace | Engineer |
.table-secondary | Grace Hopper | Admiral |
.table-success | Alan Turing | Mathematician |
.table-danger | Katherine Johnson | Computer |
.table-warning | Margaret Hamilton | Software engineer |
.table-info | Barbara Liskov | Computer scientist |
.table-light | Edsger Dijkstra | Computer scientist |
.table-dark | Donald Knuth | Computer scientist |
<div class="table-responsive">
<table class="table">
<caption class="text-body-secondary">One row per contextual class</caption>
<thead>
<tr><th scope="col">Class</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr class="table-primary"><td><code>.table-primary</code></td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr class="table-secondary"><td><code>.table-secondary</code></td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr class="table-success"><td><code>.table-success</code></td><td>Alan Turing</td><td>Mathematician</td></tr>
<tr class="table-danger"><td><code>.table-danger</code></td><td>Katherine Johnson</td><td>Computer</td></tr>
<tr class="table-warning"><td><code>.table-warning</code></td><td>Margaret Hamilton</td><td>Software engineer</td></tr>
<tr class="table-info"><td><code>.table-info</code></td><td>Barbara Liskov</td><td>Computer scientist</td></tr>
<tr class="table-light"><td><code>.table-light</code></td><td>Edsger Dijkstra</td><td>Computer scientist</td></tr>
<tr class="table-dark"><td><code class="text-reset">.table-dark</code></td><td>Donald Knuth</td><td>Computer scientist</td></tr>
</tbody>
</table>
</div>
Striped and hover
Bootstrap's .table-striped, .table-hover and .table-active are restyled from theme tokens, with a 0.3s transition on the cells; the striped tint alternates rows and the hover tint follows the pointer, while .table-active marks a row persistently.
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
<div class="table-responsive">
<table class="table table-striped table-hover" id="tables-hover">
<caption class="text-body-secondary">Striped, hover and one active row</caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr class="table-active"><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
</div>
Condensed and small
.table-sm is Bootstrap 5's half-padding class and .table-condensed is the backwards-compatible Redmaterials alias: both reduce the theme's 1.6rem cell padding to 0.8rem without changing borders or colours.
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
<div class="table-responsive mb-3">
<table class="table table-striped table-condensed">
<caption class="text-body-secondary"><code>.table-condensed</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-striped table-sm">
<caption class="text-body-secondary"><code>.table-sm</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
</tbody>
</table>
</div>
No border
.table-no-border removes every cell border while keeping the row padding, stripes and hover tint; the table's outer border is not part of .table, so the class only affects the cells.
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
<div class="table-responsive">
<table class="table table-striped table-hover table-no-border">
<caption class="text-body-secondary"><code>.table-no-border</code></caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Ada Lovelace</td><td>Engineer</td></tr>
<tr><td>2</td><td>Grace Hopper</td><td>Admiral</td></tr>
<tr><td>3</td><td>Alan Turing</td><td>Mathematician</td></tr>
</tbody>
</table>
</div>
Responsive vertical
.table-responsive-vertical keeps a normal table above 768px and, at 768px and below, hides the header and footer, turns every row into a bordered block and every cell into a right-aligned line. Add data-title to each td: the stylesheet prints it with ::before as the line's label. Narrow the browser to see the stacked layout.
| # | Name | Role |
|---|---|---|
| 1 | Ada Lovelace | Engineer |
| 2 | Grace Hopper | Admiral |
| 3 | Alan Turing | Mathematician |
<div class="table-responsive-vertical">
<table class="table table-striped">
<caption class="text-body-secondary">Resize below 769px to stack the rows</caption>
<thead>
<tr><th scope="col">#</th><th scope="col">Name</th><th scope="col">Role</th></tr>
</thead>
<tbody>
<tr>
<td data-title="#">1</td>
<td data-title="Name">Ada Lovelace</td>
<td data-title="Role">Engineer</td>
</tr>
<tr>
<td data-title="#">2</td>
<td data-title="Name">Grace Hopper</td>
<td data-title="Role">Admiral</td>
</tr>
<tr>
<td data-title="#">3</td>
<td data-title="Name">Alan Turing</td>
<td data-title="Role">Mathematician</td>
</tr>
</tbody>
</table>
</div>
Cards
Redmaterials keeps Bootstrap's card markup and changes the header and footer wash: scss/cards.scss points --bs-card-cap-bg at the theme token --rdm-card-cap-bg (3% of the body colour in light mode, 10% black in dark mode), so a coloured card keeps its text contrast instead of being lightened. Cards can use the .shadow-depth-* scale and the .card-action / .btn-action pair. No data attribute or JavaScript is needed.
Compared with stock Bootstrap. Stock Bootstrap's header and footer use its own translucent body-colour wash (which lightens coloured cards in dark mode), the six depth classes have no effect, and .card-action / .btn-action do not exist, so the action button sits in the normal flow; Redmaterials points --bs-card-cap-bg at --rdm-card-cap-bg and adds the depth scale and the action pair. The card, header, footer, image and list-group markup is Bootstrap 5 throughout.
Headers and footers
The header and footer share the card surface with the theme wash; put .text-bg-primary (or a palette .bg-*) on the whole card to see the token keep the coloured header dark enough for white text in both modes.
Coloured card
The header and footer keep their colour wash instead of lightening the card surface.
<div class="row g-3">
<div class="col-md-6">
<div class="card h-100" id="cards-header-footer">
<div class="card-header">Featured</div>
<div class="card-body">
<h5 class="card-title">Card title</h5>
<h6 class="card-subtitle mb-2 text-body-secondary">Card subtitle</h6>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#cards" class="btn btn-primary">Go somewhere</a>
</div>
<div class="card-footer text-body-secondary">Last updated 3 mins ago</div>
</div>
</div>
<div class="col-md-6">
<div class="card h-100 text-bg-primary">
<div class="card-header">Featured</div>
<div class="card-body">
<h5 class="card-title">Coloured card</h5>
<p class="card-text">The header and footer keep their colour wash instead of lightening the card surface.</p>
</div>
<div class="card-footer">Last updated 3 mins ago</div>
</div>
</div>
</div>
Card action
Add .card-action to a positioned card header (or another relative container) and .btn-action to the button; the class lifts it 27px below the header and 1.5em from the right edge. Give the icon-only button an aria-label and hide the Material Icons glyph from assistive technology.
Card action
Description of the card
The action button overlaps the boundary between the header and the body.
<div class="card mb-5" id="cards-action" style="max-width: 24rem;">
<div class="card-header card-action bg-indigo text-white">
<h3 class="h5 mb-1">Card action</h3>
<p class="mb-0">Description of the card</p>
<button type="button" class="btn btn-circle btn-raised bg-pink text-white btn-action" aria-label="Add item">
<i class="material-icons" aria-hidden="true">add</i>
</button>
</div>
<div class="card-body">
<p class="card-text">The action button overlaps the boundary between the header and the body.</p>
</div>
<div class="card-footer">
<button type="button" class="btn btn-raised bg-indigo text-white">Get started</button>
<button type="button" class="btn btn-secondary">Cancel</button>
</div>
</div>
Depth
Apply .shadow-depth-1 through .shadow-depth-5 to a card; the shadow is a theme token that deepens in dark mode. The three cards use depths 1, 3 and 5.
Depth 1
.shadow-depth-1
Depth 3
.shadow-depth-3
Depth 5
.shadow-depth-5
<div class="row g-3" id="cards-depth">
<div class="col-md-4">
<div class="card h-100 shadow-depth-1">
<div class="card-body">
<h5 class="card-title">Depth 1</h5>
<p class="card-text mb-0"><code>.shadow-depth-1</code></p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100 shadow-depth-3">
<div class="card-body">
<h5 class="card-title">Depth 3</h5>
<p class="card-text mb-0"><code>.shadow-depth-3</code></p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100 shadow-depth-5">
<div class="card-body">
<h5 class="card-title">Depth 5</h5>
<p class="card-text mb-0"><code>.shadow-depth-5</code></p>
</div>
</div>
</div>
</div>
Images
Use Bootstrap's .card-img-top or .card-img-bottom for edge-to-edge images. The illustration here is an inline SVG painted with currentColor, so it follows the theme through .text-body-secondary and needs no external image.
Card with an image
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card" id="cards-image" style="max-width: 24rem;">
<svg class="card-img-top d-block text-body-secondary" xmlns="http://www.w3.org/2000/svg" width="100%" height="180" viewBox="0 0 318 180" preserveAspectRatio="xMidYMid slice" role="img" aria-label="Abstract placeholder illustration">
<rect width="318" height="180" fill="currentColor" opacity=".15"/>
<circle cx="90" cy="90" r="52" fill="currentColor" opacity=".3"/>
<circle cx="238" cy="90" r="52" fill="currentColor" opacity=".3"/>
</svg>
<div class="card-body">
<h5 class="card-title">Card with an image</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
<div class="card-footer">
<a href="#cards" class="card-link">Card link</a>
<a href="#cards" class="card-link">Another link</a>
</div>
</div>
Shadows
scss/shadows.scss adds six depth classes, .shadow-depth-0 through .shadow-depth-5: depth 0 removes the shadow and depths 1 to 5 read the matching --rdm-shadow-depth-* token. The tokens follow data-bs-theme, so no data attribute or JavaScript is needed on the element.
Dark-mode note. The shadows deepen in dark mode and gain a faint inset top highlight, following Material's elevated dark surfaces; the same class therefore looks stronger on a dark page than on a light one.
Compared with stock Bootstrap. Bootstrap only ships .shadow-none, .shadow-sm, .shadow and .shadow-lg, so stock Bootstrap has none of the six depth classes and the boxes render flat; Redmaterials adds .shadow-depth-0 through .shadow-depth-5.
Depths
All six depths on the same .bg-body box, with a border so depth 0 is still visible.
Depth 0
.shadow-depth-0
Depth 1
.shadow-depth-1
Depth 2
.shadow-depth-2
Depth 3
.shadow-depth-3
Depth 4
.shadow-depth-4
Depth 5
.shadow-depth-5
<div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 g-4">
<div class="col">
<div class="bg-body border shadow-depth-0 p-4 text-center">
<h5>Depth 0</h5>
<code>.shadow-depth-0</code>
</div>
</div>
<div class="col">
<div class="bg-body border shadow-depth-1 p-4 text-center">
<h5>Depth 1</h5>
<code>.shadow-depth-1</code>
</div>
</div>
<div class="col">
<div class="bg-body border shadow-depth-2 p-4 text-center">
<h5>Depth 2</h5>
<code>.shadow-depth-2</code>
</div>
</div>
<div class="col">
<div class="bg-body border shadow-depth-3 p-4 text-center">
<h5>Depth 3</h5>
<code>.shadow-depth-3</code>
</div>
</div>
<div class="col">
<div class="bg-body border shadow-depth-4 p-4 text-center">
<h5>Depth 4</h5>
<code>.shadow-depth-4</code>
</div>
</div>
<div class="col">
<div class="bg-body border shadow-depth-5 p-4 text-center">
<h5>Depth 5</h5>
<code>.shadow-depth-5</code>
</div>
</div>
</div>
On a card
The depth classes compose with any component; this card uses depth 3, and the shadow follows the page into dark mode.
Card with depth 3
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
<div class="card shadow-depth-3" id="shadows-card" style="max-width: 24rem;">
<div class="card-body">
<h5 class="card-title">Card with depth 3</h5>
<h6 class="card-subtitle mb-2 text-body-secondary">Card subtitle</h6>
<p class="card-text mb-0">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
Corner Ribbons
scss/ribbons.scss adds .corner-ribbon-wrapper and .corner-ribbon: the wrapper is a positioned, clipping container and the ribbon is an absolutely positioned 200px band rotated 45 degrees into a corner. Use one of the four position classes and any Bootstrap .bg-* utility plus a matching .text-* colour; .shadow is optional and uses the ribbon shadow token. No data attribute or JavaScript is needed.
The wrapper needs a positioned container with some height. .corner-ribbon-wrapper already sets position: relative; the examples also add Bootstrap's .position-relative and a sizing-only height so the ribbon has room, and the wrapper's overflow: hidden clips the band to the corner.
Compared with stock Bootstrap. Bootstrap has no corner-ribbon component or classes: stock Bootstrap adds no styling, so the bands sit in the normal flow and none of the four positions or colours rotate into a corner; Redmaterials adds .corner-ribbon-wrapper, .corner-ribbon and the four position classes.
Positions
The four supported corners are .top-left, .top-right, .bottom-left and .bottom-right; each preview is a positioned wrapper with a single ribbon.
<div class="row g-4">
<div class="col-sm-6">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 200px;">
<div class="corner-ribbon top-left bg-red text-white shadow">top-left</div>
</div>
</div>
<div class="col-sm-6">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 200px;">
<div class="corner-ribbon top-right bg-amber text-dark shadow">top-right</div>
</div>
</div>
<div class="col-sm-6">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 200px;">
<div class="corner-ribbon bottom-left bg-teal text-white shadow">bottom-left</div>
</div>
</div>
<div class="col-sm-6">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 200px;">
<div class="corner-ribbon bottom-right bg-pink text-white shadow">bottom-right</div>
</div>
</div>
</div>
Colours
Every Material palette .bg-{colour} utility works, and Bootstrap's contextual .bg-primary family works too. Each ribbon below pairs its background with the text colour that keeps it readable; .shadow is added to every one.
<div class="row row-cols-2 row-cols-sm-3 row-cols-lg-4 row-cols-xl-5 g-3">
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-red text-white shadow">red</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-pink text-white shadow">pink</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-purple text-white shadow">purple</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-deep-purple text-white shadow">deep-purple</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-indigo text-white shadow">indigo</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-blue text-white shadow">blue</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-light-blue text-white shadow">light-blue</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-cyan text-white shadow">cyan</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-teal text-white shadow">teal</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-green text-white shadow">green</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-light-green text-white shadow">light-green</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-lime text-dark shadow">lime</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-yellow text-dark shadow">yellow</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-amber text-dark shadow">amber</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-orange text-dark shadow">orange</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-deep-orange text-white shadow">deep-orange</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-brown text-white shadow">brown</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-grey text-white shadow">grey</div>
</div>
</div>
<div class="col">
<div class="corner-ribbon-wrapper position-relative bg-body-tertiary border rounded" style="height: 140px;">
<div class="corner-ribbon top-left bg-blue-grey text-white shadow">blue-grey</div>
</div>
</div>
</div>
Wells
scss/wells.scss adds a simple content container: .well has 1.2em 1.5em padding, the translucent surface token, and no border, corner radius or shadow, so it reads as an inset panel rather than a card. .well-sm reduces the padding to 0.8em and .well-lg raises it to 2em. No data attribute or JavaScript is needed.
The surface and the blockquote border colour come from theme tokens, so a well follows the page into dark mode without a per-element theme attribute.
Compared with stock Bootstrap. Bootstrap 5 has no well component (the class is a Bootstrap 3-era name), so stock Bootstrap gives .well, .well-sm and .well-lg no styling and the blocks have no inset surface or padding; Redmaterials adds the well with 1.2em 1.5em padding and the translucent surface token, plus the .well-sm and .well-lg sizes. The markup is plain HTML and stays valid either way.
Default well
A .well groups a short heading and paragraph on the translucent surface.
A default well
Wells are useful for inset help text, metadata or a short summary that should not look like a raised card.
<div class="well" id="wells-default">
<h5 class="mb-2">A default well</h5>
<p class="mb-0">Wells are useful for inset help text, metadata or a short summary that should not look like a raised card.</p>
</div>
Sizes
The three padding sizes, from .well-sm through the default .well to .well-lg.
.well-sm — 0.8em 1.5em padding.
.well — 1.2em 1.5em padding.
.well-lg — 2em 1.5em padding.
<div id="wells-sizes">
<div class="well well-sm mb-3">
<p class="mb-0"><code class="text-reset">.well-sm</code> — <code>0.8em 1.5em</code> padding.</p>
</div>
<div class="well mb-3">
<p class="mb-0"><code class="text-reset">.well</code> — <code>1.2em 1.5em</code> padding.</p>
</div>
<div class="well well-lg mb-3">
<p class="mb-0"><code class="text-reset">.well-lg</code> — <code>2em 1.5em</code> padding.</p>
</div>
</div>
Contents
A well accepts ordinary content; this one holds a blockquote and a list, and its blockquote border colour follows the theme token.
Well contents
Body copy, a quote and a list all keep their normal spacing inside the well.
Design is not just what it looks like and feels like. Design is how it works.
- Lists keep their markers and indentation.
- Padding is controlled by the well size class.
- The surface follows light and dark mode.
<div class="well" id="wells-contents">
<h5>Well contents</h5>
<p>Body copy, a quote and a list all keep their normal spacing inside the well.</p>
<blockquote class="blockquote">
<p>Design is not just what it looks like and feels like. Design is how it works.</p>
<footer class="blockquote-footer">Attributed to Steve Jobs</footer>
</blockquote>
<ul class="mb-0">
<li>Lists keep their markers and indentation.</li>
<li>Padding is controlled by the well size class.</li>
<li>The surface follows light and dark mode.</li>
</ul>
</div>
Scroll lock
rdm-ui-disable-scroll is a runtime state class, not markup to author: js/redmaterials.js adds it to <body> while the nav sidebar is open and removes it when the sidebar closes, and scss/scroll.scss gives that class overflow: hidden. The page therefore cannot scroll behind the open drawer, and normal scrolling returns on dismissal.
It is documented as code only because it never appears in static markup: adding it by hand would lock the page with no sidebar to close, and the class is excluded from the live-example audit for that reason.
Compared with stock Bootstrap. Bootstrap's offcanvas implements its own body scroll lock; rdm-ui-disable-scroll is a Redmaterials addition for the nav sidebar, and stock Bootstrap has no such class.
To see it, open the live demo in the Nav Sidebar section and inspect the body element while the drawer is open.
The class in context
The script toggles the class on the body; this is the state it produces while the sidebar is open.
<body class="rdm-ui-disable-scroll">
<!-- page content; overflow is locked while the nav sidebar is open -->
</body>