What is a sidebar in Google Sheets?

A sidebar is a vertical panel docked beside the spreadsheet grid. The Explore tab is a built-in sidebar. With Apps Script you can show a custom sidebar from HTML to build wizards, search tools, and forms without leaving the sheet. Add-ons from the Marketplace often register sidebar entries under Extensions.

When to use it

Use sidebars when users need multi-step UI: picking options, previewing generated formulas, browsing template libraries, or running tools that do not fit in one modal dialog.

When to skip it

Skip sidebars for one-click macros that only need a toast. Very wide layouts may feel cramped; consider a dialog or web app for complex apps.

How it works

  1. 1

    {:"Built-in"=>"open Explore or some add-ons from the right side of the window."}

  2. 2

    {:"Apps Script"=>"create an HTML file, call SpreadsheetApp.getUi().showSidebar(htmlOutput) from a menu or button."}

  3. 3

    Sidebar HTML uses google.script.run to call server functions and return results to the client.

  4. 4

    Keep sidebar stateless or store settings in PropertiesService when users close and reopen.

  5. 5

    Test narrow laptop screens; sidebars reduce visible grid width.

  6. 6

    Close sidebar when done so editors regain full width for data entry marathons.

Examples in Google Sheets

Formula builder sidebar

Custom menu opens a sidebar where users pick columns and copy a QUERY string into the active cell.

Add-on CRM search

Marketplace add-on sidebar looks up contacts and inserts rows without switching to another browser tab.

Explore for charts

Native Explore sidebar suggests charts from the selection before you commit to a dashboard layout.

Next step for Sidebar

Jump to a related Better Sheets resource, or unlock the full tutorial library.

Better Sheets resources

Common mistakes

  • Sidebar calls google.script.run in a tight loop, hitting quota and feeling sluggish.
  • Assuming sidebar works identically in every browser; test Chrome first, then Safari.
  • Building a full app in sidebar when a bound web app with its own URL would scale better.
  • Forgetting authorization prompts the first time sidebar calls restricted services.
  • Leaving sidebar open during screen share when it hides sensitive columns unintentionally.

Frequently asked questions

Sidebar vs dialog?
Sidebar stays open beside the sheet. Dialog is a centered modal for short tasks.
Close sidebar programmatically?
Users close with the X. Design flows that do not require forced close from script.
Sidebar width?
Google controls default width. Design for a narrow panel, not a full second window.
Sidebar in view-only?
Custom sidebars from scripts usually need edit access or authorized viewers depending on deployment.
Explore vs custom sidebar?
Explore is Google-built analysis. Custom sidebars run your HTML and Apps Script logic.
Sidebar and mobile?
Poor fit on phones. Target desktop editors for sidebar tools.
Multiple sidebars?
Typically one sidebar at a time. Opening another replaces or conflicts; close first.
Sidebar CSS?
HTML sidebar supports standard CSS within Apps Script sandbox limits.

Related Tutorials

Watch how Sidebar works

Browse more tutorials
Protect Your Spreadsheet IP

Protect Your Spreadsheet IP

Tips and tricks to make sure people don’t resell your sheet. Or if they ...
Advanced Coding in Google Sheets for Programmers

Advanced Coding in Google Sheets for Programmers

Add a Custom Menu Create Native-like Functions Get URL and Sheet ID's vi...
How do I prevent people from sharing my spreadsheets by making a copy?

How do I prevent people from sharing my spreadsheets by making a copy?

A video I did summarizing the 3 things you can do to help people who sha...
Create Navigation Buttons in Sheets to Other Sheets

Create Navigation Buttons in Sheets to Other Sheets

Add a button to go to another sheet inside your sheet.
Tips to Navigating Thousands of Lines of Code In Apps Script

Tips to Navigating Thousands of Lines of Code In Apps Script

Find out how I use Apps Script built in features to code very quickly an...
How do I reference a different spreadsheet in Apps Script?

How do I reference a different spreadsheet in Apps Script?

I'll show you how to get text from one spreadsheet file to another with ...

Related blog posts

Guides that explain Sidebar in more depth.

Browse the blog

Related glossary terms

Done reading about Sidebar?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.