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

@gersak/ty

v0.1.917

Published

Ty Web Components - Framework-agnostic UI components with semantic design system

Readme

@gersak/ty

TypeScript web components for universal UI development.

Installation

npm install @gersak/ty

Usage

Import All Components

import '@gersak/ty'

// Or with React
import { TyButton, TyModal, TyInput } from '@gersak/ty'

Import Individual Components (Tree-Shaking)

import '@gersak/ty/button'
import '@gersak/ty/modal'
import '@gersak/ty/input'

Use in HTML

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="path/to/ty.css">
</head>
<body class="ty-canvas">
  
  <ty-button flavor="primary">Click Me</ty-button>
  
  <ty-input placeholder="Enter text..."></ty-input>
  
  <ty-modal id="my-modal">
    <div class="ty-elevated p-6 rounded-lg">
      <h2>Modal Content</h2>
    </div>
  </ty-modal>

  <script type="module">
    import '@gersak/ty'
    
    const modal = document.getElementById('my-modal')
    modal.show()
  </script>
</body>
</html>

Available Components

  • ty-button - Button with multiple flavors (primary, secondary, success, danger, warning)
  • ty-modal - Modal dialog with backdrop, ESC key, focus trap
  • ty-input - Input field with validation, number formatting
  • ty-dropdown - Dropdown with positioning, keyboard navigation
  • ty-checkbox - Checkbox with form integration
  • ty-textarea - Textarea with auto-resize
  • ty-popup - Popup positioning system
  • ty-tooltip - Tooltip with hover/focus triggers
  • ty-tag - Tag with removable state
  • ty-option - Option for dropdown/multiselect
  • ty-icon - Icon with registry system
  • ty-copy - Copy-to-clipboard field for API keys, tokens, URLs
  • ty-calendar - Full calendar with navigation and date selection
  • ty-calendar-month - Month view component
  • ty-calendar-navigation - Calendar navigation controls
  • ty-date-picker - Date picker with calendar popup
  • ty-multiselect - Multi-select dropdown with tags

Development

Setup

cd packages/core
npm install

Development Server

npm run dev

Opens development server at http://localhost:3000 with hot module reloading.

Build

npm run build

Builds optimized production bundles with type declarations.

Type Checking

npm run type-check

Preview Production Build

npm run preview

Project Structure

packages/core/
├── src/
│   ├── components/       # Web component implementations
│   ├── styles/          # Component styles
│   ├── utils/           # Utility functions
│   ├── types/           # TypeScript type definitions
│   └── index.ts         # Main entry point
├── dev/
│   ├── index.html       # Development test page
│   └── ty.css          # Symlink to resources/ty.css
├── dist/                # Build output
├── vite.config.ts       # Vite configuration
├── tsconfig.json        # TypeScript configuration
└── package.json

TypeScript Support

Full TypeScript support with type declarations:

import { TyButton, TyModal, type TyButtonElement } from '@gersak/ty'
import { registerIcons } from '@gersak/ty/icons/registry'

// Icons are in separate @gersak/ty-icons package (optional)
// npm install @gersak/ty-icons
// import { check, heart } from '@gersak/ty-icons/lucide'
// registerIcons({ check, heart })

// Or register your own SVG icons:
registerIcons({
  'my-icon': '<svg>...</svg>'
})

const button: TyButtonElement = document.querySelector('ty-button')!
button.flavor = 'primary'
button.addEventListener('ty-click', (e) => {
  console.log('Clicked:', e.detail)
})

Icon System

The core package includes the icon registry utility but not the icon libraries themselves (to keep package size small).

Option 1: Use the separate icon package (coming soon):

npm install @gersak/ty-icons
import { check, heart, star } from '@gersak/ty-icons/lucide'
import { registerIcons } from '@gersak/ty/icons/registry'

registerIcons({ check, heart, star })

Option 2: Bring your own SVG icons:

import { registerIcons } from '@gersak/ty/icons/registry'

registerIcons({
  'check': '<svg xmlns="http://www.w3.org/2000/svg">...</svg>',
  'custom-logo': '<svg>...</svg>'
})

Option 3: Use the global API:

<script src="https://cdn.jsdelivr.net/npm/@gersak/ty/dist/ty.js"></script>
<script>
  window.tyIcons.register({
    'check': '<svg>...</svg>',
    'heart': '<svg>...</svg>'
  })
  
  console.log(window.tyVersion)              // '0.2.0'
  console.log(window.tyIcons.has('check'))   // true
  console.log(window.tyIcons.list())         // ['check', 'heart']
</script>

Why separate packages?

  • Core package stays lightweight (~2.6MB)
  • Install icons only if you need them
  • Or use your own custom SVG icons

Browser Support

  • All modern browsers (Chrome, Firefox, Safari, Edge)
  • Web Components (Custom Elements, Shadow DOM)
  • ES2020+

Zero Dependencies

This package has zero runtime dependencies. Everything is built on native web standards.

License

MIT