# noScrollbar

> Hides the scrollbar across Chrome/Safari, legacy Edge, and Firefox, while the element stays scrollable by wheel, touch, keyboard, and script.

```ts
import { noScrollbar } from "@sdxc/u/overflow";
```

Hides the scrollbar across Chrome/Safari, legacy Edge, and Firefox, while
the element stays scrollable by wheel, touch, keyboard, and script. Pair
with `u.scroll()`/`u.overflow()` on the same element.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.noScrollbar()` | `css({ "&::-webkit-scrollbar": { display: "none" }, msOverflowStyle: "none", scrollbarWidth: "none" })` |

## Examples

### Basic example

Use `noScrollbar()` with `scroll("x")` to keep a row scrollable while hiding its scrollbar, as in a strip of filter chips. Scroll the row sideways with a trackpad or touch:

```tsx
<div
	mix={[
		scroll("x"),
		noScrollbar(),
		hstack({ gap: 4 }),
		is(96),
		maxIs("100%"),
		p(4),
		...,
	]}
>
	<div mix={[shrink(), is(24), ...]}>1</div>
	<div mix={[shrink(), is(24), ...]}>2</div>
	<div mix={[shrink(), is(24), ...]}>3</div>
	<div mix={[shrink(), is(24), ...]}>4</div>
	<div mix={[shrink(), is(24), ...]}>5</div>
	<div mix={[shrink(), is(24), ...]}>6</div>
	<div mix={[shrink(), is(24), ...]}>7</div>
	<div mix={[shrink(), is(24), ...]}>8</div>
</div>
```

## Applying on a state

Wrap the call in a state utility to scope it to one selector.

```ts
u.hover(u.noScrollbar())
```

## Responsive design

Wrap the call in a container query to scope it to one width.

```ts
u.at("md", u.noScrollbar())
```

## Signature

```ts
u.noScrollbar()
```
