ScrollPanel
A scroll container with the theme's own thin bars, over native scrolling — the bars every component that scrolls inside wears, and v-scrollbar puts on a box of your own.
Import
import { ScrollPanel } from '@vitral/vue';Vertical and horizontal
Paragraph 1. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 2. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 3. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 4. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 5. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 6. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 7. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 8. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
When the bars show
`scrollbar` is `'hover'` by default: the bars show while the pointer is over the panel, focus is inside it, or it scrolls. `'always'` keeps them on the screen, and `'native'` gives the browser's own back. `arrows` puts arrows at their ends, as a native bar has. The same prop is on every component that scrolls inside (Sidebar, Select, Dialog, Drawer, DataGrid and the rest), and the application's `scrollbar` option sets it for all of them at once. Only the thumb takes the pointer: a press on the track reaches the content under it.
- 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
- Item 21
- Item 22
- Item 23
- Item 24
Content that grows
The bars follow the content as well as the panel: a section opening with an animation, an image loading.
The bar is measured again when what is inside grows, not only when the panel does: open the section and its thumb shrinks while the section is still opening.
Your own boxes
`v-scrollbar` puts the same bars on a box of your own that already scrolls, without wrapping it: it keeps its place in the layout and its native scrolling. `v-scrollbar.always`, `.hover` and `.native`, or a value, say when they show; with none, the application's `scrollbar` option decides. `.arrows` puts arrows at the ends, as a native bar has — a press scrolls a step, holding it keeps going — and the application's `scrollbarArrows` does the same for every bar.
Student 1
Student 2
Student 3
Student 4
Student 5
Student 6
Student 7
Student 8
Student 9
Student 10
Student 11
Student 12
Student 13
Student 14
Student 15
Student 16
Student 17
Student 18
Student 19
Student 20
| Student 1 | 6.0 |
| Student 2 | 6.7 |
| Student 3 | 7.4 |
| Student 4 | 8.1 |
| Student 5 | 8.8 |
| Student 6 | 9.5 |
| Student 7 | 6.2 |
| Student 8 | 6.9 |
| Student 9 | 7.6 |
| Student 10 | 8.3 |
| Student 11 | 9.0 |
| Student 12 | 9.7 |
| Student 13 | 6.4 |
| Student 14 | 7.1 |
| Student 15 | 7.8 |
| Student 16 | 8.5 |
| Student 17 | 9.2 |
| Student 18 | 9.9 |
| Student 19 | 6.6 |
| Student 20 | 7.3 |
Student 1: grade 6.0, entered on the term's sheet
Student 2: grade 6.7, entered on the term's sheet
Student 3: grade 7.4, entered on the term's sheet
Student 4: grade 8.1, entered on the term's sheet
Student 5: grade 8.8, entered on the term's sheet
Student 6: grade 9.5, entered on the term's sheet
Student 7: grade 6.2, entered on the term's sheet
Student 8: grade 6.9, entered on the term's sheet
Student 9: grade 7.6, entered on the term's sheet
Student 10: grade 8.3, entered on the term's sheet
Student 11: grade 9.0, entered on the term's sheet
Student 12: grade 9.7, entered on the term's sheet
Student 13: grade 6.4, entered on the term's sheet
Student 14: grade 7.1, entered on the term's sheet
Student 15: grade 7.8, entered on the term's sheet
Student 16: grade 8.5, entered on the term's sheet
Student 17: grade 9.2, entered on the term's sheet
Student 18: grade 9.9, entered on the term's sheet
Student 19: grade 6.6, entered on the term's sheet
Student 20: grade 7.3, entered on the term's sheet
API
Read from packages/vue/src/components/ScrollPanel/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| arrows New in 0.2.16 | boolean | Arrows at the ends of the bars, as a native bar has: a press scrolls a step and holding it keeps scrolling. The application's `scrollbarArrows` by default, which is off. |
| scrollbar | ScrollbarMode | The bars of the boxes this component scrolls inside — `'hover'`, `'always'` or `'native'`. The application's `scrollbar` option by default, which is `'hover'`. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |