Nunjucks templates (macros) for Bootstrap (v4) modules.
This project provides a collection of reusable macros for Bootstrap modules to quickly create web pages. Each module offers multiple very small macros, which allow you to mix and match, use them all, or just a few of them.
The macros produce HTML, so you can combine macros and HTML as you please. Here's an example:
<nav>
<h2 class="sr-only">Site menu</h2>
{% call nav.inline() %}
{{ nav.activeItem('Active', '#item1') }}
{{ nav.item('Default item', '#item2') }}
<li>use <strong>custom HTML</strong> anywhere</li>
{{ nav.item('Another item', '#item3') }}
{% endcall %}
</nav>
You can view the demos of all available modules.
- media
- nav
The source files of all modules can be found in src/
. Each module has its own readme with instructions on how to use its macros.
These templates are created for Nunjucks (JavaScript). The templates can also be used with template render engines in other languages (mostly without modification): Jinja2 (Python), Twig (PHP), Jinjava (Java) and Pongo (Go Lang).
See CONTRIBUTING.md for guidelines and development scripts.