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

tgc

v0.1.4

Published

A reusable Vue 3 component library

Readme

TGC - Vue 3 Component Library

A reusable Vue 3 component library built with TypeScript and documented with Storybook.

Features

  • ✅ Vue 3 with TypeScript
  • ✅ Vite for fast development and optimized builds
  • ✅ Storybook for component documentation and development
  • ✅ Full TypeScript type definitions
  • ✅ Ready to publish to npm or use locally
  • ✅ Tree-shakeable ES modules

Installation

All dependencies are already installed. If you need to reinstall:

npm install

Development

Running Storybook

Storybook provides an interactive UI for developing and testing components:

npm run storybook

This will start Storybook at http://localhost:6006

Development Mode (Vite)

Run the Vite dev server:

npm run dev

Building the Library

To build the library for distribution:

npm run build

This will:

  • Compile all components
  • Generate TypeScript declaration files (.d.ts)
  • Create ES and UMD bundles in the dist/ directory
  • Output: dist/tgc.es.js, dist/tgc.umd.js, dist/tgc.css, and type definitions

Build Storybook

To build a static version of Storybook for deployment:

npm run build-storybook

Output will be in storybook-static/ directory.

Usage in Other Projects

Method 1: Link Locally (Development)

  1. In this library directory, create a global link:
npm link
  1. In your target Vue project:
npm link tgc
  1. Use the components:
<script setup lang="ts">
import { TButton, TCard } from 'tgc'
// Don't forget to import styles
import 'tgc/dist/style.css'
</script>

<template>
  <TButton variant="primary">Click Me</TButton>
  <TCard title="My Card" elevated>
    Card content here
  </TCard>
</template>

Method 2: Install from File Path

In your target project's package.json:

{
  "dependencies": {
    "tgc": "file:../path/to/tgc"
  }
}

Then run:

npm install

Method 3: Publish to npm

  1. Update version in package.json
  2. Build the library: npm run build
  3. Publish to npm:
npm publish

Or for scoped packages:

npm publish --access public
  1. Install in other projects:
npm install tgc

Method 4: Install Global Plugin

You can also install all components globally:

// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import TGC from 'tgc'
import 'tgc/dist/style.css'

const app = createApp(App)
app.use(TGC)
app.mount('#app')

Then use components without importing:

<template>
  <TButton>Click Me</TButton>
  <TCard title="My Card">Content</TCard>
</template>

Available Components

TButton

A customizable button component with multiple variants and sizes.

Props:

  • variant: 'primary' | 'secondary' | 'outline'
  • size: 'small' | 'medium' | 'large'
  • disabled: boolean

TCard

A flexible card component with header, body, and footer slots.

Props:

  • title: string (optional)
  • elevated: boolean (adds shadow)

Slots:

  • header: Custom header content
  • default: Card body content
  • footer: Footer content

Project Structure

tgc/
├── src/
│   ├── lib/                    # Library source code
│   │   ├── components/         # Component files
│   │   │   ├── TButton.vue
│   │   │   ├── TButton.stories.ts
│   │   │   ├── TCard.vue
│   │   │   └── TCard.stories.ts
│   │   └── index.ts           # Main entry point
│   ├── stories/               # Default Storybook examples
│   └── ...
├── dist/                      # Build output (generated)
├── .storybook/               # Storybook configuration
├── vite.config.ts            # Vite build configuration
├── tsconfig.lib.json         # TypeScript config for library
└── package.json

TypeScript Support

The library includes full TypeScript support with exported types:

import type { TButtonProps, TCardProps } from 'tgc'

Commands Reference

| Command | Description | |---------|-------------| | npm run dev | Start Vite dev server | | npm run build | Build the library | | npm run preview | Preview the Vite build | | npm run storybook | Start Storybook dev server | | npm run build-storybook | Build static Storybook | | npm link | Create global symlink for local development | | npm publish | Publish to npm registry |

Adding New Components

  1. Create component in src/lib/components/YourComponent.vue
  2. Create story file src/lib/components/YourComponent.stories.ts
  3. Export component in src/lib/index.ts
  4. Run Storybook to test: npm run storybook
  5. Build library: npm run build

License

MIT