Skip to content

Scroll ​

Brief Introduction ​

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

Note: This styling affects the global scrollbar, so the code demo may not show the effect directly. You can observe the scrollbar effect on the right side.

Using Colors ​

thumbColor ​

Use thumbColor in MYScroll to define the color of the scrollbar thumb.

Code Demo
展开代码

thumbHoverColor ​

Use thumbHoverColor to define the color of the thumb when hovered.

Code Demo
展开代码

trackColor ​

Use trackColor to define the color of the scrollbar track.

Code Demo
展开代码

API Reference ​

Props ​

PropDescriptionTypeOptionsDefault
thumbColorThumb colorstringHex or named color—
thumbHoverColorThumb hover colorstringHex or named color—
trackColorTrack colorstringHex or named color—
widthScrollbar widthstringCSS width units (e.g., px, em)—
tagContainer tagstringAny HTML tagdiv

Type Definitions ​

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

Released under the MIT License.