Add Basecoat components to your project
npm install basecoat-cliThis package provides a Command Line Interface (CLI) to help you quickly scaffold Basecoat components into your project.
- Ensure you have Node.js and npm (or your preferred package manager) installed.
- For the components to function correctly, your project should have:
- Tailwind CSS installed and configured.
- The basecoat-css package installed and imported (or basecoat.css manually added).
Use the add command to add components to your project:
``bashnpx
npx basecoat-cli add [component]
Replace
[component] with the name of the component you wish to add (e.g., dialog, select) or leave it out if you want to pick from the list of available components
or install all of them at once.The CLI will prompt you for:
1. Template Engine: Choose between Nunjucks (
.njk) or Jinja (.html.jinja).
2. Assets Directory: The path where component assets (like JavaScript files) should be placed (e.g., src/assets/js/components).
3. Macros Directory: The path where component macros should be placed (e.g., src/_includes/macros/components).The CLI will then copy the necessary JavaScript files and Nunjucks/Jinja macros for the selected component into the specified directories.
$3
To add the
dialog component:`bash
npx basecoat-cli add dialog
``For more detailed information on components, their usage, and customization options, please refer to the Basecoat documentation.