Want to skip the docs? Check out pandamastery.com - the best way to learn Panda CSS

reference
interactivity

Interactivity

Panda CSS provides a variety of utility classes to enhance interactivity and user experience on your web applications.

Panda CSS provides a variety of utility classes to enhance interactivity and user experience on your web applications. These utilities cover aspects such as accent color, caret color, scrolling behavior, scrollbar customization, scroll margins and paddings, scroll snapping, touch actions, and user selection.

Accent Color

The accentColor utility class sets the accent color of an element. It supports colors tokens.

<div className={css({ accentColor: 'blue.500' })}>Accent color applied</div>

Caret Color

The caretColor utility class sets the color of the text cursor (caret) in an input or textarea. It supports colors tokens.

<input className={css({ caretColor: 'red.400' })} />

Wrapping long words

overflowWrap: 'anywhere' lets a flex or grid item shrink when a URL or long word would otherwise blow out the min-content size. break-word is the milder keyword.

css({ overflowWrap: 'anywhere' })

Scrollbar

scrollbar: 'hidden' hides the bar on standard CSS, WebKit, and legacy Edge. visible brings it back.

<div className={css({ scrollbar: 'hidden' })}>Scrollbar hidden</div>

Thickness is scrollbarWidth. Colors are two props that compose, same idea as masks: each one re-emits scrollbar-color from CSS variables, so you can set thumb, track, or both.

css({
  overflow: 'auto',
  scrollbarWidth: 'thin',
  scrollbarThumb: 'gray.400',
  scrollbarTrack: 'gray.100',
  scrollbarGutter: 'stable',
})
PropCSSValues
scrollbarhide / show, including ::-webkit-scrollbarvisible, hidden
scrollbarWidthscrollbar-widthauto, thin, none
scrollbarThumb--scrollbar-thumb + scrollbar-colorcolors
scrollbarTrack--scrollbar-track + scrollbar-colorcolors
scrollbarGutterscrollbar-gutterauto, stable, stable both-edges
scrollbarColorscrollbar-colorraw two-value string (red transparent)

scrollbarColor is the escape hatch for a raw thumb track pair. Don't use it for a single color token. That's invalid CSS. Use scrollbarThumb / scrollbarTrack.

_scrollbarThumb and _scrollbarTrack are still there for extra WebKit styling the standard property can't express, like radius or a border. Use them for that, not for color.

Scroll Margin

Scroll margin utilities set margins around scroll containers.

<div className={css({ scrollMarginX: '2' })}>Scrollbar Container with Inline padding</div>
PropCSS PropertyToken Category
scrollMarginX ,scrollMarginInlinescroll-margin-inlinespacing
scrollMarginInlineStartscroll-margin-inline-startspacing
scrollMarginInlineEndscroll-margin-inline-endspacing
scrollMarginY , scrollMarginBlockscroll-margin-blockspacing
scrollMarginBlockStartscroll-margin-block-startspacing
scrollMarginBlockEndscroll-margin-block-endspacing
scrollMarginLeftscroll-margin-leftspacing
scrollMarginRightscroll-margin-rightspacing
scrollMarginTopscroll-margin-topspacing
scrollMarginBottomscroll-margin-bottomspacing

Scroll Padding

Scroll padding utilities set padding inside scroll containers.

<div className={css({ scrollPaddingY: '2' })}>Scrollbar Container with block padding</div>
PropCSS PropertyToken Category
scrollPaddingX , scrollPaddingInlinescroll-padding-inlinespacing
scrollPaddingInlineStartscroll-padding-inline-startspacing
scrollPaddingInlineEndscroll-padding-inline-endspacing
scrollPaddingY , scrollPaddingBlockscroll-padding-blockspacing
scrollPaddingBlockStartscroll-padding-block-startspacing
scrollPaddingBlockEndscroll-padding-block-endspacing
scrollPaddingLeftscroll-padding-leftspacing
scrollPaddingRightscroll-padding-rightspacing
scrollPaddingTopscroll-padding-topspacing
scrollPaddingBottomscroll-padding-bottomspacing

Scroll Snapping

Scroll snapping utilities provide control over the scroll snap behavior.

Scroll Snap Margin

PropCSS PropertyToken Category
scrollSnapMarginscroll-marginspacing
scrollSnapMarginTopscroll-margin-topspacing
scrollSnapMarginBottomscroll-margin-bottomspacing
scrollSnapMarginLeftscroll-margin-leftspacing
scrollSnapMarginRightscroll-margin-rightspacing

Scroll Snap Strictness

It's values can be mandatory or proximity values, and maps to var(--scroll-snap-strictness).

<div className={css({ scrollSnapStrictness: 'proximity' })}>Scroll container with proximity scroll snap</div>

Scroll Snap Type

Supported values

Value
nonenone
xx var(--scroll-snap-strictness)
yy var(--scroll-snap-strictness)
bothboth var(--scroll-snap-strictness)