Skip to content

feat: add gutter ribbon layout to CellContainer#140

Merged
rgbkrk merged 3 commits intomainfrom
rgbkrk/gutter-ribbon
Feb 12, 2026
Merged

feat: add gutter ribbon layout to CellContainer#140
rgbkrk merged 3 commits intomainfrom
rgbkrk/gutter-ribbon

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Feb 12, 2026

Summary

Implements a gutter ribbon system for CellContainer that creates a cleaner, paper-like notebook aesthetic. A thin colored ribbon on the left side indicates cell type and focus state.

This is a breaking change - the old border-based focusBgColor/focusBorderColor props are removed. In the shadcn model, users vendor the code, so breaking changes are acceptable when they simplify the API.

Changes

  • gutter-colors.ts (NEW): Extensible color configuration with defaults for code (gray), markdown (amber), sql (blue), ai (purple), and raw (rose)
  • CellContainer: cellType is now required; gutter ribbon is the only mode
  • PlayButton: gutterMode prop for smart visibility (hidden unfocused, visible on focus/hover)
  • Demos & Documentation: Updated to reflect the new API

API

<CellContainer
  id={cell.id}
  cellType="code"                    // Required - determines ribbon color
  isFocused={isFocused}
  gutterContent={<PlayButton gutterMode ... />}
>
  {children}
</CellContainer>

Test Plan

  • Run pnpm dev and navigate to /docs/cell/cell-container
  • Verify gutter demos work and ribbon colors are correct
  • Test play button visibility (hidden unfocused, visible on focus/hover)
  • Confirm dark mode colors render appropriately

Closes #139

Implement a new gutter ribbon system that provides a cleaner, paper-like aesthetic for notebook cells. Instead of heavy borders, cells now display a thin colored ribbon on the left side that indicates cell type (code, markdown, sql, ai, raw) and focus state.

- Create gutter-colors.ts with extensible color configuration
- Add cellType, gutterContent, and customGutterColors props to CellContainer
- Add gutterMode prop to PlayButton for smart visibility
- Maintain full backwards compatibility with legacy border-based styling
- Add GutterCellDemo and GutterNotebookDemo components
- Update documentation with new gutter mode examples

Closes #139
@vercel
Copy link

vercel bot commented Feb 12, 2026

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

Project Deployment Actions Updated (UTC)
nteract-elements Ready Ready Preview, Comment Feb 12, 2026 9:31pm

Request Review

Remove legacy border-based styling in favor of gutter ribbon as the only
mode. This is a breaking change that simplifies the API:

- cellType is now required (was optional)
- Remove focusBgColor and focusBorderColor props
- All demos updated to use gutter mode consistently
- Documentation updated to reflect the simpler API

Breaking changes are appropriate for shadcn-style components since users
vendor the code and can adapt as needed when pulling updates.
@rgbkrk rgbkrk merged commit 8a48faf into main Feb 12, 2026
5 checks passed
@rgbkrk rgbkrk deleted the rgbkrk/gutter-ribbon branch February 12, 2026 21:34
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.

Add gutter ribbon layout to CellContainer

1 participant