Skip to content
Theme:

Ui3nScrollbar ​

Dual-axis custom scrollbar component. Renders one bi-directional scrollport with overlay vertical and/or horizontal tracks.

Props

NameTypeDefaultDescription
axesUi3nScrollbarAxes | undefined"both" No description provided
verticalUi3nScrollbarVerticalOptions | undefined{ thumbMinHeight: 32, thumbHeight: "auto" } No description provided
horizontalUi3nScrollbarHorizontalOptions | undefined{ thumbMinWidth: 32, thumbWidth: "auto" } No description provided
autoUpdateboolean | undefinedtrue No description provided

Events

Event NameArguments / Value TypeDescription
scrollvalue: Ui3nScrollbarScrollPayload —
scroll:verticalvalue: Ui3nScrollbarScrollPayload —
scroll:horizontalvalue: Ui3nScrollbarScrollPayload —

Slots

Slot NameScope Props (v-slot)Description
#default — —

Public Methods & Exposes

Method NameSignature / TypeDescription
scrollTo()(options: ScrollToOptions) => void —
scrollToVertical()(options?: { top?: number | undefined; behavior?: ScrollBehavior | undefined; } | undefined) => void —
scrollToHorizontal()(options?: { left?: number | undefined; behavior?: ScrollBehavior | undefined; } | undefined) => void —
getContainer()() => HTMLDivElement —
updateMetrics()() => void —

CSS Variables

Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.

NameDefault
--ui3n-scrollbar-horizontal-thumb-active-colorvar(--color-bg-control-accent-focused)
--ui3n-scrollbar-horizontal-thumb-colorvar(--color-bg-control-accent-default)
--ui3n-scrollbar-horizontal-thumb-hover-colorvar(--color-bg-control-accent-hover)
--ui3n-scrollbar-horizontal-thumb-radius4px
--ui3n-scrollbar-horizontal-track-colortransparent
--ui3n-scrollbar-horizontal-track-height6px
--ui3n-scrollbar-horizontal-track-radius4px
--ui3n-scrollbar-vertical-thumb-active-colorvar(--color-bg-control-accent-focused)
--ui3n-scrollbar-vertical-thumb-colorvar(--color-bg-control-accent-default)
--ui3n-scrollbar-vertical-thumb-hover-colorvar(--color-bg-control-accent-hover)
--ui3n-scrollbar-vertical-thumb-radius4px
--ui3n-scrollbar-vertical-track-colortransparent
--ui3n-scrollbar-vertical-track-radius4px
--ui3n-scrollbar-vertical-track-width6px

Scroll events ​

The component emits axis-scoped scroll events in addition to a general scroll event:

  • scroll — any scroll movement with { event, scrollTop, scrollLeft }.
  • scroll:vertical — emitted when scrollTop changed.
  • scroll:horizontal — emitted when scrollLeft changed.

A diagonal gesture can emit both axis events in the same native tick.

Usage Examples ​

Both axes (default) ​

Horizontal + vertical tracks over a wide content area.

Both axes

Default dual-axis scrollbar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

Vertical only ​

Vertical only

Single vertical track

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Item 13
Item 14
Item 15
Item 16
Item 17
Item 18
Item 19
Item 20

Horizontal only ​

Horizontal only

Single horizontal track with custom styles

Card 1
Card 2
Card 3
Card 4
Card 5
Card 6
Card 7
Card 8
Card 9
Card 10
Card 11
Card 12
Card 13
Card 14
Card 15
Card 16
Card 17
Card 18
Card 19
Card 20
Card 21
Card 22
Card 23
Card 24
Card 25
Card 26
Card 27
Card 28
Card 29
Card 30