enes

ScrollBar

Un ScrollBar permite desplazar contenido que desborda su contenedor. En reposo muestra un thumb delgado sobre el contenido; al pasar el cursor se expande en un track con flechas.

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

Uso

<script>
  import { ScrollBar } from 'fluentui-svelte';
</script>

<ScrollBar style="height: 12rem;" viewportAttributes={{ 'aria-label': 'Article' }}>
  <!-- Long content -->
</ScrollBar>

Desbordamiento

overflow define los ejes que se desplazan: auto (por defecto, solo los ejes que desbordan), y, x o both.

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

overflow="y"
1
2
3
4
5
6
7
8
9
10
11
12
overflow="x"
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
overflow="both"

Expandido

Mantiene visibles el track, el thumb y las flechas.

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

Tamaño

size ajusta la barra expandida a thin, medium (por defecto) o large.

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

thin

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

medium

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

large

Elemento existente

Añade las barras a un elemento existente en lugar de renderizar uno.

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • Item 6
  • Item 7
  • Item 8

Ocultación automática

Controla cuándo se oculta la barra.

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

never

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

scroll

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

leave

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

move

Flechas

Oculta los botones de flecha.

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

Track oculto

Oculta el track cuando la barra se expande.

Paragraph 1. Hover the scroll bar to expand it.

Paragraph 2. Hover the scroll bar to expand it.

Paragraph 3. Hover the scroll bar to expand it.

Paragraph 4. Hover the scroll bar to expand it.

Paragraph 5. Hover the scroll bar to expand it.

Paragraph 6. Hover the scroll bar to expand it.

Paragraph 7. Hover the scroll bar to expand it.

Paragraph 8. Hover the scroll bar to expand it.

Teclado y accesibilidad

El área desplazable recibe el foco y se desplaza con el teclado. Ponle nombre con viewportAttributes.

Propiedades del componente

NameTypeDefaultDescription
as'div' | 'section' | 'article' | 'aside' | 'main' | 'nav' | 'ul' | 'ol''div'El elemento a renderizar.
ref bindableHTMLElementEl elemento raíz.
scrollRefHTMLElement | nullUn elemento existente al que añadir las barras en lugar de renderizar uno.
viewportRef bindableHTMLElement | nullEl elemento que se desplaza.
viewportAttributesHTMLAttributes<HTMLDivElement>Atributos del elemento que se desplaza.
expandedbooleanMantiene la barra expandida.
collapseDelaynumber2000Milisegundos de espera antes de contraerse cuando el puntero sale.
instance bindableOverlayScrollbars | nullLa instancia de OverlayScrollbars.
overflow'auto' | 'x' | 'y' | 'both''auto'Los ejes que se pueden desplazar.
autoHide'never' | 'scroll' | 'leave' | 'move''move'Cuándo se oculta la barra.
autoHideDelaynumber1000Milisegundos de espera antes de ocultarse.
hideArrowsbooleanOculta los botones de flecha.
showFocusOutlinebooleanMuestra el contorno de foco del área desplazable.
hideTrackbooleanOculta el track.
size'thin' | 'medium' | 'large''medium'El tamaño de la barra expandida.
arrowStepnumber48Píxeles desplazados por cada pulsación de flecha.
optionsPartialOptionsOpciones adicionales de OverlayScrollbars.
eventsEventListenersEventos de OverlayScrollbars.
deferboolean | IdleRequestOptionsSe inicializa cuando el navegador está inactivo.
HTML Attributes
Editar este documento Ver como Markdown