Skip to content

Component storybook prototype - #59

Draft
aidenybai wants to merge 3 commits into
mainfrom
cursor/component-storybook-prototype-767a
Draft

Component storybook prototype#59
aidenybai wants to merge 3 commits into
mainfrom
cursor/component-storybook-prototype-767a

Conversation

@aidenybai

Copy link
Copy Markdown
Owner

Adds a Next.js component storybook prototype to scan and display React components with their state using bippy.

The implementation includes a standalone bippy-based scanner script and a Next.js UI. It handles large component trees by debouncing scans, filtering, and collapsing components by default to ensure a responsive user experience.


Open in Web Open in Cursor 

A Next.js app that scans all React components on the page using bippy
and displays them in a storybook-like panel showing:
- Component names with expand/collapse
- Props with serialized values
- Hooks state (useState values, etc.)
- Class component state
- Children components
- DOM bounding rects

Features:
- Live scanning via bippy's instrument() hook
- Debounced updates to avoid render loops
- Search/filter components by name
- Highlight overlay to outline components on the page
- Highlight-all mode
- Collapsible panel
- User/All component filter toggle
- Demo page with Counter, Toggle, UserCard, NotificationList

The scanner script (scripts/component-scanner.ts) is a standalone
module that uses bippy as an installed package.

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
@cursor

cursor Bot commented Mar 3, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot

changeset-bot Bot commented Mar 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd87022

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Mar 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bippy Ready Ready Preview, Comment Mar 4, 2026 2:38am

@pkg-pr-new

pkg-pr-new Bot commented Mar 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/bippy@59

commit: 9c8711b

A single self-contained JS file that can be pasted into any browser
console on any page with React components. Creates a storybook panel
that shows all components with their props, hooks, state, and bounds.

No dependencies required -- reads React fiber internals directly
from the page's __REACT_DEVTOOLS_GLOBAL_HOOK__ and DOM.

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
…rklet

Each component now shows when expanded:
- Visual frame: iframe rendering the component's actual DOM with
  page stylesheets, scaled to fit the preview area
- Tabbed interface: DOM | Props | Hooks | State | Bounds
- DOM tab: syntax-highlighted HTML tree of the component's DOM
- Props/Hooks/State tabs: key-value pairs
- Bounds tab: component dimensions and position

Also fixed click handling (stopPropagation on panel to prevent
host page event handlers from interfering).

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants