The colour and width of card borders are customisable, as is the amount of rounding on the card borders.

Border width

To remove the borders entirely set border_width = 0:

galleries[1:3, ] %>% 
  cards(
    title = long_name,
    image = image_url, 
    border_width = 0
  )
Ash Cloud and Blood
Ghosts on Marble Paper
Ice Floes

For thick borders, set border_width = 5:

galleries[1:3, ] %>% 
  cards(
    title = long_name,
    image = image_url, 
    border_width = 5
  )
Ash Cloud and Blood
Ghosts on Marble Paper
Ice Floes

Border colour

The colour of the card borders is specified using border_colour and recognises any valid colour string recognised by CSS. The input can either be a single colour, but you can also pass a vector as input assigning each card a different border colour:

galleries[1:3, ] %>% 
  cards(
    title = long_name,
    image = image_url, 
    border_width = 2,
    border_colour = c("#8b0000", "black", "#0b0b80")
  )
Ash Cloud and Blood
Ghosts on Marble Paper
Ice Floes

Border radius

The border_radius argument is used to control the degree of rounding of the card borders, and should be an integer between 0 and 5. At border_radius = 0 the cards are perfectly rectangular, with no rounding at all:

galleries[1:3, ] %>% 
  cards(
    title = long_name,
    image = image_url, 
    border_radius = 0,
  )
Ash Cloud and Blood
Ghosts on Marble Paper
Ice Floes

At the roundest setting border_radius = 5 produces noticeably rounded rectangles:

galleries[1:3, ] %>% 
  cards(
    title = long_name,
    image = image_url, 
    border_radius = 5,
  )
Ash Cloud and Blood
Ghosts on Marble Paper
Ice Floes

Additional customisation

Additional border customisation is possible, by passing character strings for border_width and border_width. When character input is used, the cards() function passes the input directly to the CSS. For example, you can create cards with circular images and very thick borders like this:

galleries[1:3, ] %>% 
  cards(
    image = image_url, 
    border_colour = "#dddddd",
    border_width = "20px",
    border_radius = "20rem",
  )
#> using 'image-only' layout