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

@sometic/dom

v3.0.2

Published

DOM engines (button/input controllers, portal, scroll lock, observers) used by Sometic adapters and elements.

Readme

@sometic/dom

Framework-neutral DOM engines (controllers, view models, and bind helpers) that power Sometic adapters and custom elements.

@sometic/dom is the shared behavior layer for buttons, fields, inputs, selection controls, overlays, navigation structure, and feedback surfaces. It does not ship a visual design system. Controllers and resolvers produce view models, native-friendly attributes, and slot class/style maps so React, Vue, Vanilla, and Web Components can render the same behavior with their own markup.

Sometic keeps portable application behavior out of framework packages. Framework adapters stay thin and call into these engines instead of reimplementing press handling, field IDs, controlled input state, dialog focus, or toast queues per UI library. That split is why one accessibility and interaction model can travel across stacks without forking business logic.

Standout capabilities include resolve helpers (resolveButton, resolveField, resolveDialog), bind helpers for Vanilla (bindButton, bindInput, bindCheckbox, bindSelect), controllable controllers (createInputController, createDialogController, createTabsController, createToastQueue), and first-class slots/state attributes built on @sometic/styling and @sometic/accessibility. Prefer intentional subpaths such as @sometic/dom/button, @sometic/dom/field, @sometic/dom/input, and @sometic/dom/dialog so consumers only pull the surface they need.

In the ecosystem, this package sits above @sometic/core and is consumed by @sometic/react, @sometic/vue, and @sometic/elements. Read the product model in the introduction and the DOM overview at primitives/dom.

Install

pnpm add @sometic/dom
npm install @sometic/dom
yarn add @sometic/dom

Usage

Resolve a button view model (classes, attributes, loading/disabled press guards):

import { bindButton, resolveButton } from "@sometic/dom/button";

const view = resolveButton({
    type: "button",
    loading: false,
    disabled: false,
    defaults: { className: "btn" },
    variants: { className: "btn--primary" },
});

const button = document.querySelector("button");
if (button) {
    bindButton(button, () => ({
        type: "button",
        defaults: { className: "btn" },
    }));
}

Drive a dialog with a disposable controller and resolve its open-state view model:

import { createDialogController } from "@sometic/dom/dialog";

const dialog = createDialogController({
    defaultOpen: false,
    getContent: () => document.querySelector("#confirm-panel"),
    getTrigger: () => document.querySelector("#confirm-trigger"),
    onOpenChange: (open) => {
        console.log("dialog open", open);
    },
});

const view = dialog.resolve({ size: "md" });
dialog.setOpen(true);

Field and input subpaths compose the same way (@sometic/dom/field, @sometic/dom/input) for labels, described-by IDs, and controllable values without importing the full root barrel.

CDN

Docs: https://sometic.dev/primitives/dom.

Simple script

<script src="https://cdn.jsdelivr.net/npm/@sometic/[email protected]/dist/cdn/sometic-dom.iife.js"></script>
<script>
    const button = document.querySelector("button");
    if (button) {
        SometicDom.bindButton(button, () => ({ type: "button" }));
    }
</script>

Module script

<script type="module">
    import { bindButton } from "https://cdn.jsdelivr.net/npm/@sometic/[email protected]/dist/cdn/sometic-dom.esm.js";

    const button = document.querySelector("button");
    if (button) {
        bindButton(button, () => ({ type: "button" }));
    }
</script>

Peers / when not to use

There are no framework peer dependencies. Runtime deps include @sometic/core, @sometic/accessibility, @sometic/styling, @sometic/positioning, and @sometic/date-core (for date input engines).

Skip @sometic/dom when you only need foundation primitives (@sometic/core) or a framework component package and never plan to call engines yourself. Prefer @sometic/elements or framework adapters if you want ready-made tags/components rather than binding controllers by hand.

Docs

License

MIT