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

storybook-cookie-manager

v1.2.0

Published

Addon for managing cookies in Storybook

Downloads

31

Readme

🚀 storybook-cookie-manager 🍪

Storybook Cookie Manager Demo

Unlock seamless cookie management and documentation directly within your Storybook environment with storybook-cookie-manager. This powerful addon provides a dedicated panel to view, edit, and clear cookies, along with a <CookieDocs /> component to automatically generate documentation for your components' cookie dependencies in MDX.

With storybook-cookie-manager, you can streamline your development workflow, improve component testing, and maintain crystal-clear documentation with minimal effort.

Compatible with Storybook 9+


Core Features

  • 🍪 Cookie Management Panel: An integrated Storybook panel to add, edit, and clear cookies on the fly.
  • 📚 Automated Cookie Documentation: Use the <CookieDocs /> component in your .mdx files to display beautiful, automated documentation for the cookies your components rely on.

Installation

First, install the addon using your preferred package manager:

npm install storybook-cookie-manager --save-dev

or

yarn add storybook-cookie-manager --dev

Configuration

Next, register storybook-cookie-manager in your Storybook configuration file (.storybook/main.js or .storybook/main.ts).

export default {
  stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: [
    // Other addons...
    getAbsolutePath('storybook-cookie-manager'),
  ],
}

Usage

storybook-cookie-manager shines in two key areas: managing cookies during development and documenting them.

1. Managing Cookies in your Stories

To define cookies for a component, use the parameters.cookies property in your story file. This will populate the storybook-cookie-manager panel, allowing you to interact with the cookies.

Here’s an example of how to define cookies for a Button component:

const meta: Meta<typeof Button> = {
  title: 'Example/Button',
  component: Button,
  parameters: {
    cookies: {
      user_preference: 'dark_mode',
      session_id: 'abc-123-xyz-456',
    },
    cookieDocs: [
      {
        name: 'user_preference',
        defaultValue: 'dark_mode',
        description: 'Stores the user theme preference.',
      },
      {
        name: 'session_id',
        defaultValue: 'abc-123-xyz-456',
        description: 'The unique identifier for the user session.',
      },
    ],
  },
}

2. Documenting Cookies with <CookieDocs />

For documentation pages (.mdx), storybook-cookie-manager provides a <CookieDocs /> component that automatically pulls the cookie definitions from your stories and renders them in a clean, readable format.

Simply import CookieDocs from storybook-cookie-manager and point it to the story you want to document.

import * as ButtonStories from './button.stories'
import { CookieDocs } from 'storybook-cookie-manager'

<CookieDocs of={ButtonStories.ButtonWithCookies} />

This will generate a table listing the user_preference and session_id cookies, including their names and descriptions, right on your documentation page.


Contributing

Contributions are welcome! If you have ideas for new features, bug fixes, or improvements, please open an issue or submit a pull request.

License

storybook-cookie-manager is licensed under the MIT License.