Skip to contents

Draggable, resizable panels. When inputId is set, input$<inputId> is a numeric vector of panel sizes (fired on drag release).

Usage

shad_resizable(
  inputId = NULL,
  ...,
  orientation = c("horizontal", "vertical"),
  class = NULL
)

shad_resizable_panel(
  ...,
  default_size = NULL,
  min_size = NULL,
  max_size = NULL
)

shad_resizable_handle(with_handle = TRUE)

Arguments

inputId

Optional input id (binds panel sizes when set).

...

shad_resizable_panel() and shad_resizable_handle() children.

orientation

"horizontal" (default) or "vertical".

class

Extra CSS classes.

default_size

Initial size (percentage 0-100).

min_size, max_size

Optional size bounds (percentage).

with_handle

If TRUE, render the visible grip.

Value

A resizable group tag.

Examples

shad_resizable("r",
  shad_resizable_panel("One", default_size = 50),
  shad_resizable_handle(),
  shad_resizable_panel("Two", default_size = 50))
#> <div class="shad-resizable" data-shad="resizable" id="r" data-orientation="horizontal">
#>   <div class="shad-resizable__panel" data-size="50">One</div>
#>   <div class="shad-resizable__handle"><span class="shad-resizable__grip" aria-hidden="true"><svg width="6" height="10" viewBox="0 0 6 10" fill="currentColor" aria-hidden="true"><circle cx="1.5" cy="2" r="1"/><circle cx="4.5" cy="2" r="1"/><circle cx="1.5" cy="5" r="1"/><circle cx="4.5" cy="5" r="1"/><circle cx="1.5" cy="8" r="1"/><circle cx="4.5" cy="8" r="1"/></svg></span></div>
#>   <div class="shad-resizable__panel" data-size="50">Two</div>
#> </div>