Skip to content

Instantly share code, notes, and snippets.

View zptr1's full-sized avatar

yui zptr1

View GitHub Profile
@zptr1
zptr1 / README.md
Last active July 3, 2026 11:02
A small type-safe framework for creating DOM objects

This mini-framework lets you create DOM objects in a very convenient way, and has a simple selector parser in TypeScript types to ensure type hints.

Example

const makeUser = (user: User) => _("div.user",
  _("img.avatar", {
    // This object has properties from HTMLImageElement, as inferred from the selector
    src: user.avatarURL,