Add use-case driven examples #1097
Opentannerlinsleywants to merge 1 commit into
main fromclaude/use-case-driven-examples-zgdZGopened piecyk reviewed
@@ -0,0 +97,21 @@97+ <strong>Fixed mode:</strong> All items have the same fixed height (35px).98+ Best performance, use when all items are identical height.99+ </>100+ )}101+ {sizingMode === 'variable' && (102+ <>103+ <strong>Variable mode:</strong> Each item has a known but different height.104+ Heights are pre-computed, not measured at runtime.105+ </>106+ )}107+ </p>108+109+ <div110+ ref={parentRef}111+ className="List"112+ style={{113+ height: 400,114+ width: '100%',115+ maxWidth: 600,116+ overflowY: 'auto',117+ contain: 'strict',@@ -0,0 +99,21 @@99+ Best performance, use when all items are identical width.100+ </>101+ )}102+ {sizingMode === 'variable' && (103+ <>104+ <strong>Variable mode:</strong> Each item has a known but different width.105+ Widths are pre-computed, not measured at runtime.106+ </>107+ )}108+ </p>109+110+ <div111+ ref={parentRef}112+ className="List"113+ style={{114+ height: 150,115+ width: '100%',116+ maxWidth: 800,117+ overflowX: 'auto',118+ overflowY: 'hidden',119+ contain: 'strict',@@ -0,0 +139,21 @@139+ <strong>Fixed mode:</strong> All cells have the same dimensions140+ (35px height, 100px width). Best performance for uniform grids.141+ </>142+ )}143+ {sizingMode === 'variable' && (144+ <>145+ <strong>Variable mode:</strong> Each row/column has pre-computed146+ dimensions. Use when sizes are known but vary per row/column.147+ </>148+ )}149+ </p>150+151+ <div152+ ref={parentRef}153+ className="List"154+ style={{155+ height: 500,156+ width: '100%',157+ maxWidth: 800,158+ overflow: 'auto',159+ contain: 'strict',@@ -0,0 +54,21 @@54+ overscan: 5,55+ })56+57+ // Column virtualizer58+ const columnVirtualizer = useVirtualizer({59+ horizontal: true,60+ count: columnCount,61+ getScrollElement: () => parentRef.current,62+ estimateSize: React.useCallback(63+ (index: number) => {64+ switch (sizingMode) {65+ case 'fixed':66+ return 10067+ case 'variable':68+ return variableColumnWidths[index]69+ case 'dynamic':70+ default:71+ return 12072+ }73+ },74+ [sizingMode],
Sign in to join this conversation.
⚠️ No Changeset found#
Latest commit: 079cf8f4fdb0c176a27e92bd732fae580f8be179
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