Use border() to add or modify tag element borders.

border(tag, color = NULL, sides = "all", round = NULL)

Arguments

tag

A tag element.

color

One of "red", "purple", "indigo", "blue", "cyan", "teal", "green", "yellow", "amber", "orange", "grey", "black" or "white" specifying the border color of the tag element, defaults to NULL

sides

One or more of "top", "right", "bottom", "left" or "all" or "none" specifying which sides to add a border to, defaults to "all".

round

One or more of "top", "right", "bottom", "left", "circle", "all", or "none" specifying how to round the border(s) of a tag element, defaults to NULL, in which case the argument is ignored.

See also

Other design utilities: active(), affix(), background(), display(), float(), font(), height(), padding(), scroll(), shadow(), width()

Examples

### Change border color div( div() %>% height(3) %>% width(3) %>% border("green"), div() %>% height(3) %>% width(3) %>% border( color = "blue", sides = c("left", "right") ) )
#> <div> #> <div class="h-3 w-3 border border-green"></div> #> <div class="h-3 w-3 border-left border-right border-blue"></div> #> </div>
### Round sides sides <- c("top", "right", "bottom", "left", "circle", "all") div( lapply( sides, border, tag = div() %>% height(3) %>% width(3), color = "black" ) ) %>% display("flex") %>% flex(wrap = TRUE)
#> <div class="d-flex flex-wrap"> #> <div class="h-3 w-3 border-top border-black"></div> #> <div class="h-3 w-3 border-right border-black"></div> #> <div class="h-3 w-3 border-bottom border-black"></div> #> <div class="h-3 w-3 border-left border-black"></div> #> <div class="h-3 w-3 border-circle border-black"></div> #> <div class="h-3 w-3 border border-black"></div> #> </div>