Themable web components library with CMS admin mode support
npm install le-kit

A themeable web component library built with Stencil, featuring a dual-mode system for production and CMS editing.
- ðĻ Themeable â CSS custom properties for complete styling control
- ð§ Dual Mode â Production (default) and CMS editing (admin) modes
- ð Framework Agnostic â Works with any framework or vanilla JS
- ðŠķ Lightweight â Tree-shakeable with minimal runtime overhead
``bash`
npm install le-kit
The easiest way to use Le-Kit. Components are automatically loaded on-demand.
`html
Your content here
Welcome
`
Import only the components you need for smaller bundle sizes.
`tsx
// Import specific components
import { defineCustomElement as defineCard } from 'le-kit/components/le-card';
import { defineCustomElement as defineButton } from 'le-kit/components/le-button';
// Register them
defineCard();
defineButton();
`
Le-Kit ships with several built-in themes.
`html
`
Available themes: default, dark, minimal, warm, gradient
`tsx`
// With a bundler that handles CSS imports
import 'le-kit/dist/themes/base.css';
import 'le-kit/dist/themes/default.css';
Override CSS custom properties to match your brand:
`css`
:root {
--le-color-primary: #6366f1;
--le-color-secondary: #8b5cf6;
--le-radius-md: 12px;
--le-space-md: 1rem;
}
-
-
-
-
-
-
` Product description goes here with all the details.html`
Product Name
`html`
`html`
Le-Kit includes a CMS editing mode that enables inline content editing and component configuration. This is useful for building visual editors and CMS interfaces.
`html`
In admin mode, components display:
- Inline text editing for content slots
- Settings popovers for component properties
- Drop zones for adding new components
Admin mode requires the custom-elements.json manifest file to be served by your application. This file contains component metadata used by the property editors.
1. Copy the manifest to your public/static folder:
`bash`
cp node_modules/le-kit/custom-elements.json public/custom-elements.json
2. Configure the manifest URL (optional, if not served at /custom-elements.json):
`javascript
import { configureLeki } from 'le-kit';
configureLeki({
manifestFile: 'custom-elements.json'
});
`
The default manifestFile is custom-elements.json. Call configureLeKit()` before any admin-mode components are rendered.
Le-Kit supports all modern browsers:
- Chrome 79+
- Firefox 70+
- Safari 14+
- Edge 79+
MIT License â see LICENSE for details.
Contributions welcome! Please read our contributing guidelines before submitting a PR.