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

datocms-plugin-dropdown-conditional-fields-v2

v2.0.4

Published

Conditionally show or hide fields based on a dropdown selection. Visual rule editor included — no JSON required.

Readme

Dropdown Conditional Fields — DatoCMS Plugin

Cover

Conditionally show or hide fields in your DatoCMS record forms based on the selected value of a dropdown field. Ships with a visual rule editor — no raw JSON required.

Fork notice: This plugin is based on the original datocms-plugin-dropdown-conditional-fields by John DeWyze. It has been rewritten from scratch for the modern DatoCMS Plugin SDK (v2), migrated from Webpack to Vite, converted to React + TypeScript, and extended with a visual configuration UI. Thank you, John, for the original idea and implementation!


How It Works

  1. A dropdown (select) field acts as the trigger.
  2. You define rules: for each possible dropdown value, you choose which other fields in the same model should be visible.
  3. All fields managed by the plugin but not matching the current dropdown value are automatically hidden.

Setup Guide

1. Create the Trigger Field

In your DatoCMS model, create a Single-line string field (e.g. category).

Under Presentation, set the editor to "Select input" and add your dropdown options (e.g. Blog, Product, Event).

2. Install the Plugin

Install from the DatoCMS Marketplace or add it as a private plugin under Settings > Plugins.

3. Attach the Plugin to Your Field

Open the trigger field settings and go to the Presentation tab. Under Field Add-ons, click "Add" and select "Dropdown Conditional Fields".

4. Configure the Rules

After adding the addon, a visual rule editor will appear:

Settings

  • Click "+ Add new rule" to add a rule.
  • If the field has enum validators, pick the dropdown value from the list. Otherwise, type the exact value.
  • Select the fields to show — all other fields in the model are available for selection.
  • Add as many rules as you need.

Example: If your dropdown has values Blog, Product, and Event:

| Dropdown Value | Visible Fields | | -------------- | ----------------------- | | blog | author, content | | product | price, availability | | event | date, location |

Fields not assigned to the currently selected value will be hidden automatically.

5. Global Settings (Optional)

In the plugin settings, you can enable Debug Mode to log visibility changes to the browser console — helpful during setup.

Development

Prerequisites

  • Node.js (LTS)
  • npm

Getting Started

npm install
npm run dev

The dev server starts at http://localhost:5175/. Enter this URL as the plugin Entry point URL in DatoCMS.

Available Scripts

| Command | Description | | ------------------ | ------------------------- | | npm run dev | Start Vite dev server | | npm run build | Type-check and build | | npm run preview | Preview production build | | npm run lint | Lint with ESLint | | npm test | Run unit tests (Vitest) | | npm run test:watch | Run tests in watch mode |

Tech Stack

  • DatoCMS Plugin SDK v2.1 + datocms-react-ui v2.1
  • React 19 + TypeScript 5
  • Vite 6 (build + dev server)
  • Vitest (unit testing)

Publishing

Build for production:

npm run build

Then publish to npm:

npm publish

The plugin will appear in the DatoCMS Marketplace within one hour.

Alternatively, deploy the dist/ folder to any static hosting provider and use the URL as a private plugin entry point.

License

ISC