c2n web components
Small, themable UI components that work in any stack.
43 components published as individual npm packages. Built on Lit, styled through CSS custom properties, and usable from plain HTML, React, Vue, Astro or anything that speaks the DOM.
One package per component Themed with CSS variables Framework agnostic, SSR friendly
Components
Every preview below is the real component. Open one to see its examples, API and an interactive theming panel.
Inputs11
Buttons4
Navigation7
Layout4
Data display7
Folders
Feedback8
Chat2
Icons
Icon sets ship as separate packages. Every icon is a web component that inherits currentColor.
Getting started
Three steps from an empty project to a themed component.
- 1
Install the packages you need
Each component ships as its own package under the
@c2nscope, so you only pay for what you use. Lit is a peer dependency shared between them.npm install @c2n/text-field - 2
Import once, use anywhere
Importing a package registers its
c2-*custom element. After that it is plain HTML.import '@c2n/text-field' // then anywhere in your markup <c2-text-field placeholder="Your email"></c2-text-field> - 3
Theme with CSS custom properties
Every visual detail is exposed as a variable named
--c2-<component>__<part>--<property>. Set them on any ancestor to restyle a component, a section, or the whole app. Or load @c2n/theme and set a handful of design tokens once..newsletter c2-text-field { --c2-text-field--border-radius: 12px; --c2-text-field--background: #f4f4f5; --c2-text-field__focus--border: 1px solid #2563eb; } - 4
Extend with slots
Named slots let you replace icons and inject content without forking the component.
<c2-text-field placeholder="Search"> <svg slot="prefix-icon" viewBox="0 0 24 24">…</svg> </c2-text-field>