View source: R/widget-scroll.R
| scroll_view | R Documentation |
Shows content that is larger than the available space. The content is laid out at its natural size and the visible part (the viewport) is shifted by the scroll offsets; everything outside is clipped. Scroll bars appear when the content overflows.
scroll_view(
...,
direction = "vertical",
scrollbars = TRUE,
focusable = TRUE,
id = NULL,
classes = NULL,
style = NULL
)
... |
Child widgets. |
direction |
|
scrollbars |
Draw scroll bars when the content overflows? |
focusable |
Can the scroll view take focus itself? |
id |
Optional identifier. |
classes |
Optional classes. |
style |
A |
Keys (when the scroll view or an unfocusable descendant has focus, or a
focused child does not use the key itself): arrows scroll by one cell,
Page Up / Page Down by a page, Home / End to the start / end. When focus
moves to a widget inside a scroll view, the view scrolls to reveal it.
Offset changes send a "scroll.changed" message.
A ScrollView widget with methods scroll_to(x, y),
scroll_by(dx, dy), scroll_home(), scroll_end() and
scroll_into_view(widget), and fields offset_x, offset_y,
viewport, virtual_size and max_scroll.
items <- lapply(1:100, function(i) label(paste("Item", i)))
view <- scroll_view(items, id = "list")
view$scroll_to(y = 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.