Skip to content
React Spring Bottom Sheet
PrimitivesNIPE Open Source
Browse documentation
On this page

docs / styling

Styling

Keep mechanics, theme, and application styles independent.

Three styling paths

Most applications should import styles.css once. It combines the mechanical layer with a restrained, production-ready default theme.

import '@nipe-solutions/react-spring-bottom-sheet/styles.css'

For a complete visual replacement, import core.css instead. Import theme.css when you want the default visual rules, or tokens.css when you only need their starting values.

Published stylesheets

HookPurpose
styles.cssMechanics, default tokens, and default theme
core.cssPositioning, gestures, portals, and safe-area handling only
theme.cssDefault visual rules; imports tokens.css
tokens.cssDefault values for the public custom properties

Stable class hooks

HookPurpose
.rsbs-trigger / .rsbs-closeOpening and closing controls
.rsbs-backdropModal backdrop
.rsbs-viewportFixed clipping and stacking layer
.rsbs-contentAnimated sheet surface
.rsbs-handleDrag handle and its hit area
.rsbs-title / .rsbs-descriptionAccessible label and description

Theme tokens

HookPurpose
--rsbs-z-indexBase stacking level
--rsbs-backdrop-color / --rsbs-backdrop-opacityBackdrop appearance
--rsbs-content-background / --rsbs-content-colorSurface palette
--rsbs-content-border / --rsbs-content-radiusSurface edge
--rsbs-content-shadowSurface elevation
--rsbs-handle-color / --rsbs-handle-width / --rsbs-handle-heightHandle mark
--rsbs-handle-hit-areaMinimum draggable handle area
--rsbs-focus-color / --rsbs-focus-width / --rsbs-focus-offsetKeyboard focus indicator

State is exposed through data-rsbs-state and data-rsbs-dragging. Treat --rsbs-position and safe-area variables as mechanical internals rather than theme inputs.

Complete replacement

The library owns the rsbs-* namespace. Give application hooks their own clear prefix, then combine one with a stable library hook—for example .checkout-sheet.rsbs-content. The core selectors have deliberately low specificity, so ordinary selectors win without !important.

import '@nipe-solutions/react-spring-bottom-sheet/core.css'
import './sheet-theme.css'

/* sheet-theme.css */
.checkout-sheet.rsbs-content {
  background: var(--checkout-surface);
  color: var(--checkout-text);
}

Keep page-layout selectors out of sheet themes. The documentation site uses docs-*; its examples use rsbs-example-*. That boundary prevents either stylesheet from accidentally reaching into the other.

Compare the square-edged field-note theme with the explicit dark instrument theme. Both replace the complete visual layer while retaining the same component behavior.