Skip to main content
Scrubber
@coinbase/cds-web-visualization@3.4.0-beta.9
An interactive scrubber component for exploring individual data points in charts. Displays values on hover or drag and supports custom labels and formatting.
Import
import { Scrubber } from '@coinbase/cds-web-visualization'
SourceView source code
Peer dependencies
  • framer-motion: ^10.18.0
Related components
View as Markdown

Basics

Scrubber can be used to provide horizontal interaction with a chart. As your mouse hovers over the chart, you will see a line and scrubber beacon following.

Loading...

All series will be scrubbed by default. You can set seriesIds to show only specific series.

Loading...

Labels

Setting label on a series will display a label to the side of the scrubber beacon, and setting label on Scrubber displays a label above the scrubber line.

Loading...

Pulsing

Setting idlePulse to true will cause the scrubber beacons to pulse when the user is not actively scrubbing.

Loading...

You can also use the imperative handle to pulse the scrubber beacons programmatically.

Loading...

Styling

Beacons

You can use BeaconComponent to customize the visual appearance of scrubber beacons.

Loading...

Labels

You can use BeaconLabelComponent to customize the labels for each scrubber beacon.

Loading...

Using labelElevated will elevate the Scrubber's reference line label with a shadow.

Loading...

You can use LabelComponent to customize this label even further.

Loading...

Fonts

You can use labelFont to customize the font of the scrubber line label and beaconLabelFont to customize the font of the beacon labels.

Loading...

Bounds

Use labelBoundsInset to prevent the scrubber line label from getting too close to chart edges.

Loading...
Loading...

Line

You can use LineComponent to customize Scrubber's line. In this case, as a user scrubs, they will see a solid line instead of dotted.

Loading...

Opacity

You can use BeaconComponent and BeaconLabelComponent with the opacity prop to hide scrubber beacons and labels when idle.

Loading...

Overlay

By default, Scrubber will show an overlay to de-emphasize future data. You can hide this by setting hideOverlay to true.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.