Skip to contents

Generates an interactive artwork card with thumbnail, title, and status badges (NFT, new, variants). Used by [modBrowseServer()] for grid display but exported for reuse in custom browse layouts.

The card uses {shinyNextUI} for modern card styling with hover effects, blur, and pressable interaction. Includes automatic placeholder SVG generation for failed image loads.

Usage

artDisplayCard(
  ns,
  card_id,
  art_title,
  thumb_src,
  is_new = FALSE,
  has_nft = FALSE,
  n_variants = 1,
  width = "100%"
)

Arguments

ns

Function. Namespace function from `shiny::NS(id)`. Used to create properly namespaced element IDs for the card click handler.

card_id

Character. Unique identifier for the card (e.g., "btn_1"). Combined with namespace to create full element ID. The numeric suffix is extracted and sent as `input$card_clicked_` value.

art_title

Character. Artwork title displayed in card footer.

thumb_src

Character. CDN URL to thumbnail image. Obtain from `artutils::path_artwork_thumb(artist, artwork)`.

is_new

Logical. Whether artwork is in latest 3 pieces. Adds "New" badge with tooltip. Default FALSE.

has_nft

Logical. Whether artwork has NFT minting. Adds NFT badge with tooltip. Default FALSE.

n_variants

Numeric. Number of artwork variants. Adds variant count badge if > 1. Default 1 (no badge).

width

Character. CSS width value. Default "100%".

Value

A `shiny.tag` div containing the {shinyNextUI} card with image, footer, and overlay badges. Card is pressable and triggers `input$card_clicked_` with artwork number when clicked.

Examples

if (FALSE) { # \dontrun{
ns <- shiny::NS("browse")
artDisplayCard(
  ns = ns,
  card_id = "btn_1",
  art_title = "Sunset Over Mountains",
  thumb_src = artutils::path_artwork_thumb(artist, artwork),
  is_new = TRUE,
  has_nft = FALSE,
  n_variants = 3
)
} # }