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
{:"Built-in"=>"open Explore or some add-ons from the right side of the window."}
-
2
{:"Apps Script"=>"create an HTML file, call SpreadsheetApp.getUi().showSidebar(htmlOutput) from a menu or button."}
-
3
Sidebar HTML uses google.script.run to call server functions and return results to the client.
-
4
Keep sidebar stateless or store settings in PropertiesService when users close and reopen.
-
5
Test narrow laptop screens; sidebars reduce visible grid width.
-
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.
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
Protect Your Spreadsheet IP
Advanced Coding in Google Sheets for Programmers
How do I prevent people from sharing my spreadsheets by making a copy?
Create Navigation Buttons in Sheets to Other Sheets
Tips to Navigating Thousands of Lines of Code In Apps Script
How do I reference a different spreadsheet in Apps Script?
Related blog posts
Guides that explain Sidebar in more depth.
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →Related terms
Script Editor
The Script Editor is the Apps Script workspace inside your spreadsheet where you write JavaScript that talks to Sheets, Gmail, and other Google services. You open it from Extensions > Apps Script. Every function you save can be run manually, bound to a trigger, or linked from a custom menu.
Read guide →Explore tab
The Explore tab is a sidebar panel that analyzes your selected data and suggests charts, pivot tables, formatting, and quick questions. Google Sheets opens it from the star icon or when you select a table range. It is a fast way to visualize patterns without writing formulas first.
Read guide →Apps Script web apps
A web app turns your script into a URL that runs doGet or doPost when someone visits or posts data. The page can read and write your spreadsheet behind the scenes, which is useful for simple forms, internal tools, and lightweight APIs without standing up a separate server.
Read guide →Google Sheets automation
Automation means work happens without repeating the same clicks every day: imports update, emails send, rows move, and dashboards refresh. In Sheets, automation usually stacks built-in features, Apps Script, and sometimes the Sheets API or add-ons. Start with the lightest tool that still solves the job.
Read guide →Done reading about Sidebar?
Membership unlocks 600+ 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.