← Back to Components

Plot Output

shadcn-styled frames around Shiny's reactive plotOutput/renderPlot graphics outputs.

Interactive Playground

R Code

API Reference

block_plot_output()

Frames a reactive shiny::plotOutput() (renderPlot()) in the same shadcn-styled box. Covers base graphics, ggplot2, and lattice; alt is server-controlled via renderPlot(alt=).

ArgumentTypeDefaultDescription
idcharacterrequiredShiny output id, passed verbatim to plotOutput().
widthcharacter"100%"CSS width forwarded to the Shiny output and mirrored on the media box.
heightcharacterNULLCSS height. NULL resolves to "100%" when aspect is set, else Shiny's default.
aspectcharacter | numericNULLMedia-box aspect ratio: NULL, a positive number, or a "w/h" string.
borderlogicalFALSEDraw a border around the media box.
roundedlogicalTRUERound the media box corners (and clip overflow).
captioncharacterNULLOptional <figcaption> text below the media box.
click / dblclick / hover / brushcharacter | *Opts()NULLForwarded to the Shiny output unchanged (plot click/hover/brush inputs).
inlinelogicalFALSEForwarded to the Shiny output unchanged.
filllogical!inlineForwarded to the Shiny output; matches shiny::plotOutput().
classcharacterNULLAdditional classes for the <figure> wrapper.
stylecharacterNULLInline style for the <figure> wrapper.