npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scaffold-ui-kit

v2.0.0

Published

Scaffold framework-agnostic UI kits powered by js-template-engine: define components once as data, ship them for React, Vue, Svelte, and HTML

Downloads

141

Readme

scaffold-ui-kit

Scaffold framework-agnostic UI kits powered by js-template-engine: define components once as typed data templates and build them for React, Vue, Svelte, and vanilla HTML — with BEM and Tailwind styling as configurable extensions.

A kit created by scaffold-ui-kit is an npm package with a single source of truth in src/components/, built output per target in dist/<target>/, and a consumer CLI that copies built components into consuming projects — no engine dependency ever reaches a consumer.

Create a kit

npx scaffold-ui-kit my-ui-kit
cd my-ui-kit
npm install
npm run build

init asks for the targets (react, vue, svelte, html), the styling extensions (bem, tailwind, or none), and whether to include the example components. Every choice can also be passed as a flag for non-interactive use:

npx scaffold-ui-kit init my-ui-kit --targets react,vue --styling bem --no-examples

Define components

Components are data templates in src/components/ — TypeScript modules default-exporting a template (with full autocompletion via defineTemplate), or plain JSON:

import { defineTemplate } from '@js-template-engine/types';

export default defineTemplate({
  type: 'component',
  name: 'Button',
  props: {
    label: { type: 'string', required: true },
    variant: { type: "'primary' | 'secondary'", default: 'primary' },
  },
  children: [
    {
      type: 'element',
      tag: 'button',
      attributes: { class: ['button'], type: 'button' },
      events: [{ name: 'click', handler: 'handleClick' }],
      children: [{ type: 'text', expression: 'label' }],
    },
  ],
});

Build

npm run build   # runs scaffold-ui-kit build

build renders every template once per configured target:

dist/
├── react/
│   ├── Button.tsx
│   ├── Card.tsx
│   └── index.ts
├── vue/
│   ├── Button.vue
│   ├── Card.vue
│   └── index.ts
├── svelte/
│   ├── Button.svelte
│   ├── Card.svelte
│   └── index.ts
└── html/
    ├── Button.html
    └── Card.html

Configured styling extensions (BEM, Tailwind) contribute their classes to every target's output. Targets, styling, and output strategies live in scaffold-ui-kit.config.json:

{
  "name": "my-ui-kit",
  "targets": ["react", "vue", "svelte", "html"],
  "styling": ["bem"]
}

Optional keys: stylingStrategy and scriptingStrategy (inline | in-file | separate-file, default in-file), stylingLanguage (css | scss, default css) — scss emits nested SCSS; the react and html targets need stylingStrategy: 'separate-file' under it — scriptingLanguage (javascript | typescript, default javascript) — typescript types the generated prop consts; it affects the html target only and needs scriptingStrategy: 'separate-file' there — bemElementSeparator / bemModifierSeparator, tailwindOutput (classes | styles, default classes) — set it to styles to convert the Tailwind utilities to plain CSS at build time, so the output needs no Tailwind build of its own — and tailwindConvertStyles (true | false, default false), the inverse: convert each component's authored style into Tailwind utility classes.

Publish and consume

npm publish

The published kit ships its built dist/ and a consumer CLI. Consumers copy components into their project without installing anything else:

npx my-ui-kit add button --target react
npx my-ui-kit add                # interactive
npx my-ui-kit add --list         # what's available

add copies the built component files (plus any separate stylesheets) into ./src/components/ui by default; --output-directory overrides the destination. Existing files prompt before being overwritten.

Kits are also usable as regular packages — each framework target gets an index.ts barrel re-exporting its components.

Commands

| Command | Purpose | |---|---| | scaffold-ui-kit init [project-name] | Scaffold a kit project (default command) | | scaffold-ui-kit build | Render every template into dist/<target>/ |

init flags: --targets <names>, --styling <names|none>, --examples / --no-examples, -d, --directory <path>.

License

MIT