Skip to content

Scroll ​

Brief Introduction ​

The scroll component is used to implement custom scrollbar styles and functionality. You can use <MYScroll></MYScroll> or <MYScroll /> to implement a custom scrollbar.

Note: This style will change the global scrollbar, so the code demo may not show the effect. You can directly observe the effect on the right scrollbar.

About Color Usage ​

thumbColor ​

Using thumbColor in MYScroll defines the color of the scrollbar thumb.

Code Demo
展开代码

thumbHoverColor ​

Use thumbHoverColor to define the color of the thumb on hover.

Code Demo
展开代码

trackColor ​

Use trackColor to define the color of the scrollbar track.

Code Demo
展开代码

API Reference ​

Props ​

ParameterDescriptionTypeOptionsDefault
thumbColorThumb colorstringHex or named color—
thumbHoverColorThumb hover colorstringHex or named color—
trackColorTrack colorstringHex or named color—
widthScrollbar widthstringSupports CSS width units (e.g., px, em)—
tagContainer tagstringSupports all HTML tagsdiv

Type Definitions ​

typescript
interface ScrollProps {
  thumbColor?: string;
  thumbHoverColor?: string;
  trackColor?: string;
  width?: string;
  tag?: string;
}

Released under the MIT License.