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

@trmnl/picker

v0.1.3

Published

Vanilla JavaScript library for TRMNL device model and palette selection

Readme

@trmnl/picker

A lightweight JavaScript library for managing TRMNL device model and palette selection.

It's used by the core TRMNL web app, trmnlp, BYOS (Bring Your Own Server) applications, and anybody else who needs it.

Screenshot

Live Demo

Try the interactive demo at https://usetrmnl.github.io/trmnl-picker/example/

API Reference

See the API documentation for complete information.

Installation

NPM

npm install @trmnl/picker

Browser (CDN)

<script src="https://unpkg.com/@trmnl/picker@latest/dist/trmnl-picker.min.js"></script>

Browser (Local)

<script src="dist/trmnl-picker.min.js"></script>

Quick Start

1. Create HTML Structure

The library expects a form with specific data-* attributes. Apply your favorite CSS styling framework as desired.

<form id="picker-form">
  <!-- Required: Model selector -->
  <select data-model-select></select>

  <!-- Required: Palette selector -->
  <select data-palette-select></select>

  <!-- Optional: Orientation toggle -->
  <button type="button" data-orientation-toggle>
    <span data-orientation-text>Landscape</span>
  </button>

  <!-- Optional: Dark mode toggle -->
  <button type="button" data-dark-mode-toggle>
    <span data-dark-mode-text>Light Mode</span>
  </button>

  <!-- Optional: Reset button -->
  <button type="button" data-reset-button>Reset</button>
</form>

<!-- The screen element to be modified -->
<div class="screen">
  <div class="view view--full">
    <!-- Your screen's content goes here -->
  </div>
</div>

2. Initialize Picker

const picker = await TRMNLPicker.create('picker-form', {
  localStorageKey: 'my-trmnl-picker-state' // optional: persist user selection in localStorage
})

3. Listen for Changes

document.getElementById('picker-form').addEventListener('trmnl:change', (event) => {
  const { origin, screenClasses, model, palette, isDarkMode, isPortrait } = event.detail

  document.querySelectorAll('.screen').forEach(screen => {
    screen.className = screenClasses.join(' ')
    executeTerminalize() // from Framework plugin.js
  })
})

Development

# Install dependencies
npm install

# Build all formats
npm run build

# Build and watch for changes
npm run watch

# Build specific formats
npm run build:esm        # ES module
npm run build:browser    # IIFE browser bundle
npm run build:browser:min # Minified browser bundle

# Build docs
npm run build:docs

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Support

For issues and questions, please use the GitHub issue tracker.