← Back to Components
Image Output
shadcn-styled frames around Shiny's reactive imageOutput/renderImage raster outputs.
Interactive Playground
R Code
API Reference
block_image_output()
Frames a reactive shiny::imageOutput() (renderImage()) in a shadcn-styled aspect/border/radius/caption box. App-author server code stays vanilla Shiny.
| Argument | Type | Default | Description |
|---|---|---|---|
| id | character | required | Shiny output id, passed verbatim to imageOutput(). |
| 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. |
| fit | character | "cover" | object-fit for the rendered image: cover, contain, fill, none, scale-down. |
| 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. |
| inline | logical | FALSE | Forwarded to the Shiny output unchanged. |
| fill | logical | FALSE | Forwarded to the Shiny output; matches shiny::imageOutput(). |
| class | character | NULL | Additional classes for the <figure> wrapper. |
| style | character | NULL | Inline style for the <figure> wrapper. |