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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tempots/ui

v14.0.0

Published

Provides a higher level of renderables to help fast development with Tempo.

Downloads

549

Readme

Tempo UI (@tempots/ui)

A collection of reusable UI components and renderables built on top of @tempots/dom to accelerate development with Tempo. This package provides higher-level abstractions for common UI patterns and components.

npm version license

Installation

# npm
npm install @tempots/dom @tempots/std @tempots/ui

# yarn
yarn add @tempots/dom @tempots/std @tempots/ui

# pnpm
pnpm add @tempots/dom @tempots/std @tempots/ui

Note: @tempots/dom and @tempots/std are peer dependencies and must be installed alongside @tempots/ui.

Features

UI Components

The library provides a set of reusable UI components:

import { html, render } from '@tempots/dom'
import { AutoFocus, AutoSelect, InViewport } from '@tempots/ui'

// Create an input that automatically gets focus
const focusedInput = html.input(
  AutoFocus(), // Automatically focus this input when rendered
  AutoSelect()  // Automatically select all text when focused
)

// Create an element that detects when it's in the viewport
const lazyLoadedContent = InViewport(
  {}, // Options for intersection observer
  (isVisible) => isVisible.value
    ? html.div('Content is visible!')
    : html.div('Loading...')
)

render(html.div(focusedInput, lazyLoadedContent), document.body)

Routing

The library includes a simple but powerful routing system:

import { render } from '@tempots/dom'
import { Router, Location } from '@tempots/ui'

const AppRouter = Router({
  '/': () => html.div('Home Page'),
  '/about': () => html.div('About Page'),
  '/users/:id': (info) => {
    // Access route parameters
    const userId = info.$.params.$.id
    return html.div('User Profile: ', userId)
  },
  '*': () => html.div('404 - Not Found')
})

render(AppRouter, document.body)

// Navigate programmatically
Location.navigate('/about')

Query Loading

Handle async data loading with built-in loading and error states:

import { html, prop, render } from '@tempots/dom'
import { Query } from '@tempots/ui'

// Load data from an API
const userId = prop(1)

const userProfile = Query({
  request: userId,
  load: async ({ request, abortSignal }) => {
    const response = await fetch(`/api/user/${request}`, { signal: abortSignal })
    if (!response.ok) throw new Error('Failed to load user')
    return response.json()
  },
  mapError: error => error instanceof Error ? error.message : String(error),
})({
  loading: () => html.div('Loading user...'),
  failure: error => html.div(error.map(message => `Error: ${message}`)),
  success: user => html.div(
    html.h2(user.map(u => u.name)),
    html.p(user.map(u => u.email)),
  ),
})

render(userProfile, document.body)

PopOver with Arrow Support

Create floating popover elements with optional arrow indicators:

import { html, render, prop, on, attr } from '@tempots/dom'
import { PopOver } from '@tempots/ui'

function TooltipExample() {
  const showTooltip = prop(false)

  return html.div(
    html.button(
      on.mouseenter(() => showTooltip.value = true),
      on.mouseleave(() => showTooltip.value = false),
      'Hover me',
      PopOver({
        open: showTooltip,
        placement: 'top',
        content: () => html.div(
          { style: 'padding: 8px; background: white; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);' },
          'This is a tooltip with an arrow!'
        ),
        arrow: {
          padding: 4,
          content: html.div(
            attr.class('tooltip-arrow'),
            attr.style('background: white; border: 1px solid #ccc; transform: rotate(45deg); width: 8px; height: 8px;')
          )
        }
      })
    )
  )
}

Form Helpers

Simplify form input handling:

import { html, render, prop } from '@tempots/dom'
import { SelectOnFocus, AutoSelect } from '@tempots/ui'

function LoginForm() {
  const username = prop('')
  const password = prop('')

  return html.form(
    html.div(
      html.label('Username'),
      html.input(
        AutoFocus(),
        SelectOnFocus(),
        attr.value(username),
        on.input(e => username.set(e.target.value))
      )
    ),
    html.div(
      html.label('Password'),
      html.input(
        attr.type('password'),
        attr.value(password),
        on.input(e => password.set(e.target.value))
      )
    ),
    html.button('Login')
  )
}

Available Components

The library includes the following components and utilities:

  • AutoFocus - Automatically focus an element
  • AutoSelect - Automatically select text in an input
  • SelectOnFocus - Select all text when an input is focused
  • InViewport - Detect when an element is in the viewport
  • Router - Simple client-side routing
  • Location - Navigation and location utilities
  • Query - Async data loading with loading/error states
  • AsyncResultView - Display async operation results
  • ResultView - Display success/failure results
  • PopOver - Create popup/popover elements
  • And more...

Documentation

For comprehensive documentation, visit the Tempo Documentation Site.

License

This package is licensed under the Apache License 2.0.