# Scrollbar Options

An explanation of the scrollbar options, including what they do and how to use them

## Content

You can control the visibility and scrolling behavior of workbook scrollbars.

## Show or Hide Scrollbars

Use `showHorizontalScrollbar` and `showVerticalScrollbar` to control scrollbar visibility.
These properties support three values:

* `true` — Always show the scrollbar
* `false` — Always hide the scrollbar
* `"auto"` — Show the scrollbar only when the worksheet has scrollable content

When set to `"auto"`, the scrollbar is automatically hidden if the content fully fits within the viewport.

```javascript
spread.options.showHorizontalScrollbar = "auto";
spread.options.showVerticalScrollbar = "auto";
```

![autoShow.gif](https://cdn.mescius.io/document-site-files/images/b2223940-43c2-44cf-8eda-f5ab9acd84f0/autoShow-20260305.dd0b0f.gif?width=600)
In `"auto"` mode, the scrollbar is also hidden if:

* All rows and columns fit within the viewport
* Frozen rows or columns eliminate all scrollable area

>type=note
> **Note:** When exporting to Excel, `"auto"` is treated as `true` because Excel does not support automatic scrollbar visibility.

## Control the Scrollable Range

You can adjust how the scrollbar determines its scrollable range.

* `scrollbarMaxAlign`: Aligns the scrollbar with the last row and column of the active sheet.
* `scrollbarShowMax`: Calculates the scrollbar range based on the total row and column count.

```javascript
spread.options.scrollbarMaxAlign = true;
```

![scrollbarMaxAlign.gif](https://cdn.mescius.io/document-site-files/images/b2223940-43c2-44cf-8eda-f5ab9acd84f0/scrollbarMaxAlign-20260305.d9725b.gif?width=800)

```javascript
spread.options.scrollbarShowMax = true;
```

![scrollbarShowMax.gif](https://cdn.mescius.io/document-site-files/images/b2223940-43c2-44cf-8eda-f5ab9acd84f0/scrollbarShowMax-20260305.b1c603.gif?width=800)

## Ignore Hidden Rows and Columns

Use `scrollIgnoreHidden` to exclude hidden rows and columns from scrollbar calculations.
Hidden rows and columns include:

* Zero height or width
* Rows or columns hidden using the `visible` method
* Collapsed grouped rows or columns
* Filtered-out rows

```javascript
spread.options.scrollIgnoreHidden = true;
```


