Scrollbar

This Easy element adds a scrollbar to the page, showing the current scroll progress.

Settings

color
horizontal
thickness
opacity
throttle
margin
unit
position
length
roundCorners
showProgress
textColor

color

Type: String


The color of the scroll bar background and progress bar.

default: '#0a3bad'

horizontal

Type: Boolean


Determines if the scroll bar is horizontal (true) or vertical (false).


Required for correct positioning.

default: true

thickness

Type: String


The thickness (height or width) of the bar, including units.

default: '10px'


Example:

<div
	data-controller="easy-scroll-bar"
	data-easy-scroll-bar-thickness-value="15px"
></div>

opacity

Type: Number (range)


The opacity of the scroll bar background.

Must be a value between 0.0 and 1.0.

default: .5

throttle

Type: Number


Throttle interval (in milliseconds) for scroll event handling.

default: 10

margin

Type: Number


Margin from the edge of the screen to the bar, in pixels.

default: 10

unit

Type: String


CSS unit for margin and thickness values (e.g., 'px', '%').

default: 'px'

position

Type: String (keyword)


Bar position relative to the viewport edge ('top', 'bottom', 'left', 'right').

default: 'top'

length

Type: Number (range)


Length of the bar as a percentage of its container (0-100).

default: 80

roundCorners

Type: Boolean


If true, renders rounded corners on the bar.

default: true

showProgress

Type: Boolean


If true, displays the numerical scroll progress as text.

Only works for horizontal bars.

default: false

textColor

Type: String


The color of the progress text.

default: '#fff'