Widgets
SheetBot provides a variety of customizable widgets for displaying data in sheet cells. Widgets determine how data is rendered and interacted with in the web interface.
You can preview all available widgets by visiting the ‘Help’ page in SheetBot’s web interface, which includes a comprehensive widget gallery with examples.
Setting Up Widgets
Widgets are configured in a sheet’s columnstructure table. See Customizing your sheet for a worked example. Each column specifies:
widgettype: The widget name (e.g., “text”, “image”)minwidth/maxwidth: Width constraintsminheight/maxheight: Height constraintscolumnorder: Display orderdatatype: Data type hint
For multi-widgets, widgettype can be an array like ["multi", "text", "code"].
UI Interaction
Widgets are displayed in an HTML table interface that supports advanced interaction:
- Navigation: Use arrow keys to navigate between cells
- Selection: Click and drag to select multiple cells, or hold Shift while clicking to select ranges
- Copying: Press Ctrl+C to copy selected cells to clipboard. Copies the underlying data as plain text (tab-separated) or HTML table format, not the visual representation
- Multi-widgets: Right-click on cells with multiple widgets to access a context menu for switching between widget views (e.g., switching a script column from hash image to text display)
Text Widgets
Basic text display and formatting widgets.
text: Plain text displaytext-centered: Centered text display
Code & Data Widgets
Widgets for displaying code, JSON data, and structured information.
code: Syntax-highlighted code blocksjson-viewer: Interactive JSON viewer with collapsible structure
Media & File Widgets
Widgets for images, downloads, and file-related content.
image: Image rendering with size constraintsdownload: Downloadable file linkshashimg: Images generated from hash valuesvideo: Video player for media URLsaudio: Audio player for media URLs
Task & Status Widgets
Widgets for displaying task information and status indicators.
taskstatus: Task status display (AWAITING, RUNNING, etc.)taskid: Task ID displaytaskname: Task name displaytasktype: Task type display
Time & Progress Widgets
Widgets for time display, progress tracking, and duration formatting.
timestamp: Unix timestamp to human-readable timerelative-timestamp: Time relative to now (e.g., “2 hours ago”)progress: Progress bar (0-100)duration: Duration in seconds to formatted timemetric: Numeric metric with unit and label
Rating & Quality Widgets
Widgets for ratings, test results, and quality indicators.
rating: Star rating display (0-5)testresult: Test result indicator (PASS/FAIL)
Schema & Validation Widgets
Widgets for JSON Schema display, validation, and explanation.
jsonschema: JSON Schema visualizationjsonschema-validation: Schema validation resultsjsonschema-explanation: Schema documentation
Interactive & Utility Widgets
Interactive buttons, multi-widgets, utility components, and QR codes.
sheetkey: Sheet key displayschedule-task: Button to schedule tasksmulti: Multiple widgets in one cell (specify array of widget types)transitions: Task transitions displayqr-code: QR code generation from textattachments: Links to task attachments/artefacts
Creating Custom Widgets
To create a custom widget:
- Add
widget-<name>.jsinstatic/or a directory listed inSHEETBOT_STATIC_SEARCH_PATHS. - Import Lit (or use a plain custom element) and define a class, normally extending
LitElement. - Read the cell value from the
dataproperty.rowkeyandcolumnare also set. - Implement
getCopyText(); it is used by copy operations.getCopyHTML()andgetContextMenuDefinition()are optional. - Register with
customElements.define('widget-<name>', WidgetClass). - Set
widgettype = '<name>'incolumnstructure.
Widgets are discovered automatically by /widgets.json and imported by sheet.html; you do not need to edit sheet.html. The list is cached for SHEETBOT_WIDGET_CACHE_TTL minutes (default 5); set it to 0 while developing.
See Building a custom widget for a complete example, and existing widgets in static/ for more patterns.