--- templateEngineOverride: njk layout: layouts/page.njk title: CLI description: Use the Basecoat CLI and template macros. icon: square-terminal toc: - label: Use the CLI id: cli - label: Use Nunjucks or Jinja macros id: macros --- {% from "macros/code_block.njk" import code_block %} {% from "tabs.njk" import tabs %}
If you're using Nunjucks or Jinja, you can use the CLI to install the CSS and macros for complex components (e.g. Dialog). It will copy the JS and .html.jinja or .njk macros into your code.
For example, to add the Dialog component, run one of the following commands:
You will be asked to confirm the template engine and destination directory for the JavaScript and macros.
For more complex components, you can use Nunjucks or Jinja macros to help generate the HTML and JavaScript code.
To install them, either copy them directly from the GitHub repository or use the CLI.
For example, here's how you could use the select() macro to generate the HTML and JavaScript code for a Select component: