← 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=).
| Argument | Type | Default | Description |
|---|---|---|---|
| id | character | required | Shiny output id, passed verbatim to plotOutput(). |
| width | character | "100%" | CSS width forwarded to the Shiny output and mirrored on the media box. |
| height | character | NULL | CSS height. NULL resolves to "100%" when aspect is set, else Shiny's default. |
| aspect | character | numeric | NULL | Media-box aspect ratio: NULL, a positive number, or a "w/h" string. |
| border | logical | FALSE | Draw a border around the media box. |
| rounded | logical | TRUE | Round the media box corners (and clip overflow). |
| caption | character | NULL | Optional <figcaption> text below the media box. |
| click / dblclick / hover / brush | character | *Opts() | NULL | Forwarded to the Shiny output unchanged (plot click/hover/brush inputs). |
| inline | logical | FALSE | Forwarded to the Shiny output unchanged. |
| fill | logical | !inline | Forwarded to the Shiny output; matches shiny::plotOutput(). |
| class | character | NULL | Additional classes for the <figure> wrapper. |
| style | character | NULL | Inline style for the <figure> wrapper. |