Skip to content

feat(ui): add interactive spreadsheet component mo.ui.spreadsheet usi…#10008

Open
RaphJean wants to merge 8 commits into
marimo-team:mainfrom
RaphJean:feature/fortune-sheet-spreadsheet
Open

feat(ui): add interactive spreadsheet component mo.ui.spreadsheet usi…#10008
RaphJean wants to merge 8 commits into
marimo-team:mainfrom
RaphJean:feature/fortune-sheet-spreadsheet

Conversation

@RaphJean

@RaphJean RaphJean commented Jun 26, 2026

Copy link
Copy Markdown

…ng FortuneSheet

## 📝 Summary                     
                                  
This PR integrates                

FortuneSheet (an open-source
React/TypeScript Excel-clone engine)
into the marimo notebook ecosystem
as an advanced, reactive UI widget:
mo.ui.spreadsheet.

It supports bidirectional syncing:
- **Backend → Frontend:**         

Serializes Pandas or Polars
DataFrames into memory-efficient CSV
URLs served by the kernel, along
with type metadata.
- Frontend → Backend:
Translates the edited sheet grid
into a row-oriented JSON array.
- Strict Data Integrity: Casts
cell values back to their original
dtypes (e.g., integers, floats,
dates, datetimes, booleans) on the
kernel before reconstructing the
DataFrame.

### Changes Made:                 
- **Backend (`marimo/`):**        
  - Created                       

marimo/_plugins/ui/_impl/spreadsheet. py implementing the spreadsheet
class extending UIElement.
- Registered spreadsheet in
the main marimo.ui package exports.
- Frontend (frontend/):
- Installed @fortune- sheet/react.
- Created SpreadsheetPlugin. tsx and workbook-wrapper.tsx
supporting:
- Lazy loading the workbook to
maintain fast initial page load
speeds.
- Dynamic headers mapping
DataFrame column names to Row 0 of
the sheet.
- Freezing the column headers
row (config.frozen.range.row_focus = 1).
- Explicit isLoading checks
to wait for async CSV data to finish
parsing before mounting FortuneSheet
(preventing empty sheets).
- Tests & Examples:
- Added a reactive smoke test
notebook at
marimo/_smoke_tests/spreadsheet_test. py.
- Added a detailed user example
notebook at examples/ui/spreadsheet. py showcasing real-time
recalculations of total items and
inventory values.

## 📋 Pre-Review Checklist        

- [ ] For large changes, or       

changes that affect the public API:
this change was discussed or
approved through an issue, on
[Discord](https://marimo.
io/discord?ref=pr), or the community
[discussions](https://github.
com/marimo-team/marimo/discussions)
(Please provide a link if
applicable).
- [x] Any AI generated code has
been reviewed line-by-line by the
human PR author, who stands by it.
- [ ] Video or media evidence is
provided for any visual changes
(optional).

## ✅ Merge Checklist             

- [x] I have read the [contributor

guidelines](https://github.
com/marimo-
team/marimo/blob/main/CONTRIBUTING.
md).
- [x] Documentation has been
updated where applicable, including
docstrings for API changes.
- [x] Tests have been added for
the changes made.

Review in cubic

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jun 27, 2026 8:39am

Request Review

@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@RaphJean RaphJean force-pushed the feature/fortune-sheet-spreadsheet branch from eec6e2b to 23ecf4f Compare June 27, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant