Skip to contents

A rich floating panel anchored to a trigger. Bind the open state by passing inputId (otherwise it is a purely client-side popover).

Usage

shad_popover(
  inputId = NULL,
  trigger,
  ...,
  side = c("bottom", "top", "right", "left"),
  align = c("center", "start", "end"),
  title = NULL,
  class = NULL
)

Arguments

inputId

Optional input id (binds the open state when set).

trigger

The tag that toggles the popover.

...

Popover panel content.

side

"bottom" (default), "top", "right", "left".

align

"center" (default), "start", "end".

title

Optional accessible title (unused slot, reserved).

class

Extra CSS classes.

Value

A popover tag.

Examples

shad_popover("p", trigger = shad_button("Open"), "Panel content")
#> <div data-shad="popover" data-side="bottom" data-align="center" id="p" style="display:inline-block">
#>   <button class="shad-btn shad-btn--default shad-popover__trigger" type="button">Open</button>
#>   <div class="shad-popover__content shad-anim-pop" hidden>
#>     <div class="shad-popover__arrow" aria-hidden="true"></div>
#>     Panel content
#>   </div>
#> </div>