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

@geometra/core

v1.19.5

Published

DOM-free UI framework core: components, signals, reconciler

Readme

@geometra/core

DOM-free UI framework core. Build declarative interfaces rendered to Canvas, terminal, or server-streamed layouts.

Install

npm install @geometra/core

Key Exports

  • signal, computed, effect, batch -- reactive primitives
  • box, text, image -- element constructors
  • createApp -- application entry point
  • toSemanticHTML -- SEO-friendly HTML generation
  • toAccessibilityTree -- runtime accessibility tree from geometry
  • insertInputText, backspaceInput, deleteInput -- text-input editing primitives
  • getInputCaretGeometry -- caret x/y/height from measured text lines
  • createTextInputHistory, undoTextInputHistory -- undo/redo state helpers
  • transition, spring, createTweenTimeline, createPropertyTimeline, setMotionPreference -- animation utilities

Usage

import { box, text, createApp, signal } from '@geometra/core'

const count = signal(0)

const app = createApp(() =>
  box({ width: 300, height: 200, padding: 20, gap: 10 }, [
    text({ text: `Count: ${count.value}`, font: 'bold 24px sans-serif', lineHeight: 30 }),
    box({ width: 100, height: 40, backgroundColor: '#07f', onClick: () => count.set(count.peek() + 1) }, [
      text({ text: 'Click me', font: '16px sans-serif', lineHeight: 20, color: '#fff' }),
    ]),
  ])
)

Text input contract

  • TextInputState is immutable editor state: { nodes: string[], selection }.
  • selection is node-local and may be reversed; helpers normalize internally.
  • insertInputText/replaceInputSelection always collapse caret after replacement.
  • backspaceInput/deleteInput delete active selections first, then apply boundary merge behavior across nodes.
  • moveInputCaret supports range extension via extendSelection=true.
  • moveInputCaret and moveInputCaretByWord accept an optional reading direction (ltr default, rtl supported) for horizontal key semantics.
  • moveInputCaretToLineBoundary also accepts optional reading direction so Home/End semantics can follow visual direction in RTL contexts.
  • getInputCaretGeometry is defined for collapsed selections with measured line metrics; expanded ranges return null.

Direction model baseline

  • Elements may provide dir: 'ltr' | 'rtl' | 'auto' on box(), text(), and image() props.
  • dir='auto' currently inherits from parent direction (script-level auto detection is deferred).
  • Omitted dir inherits from parent; root fallback is ltr.
  • Direction metadata is kept in the declarative tree and intentionally stripped from Yoga layout props.

Accessibility guarantees and limits

  • toAccessibilityTree(tree, layout) emits deterministic role/name/bounds/focusable nodes for geometry-rendered UIs.
  • Semantic overrides (semantic.tag, semantic.role, semantic.ariaLabel, semantic.alt) are preserved when projecting accessibility and semantic HTML output.
  • The core package does not directly expose native accessibility APIs; renderer integrations (for example canvas mirror strategies) are responsible for host-level assistive technology bridging.

Links