Table Minimap

v...

Tired of explaining to your boss why having too many columns in a table isn't a good idea? Give him Table-Minimap so he'll leave you alone. A framework-agnostic minimap for navigating large HTML tables. Like VS Code's minimap - but for tables.

Weekly npm downloads: Loading...

Columns Mode

Top / Bottom Position

Simple column-based visualization. Toggle between top and bottom position.

Scroll Position

0%

Mode

Columns

Fixed Position

Floating Overlay

Minimap floats in a configurable corner over the table. Double-click the minimap to move it to the next corner.

Scroll Position

0%

Compact Fixed Position

Hideable Dot

A smaller floating minimap that collapses into a translucent dot in a configurable corner. Click it to expand, or double-click it to move it to the next corner.

Scroll Position

0%

Mode

Compact

Canvas Mode

Real Text + Zoom Mobile Support

Renders actual table content! Scroll wheel to zoom. Click to select one column, Shift+Click to select a range, Cmd/Ctrl+Click to add or remove individual columns. Right-click a selected column to apply menu actions to the selection. Full mobile support: pinch-to-zoom and double-tap for context menu.

Scroll Position

0%

Zoom Level

1.0x

Installation

# npm
npm install table-minimap

# yarn
yarn add table-minimap

# pnpm
pnpm add table-minimap

Options

Option Type Default Description
Core Options
mode 'columns' | 'canvas' 'columns' Rendering mode
height number 40 Height in pixels
position 'top' | 'bottom' | 'fixed' 'bottom' Position: top/bottom of table, or fixed overlay
draggable boolean true Enable drag navigation on viewport
showViewport boolean true Show the viewport indicator
Fixed Position Options
fixedWidth number 300 Width when position is 'fixed'
fixedPosition 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' 'bottom-right' Corner when position is 'fixed'; double-click to cycle
compact boolean false Collapse into dot handle, expand on hover/click
Zoom Options (Canvas Mode)
zoomable boolean false Enable scroll wheel / pinch-to-zoom
minZoom number 1 Minimum zoom level (1 = full overview)
maxZoom number 10 Maximum zoom level
zoomSpeed number 0.1 Zoom speed multiplier
Canvas Context Menu
canvasClipboard boolean false Enable "Copy column to clipboard" context menu
canvasClipboardLabel string 'Copy column to clipboard' i18n label for clipboard action
canvasColumnMarking boolean false Enable mark/unmark column in context menu
canvasMarkColumnLabel string 'Mark column' i18n label for mark action
canvasUnmarkColumnLabel string 'Unmark column' i18n label for unmark action
canvasUnmarkAllColumnsLabel string 'Unmark all columns' i18n label for unmark-all action
canvasColumnHiding boolean false Enable collapse/expand column in context menu
canvasColumnSelection boolean false Enable click, Shift+Click and Cmd/Ctrl+Click column selection
canvasHideColumnLabel string 'Collapse column' i18n label for collapse action
canvasShowColumnLabel string 'Expand column' i18n label for expand action
canvasShowAllColumnsLabel string 'Expand all columns' i18n label for expand-all action
collapsedColumnWidth number 10 Width in pixels for collapsed columns
State & Callbacks
markedColumns number[] [] Initially marked column indices
hiddenColumns number[] [] Initially collapsed column indices
onMarkedColumnsChange (details) => void - Callback when marked columns change
onHiddenColumnsChange (details) => void - Callback when collapsed columns change
selectedColumns number[] [] Initially selected column indices
onSelectedColumnsChange (details) => void - Callback when selected columns change

API Methods

Method Description
Core Methods
destroy() Remove minimap and cleanup all event listeners
refresh() Force re-render after table content changes
scrollToColumn(index) Scroll table to bring specific column into view
Zoom Methods (Canvas Mode)
getZoomState() Get current zoom level and state info
setZoom(level, panX?) Set zoom level programmatically with optional pan position
resetZoom() Reset to full table overview (zoom 1x)
zoomToColumns(start, end) Zoom to show a specific column range
Column Marking Methods
getMarkedColumns() Get array of marked column indices
setMarkedColumns(indices) Replace all marked columns programmatically
clearMarkedColumns() Clear all marked columns
Column Collapsing Methods
getHiddenColumns() Get array of collapsed column indices
setHiddenColumns(indices) Replace all collapsed columns with dark overlay
clearHiddenColumns() Expand all collapsed columns
Column Selection Methods
getSelectedColumns() Get array of selected column indices
setSelectedColumns(indices) Replace all selected columns programmatically
clearSelectedColumns() Clear all selected columns