Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Use the power of 11ty to generate web components (custom elements).

Starter kit for your next eleventy(11ty) project using postcss, es6, snowpack, webpack.

A minimal Hugo starter integrating Tailwind CSS, PostCSS, and PurgeCSS for fast static sites.

An easy-to-use, flexible website template for labs, built on Jekyll and GitHub with auto-generated citations.

Official Turborepo starter with two Next.js apps and three shared packages, fully typed in TypeScript.
11ty Web Component Generator is a boilerplate-style starter for Eleventy (11ty) that composes custom elements from Nunjucks templates, separate script files, and CSS, then outputs a single JavaScript module per component.
The 11ty Web Component Generator is an Eleventy-based starter template that builds web components using the static site generator's include and template system. It takes a component template file in src/components/ and per-component script.js and style.css files inside _includes/components/ as input, and produces a single .js file per component in public/components/. The project is authored by Stephanie Eckles (5t3ph), who also created the 11ty Netlify Jumpstart and the egghead course 'Learn to build an 11ty site in 20 mins'.
_includes mechanism to composite the final component JavaScript rather than a separate build tool.src/components/ must use kebab-case names, which determine the generated custom element and output filename._includes/components/ holds script.js and style.css; the shared component.njk template injects their contents into the output.public/components/ and are consumed with <script type='module'> and a matching custom tag.npm start starts Eleventy locally with Browsersync for live reload during development.npm run build runs Eleventy alone to generate a static production output suitable for Netlify or similar hosts.npm start to iterate with live reload and test components on pages in the same project..js file from public/components/ into any site and load it as an ES module.First, create a kebab-case component template in src/components/. Then add a matching folder in _includes/components/ containing script.js and style.css. Eleventy processes the Nunjucks template, which includes the script and style contents via component.njk, and writes the assembled component to public/components/. Pages in src declare the component through frontmatter, and the page.njk template links the generated script.
Yes, this is an open-source boilerplate project on GitHub, and the demo is hosted on Netlify.
Component template files in src/components/ must be kebab-case (lowercase with hyphens). The output filename and custom element name follow the same kebab-case format.
Yes, the output in public/components/ is a standalone JavaScript module. It can be included in any project with a script tag pointing to the file.
Yes, the structure supports any number of components. Each has its own folder in _includes/components/ and template in src/components/.
It uses Eleventy (11ty) with Nunjucks templating. The generated components are plain web components built with the Custom Elements API and Shadow DOM, using no framework.
