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

ui-stories

v1.1.6

Published

Nuxt module for creating a component workshop

Downloads

1,999

Readme

UIStories

A Nuxt 4 module that turns *.story.vue files into a local component workshop: sidebar navigation, live previews, optional controls, code snippets (Shiki), and story metadata.

Install

pnpm add ui-stories

Setup

Add the module to nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['ui-stories'],
})

Place story files under your app srcDir (usually app/ or project root, depending on your Nuxt layout). The module discovers **/*.story.vue automatically.

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | enabled | boolean | true | Turn the workshop UI off without removing the module. | | route | string | '/stories' | Base path for the stories page (/stories/:id?). |

Example:

export default defineNuxtConfig({
  modules: ['ui-stories'],
  uiStories: {
    route: '/docs/components',
  },
})

Runtime config exposes public.uiStories.route for link generation inside the UI.

Writing a story

  1. Create a file named like MyWidget.story.vue next to your component (any depth under srcDir).
  2. Export storyMeta from a <script lang="ts"> block (build-time metadata).
  3. Use UIStoriesStory as the root and UIStoriesVariant for each example block.

Minimal example:

<script lang="ts">
export const storyMeta = {
  name: 'My widget',
  directory: ['Components'],
  description: 'Short description for the panel.',
  tags: ['Widget'],
}
</script>

<script setup lang="ts">
import MyWidget from './MyWidget.vue'
</script>

<template>
  <UIStoriesStory>
    <UIStoriesVariant title="Default">
      <MyWidget />
    </UIStoriesVariant>
  </UIStoriesStory>
</template>

Story metadata (storyMeta)

| Field | Required | Description | |-------|----------|-------------| | name | yes | Title in the sidebar. | | directory | yes | Folder segments for grouping (e.g. ['Components', 'Forms']). | | description | no | String or array of paragraphs in the content panel. | | figma | no | URL shown as a Figma link. | | tags | no | Labels for search/filtering. |

Interactive controls

Use useControls in <script setup> to drive props from the controls panel (text, boolean, select):

import { useControls } from 'ui-stories/runtime/utils'

const controls = useControls({
  label: { type: 'text', default: 'Hello' },
  disabled: { type: 'boolean', default: false },
  size: {
    type: 'select',
    options: ['sm', 'md', 'lg'],
    default: 'md',
  },
})

Bind controls.label.value, controls.size.value, etc. in your template.

Story URL

Each file gets an id from its path: slashes become --, and the .story.vue suffix is removed.

Example: app/components/Badge.story.vue → id components--Badge
/stories/components--Badge (with default route).

Module behavior

  • Registers runtime components with the UIStories prefix (e.g. UIStoriesStory, UIStoriesVariant, UIStoriesSidebar).
  • Ignores *.story.vue in Nuxt’s component auto-import scan so they are only used as stories.
  • Injects shared UI styles (uis.css) and theme CSS variables (--uis-*).

Variant resize

Drag the resize handles to adjust the preview size. Preset width buttons snap cleanly to the current measured width.

Variant resize

Themes

Switch between themes to preview your components in different color schemes.

Themes

Development (this repo)

pnpm install
pnpm run prepack    # build the module into dist/
pnpm run play-dev   # playground dev server