Catalog npm
PACKAGE EXPLORERView in registry

42-components

npm

Headless UI component library (vanilla TypeScript) with optional theme.

Versions collected3
Direct dependencies21From release 0.0.2
Last observed20 Oct, 19:59 UTC

README

Current package documentation

@42-components

Headless UI component library in vanilla TypeScript, with optional theme.

Packages

PackageDescription
@42/coreFramework-agnostic headless controllers (subpath exports per component).
@42/stylesOptional theme (CSS custom properties, dark mode included).

Components

Grouped by what you are trying to do. Full per-component reference (markup, options, events) lives in docs/llm/reference/; complex components have a deep dive in docs/llm/.

CategoryUse it when…Reference
Inputs & Formsyou capture data from the userinputs.md
Overlaysyou need a transient layer above contentoverlays.md
Navigationyou move around or structure a flownavigation.md
Data & Collectionsyou display or manipulate sets of datadata.md
Mediayou show images or peoplemedia.md
Feedback & Statusyou communicate state, progress or an actionfeedback.md
Disclosure & Layoutyou show or hide regions of contentdisclosure.md
Presentational (CSS-only)you just need styles, no controllerpresentational.md

Development

pnpm install
pnpm test            # vitest (jsdom)
pnpm build           # build all publishable packages
pnpm storybook       # run Storybook (HTML + Vite)

Usage

npm install @42/core @42/styles
<div data-c42-accordion>
  <div data-c42-accordion-item data-value="a">
    <button data-c42-accordion-trigger>Title</button>
    <div data-c42-accordion-panel>Content</div>
  </div>
</div>
import { Accordion } from '@42/core/accordion';
import '@42/styles/accordion.css'; // optional theme

const acc = new Accordion(document.querySelector('[data-c42-accordion]')!, { multiple: false });
acc.on('accordion:change', (e) => console.log(e.detail.value));

Form validation

The Form controller turns native inputs into a validated, accessible form (ARIA wiring, error states, typed events) without imposing styles:

<form data-c42-form>
  <div data-c42-field>
    <label for="email">Email</label>
    <input id="email" name="email" type="email" data-c42-validate="required email" />
    <span data-c42-field-error hidden></span>
  </div>
  <button type="submit">Sign up</button>
</form>
import { Form } from '@42/core/form';
import '@42/styles/form.css'; // optional theme

const form = new Form(document.querySelector('[data-c42-form]')!, { mode: 'blur' });
form.on('form:submit', (e) => console.log(e.detail.values)); // only fires when valid
form.on('form:invalid', (e) => console.log(e.detail.errors));

See docs/llm/form.md for rules, options and recipes.

Theming

Import @42/styles for the complete theme. Customize by overriding primitives:

:root {
  --c42-primary-500: #0ea5e9;
  --c42-primary-600: #0284c7;
}

Dark mode activates automatically via prefers-color-scheme or with data-theme="dark" on <html>.

The full theme also applies a thin, subtle global scrollbar (tunable via --c42-scrollbar-size / --c42-scrollbar-thumb / --c42-scrollbar-thumb-hover, or import @42/styles/scrollbar.css standalone).

AI agents

See LLM.md for the complete component reference optimized for AI consumption.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
0.0.2Registry latest30 Jun 202621
0.0.129 Jun 202620
0.0.023 Jun 202620

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:59 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:637a3364c47520fddb6fb7845403162dba3d1b3c60ac4528d080e07ed362b509