padding: Padding

Description Usage Arguments Panels Examples

View source: R/padding.R

Description

The padding() function adjusts the inner spacing of a tag element. The padding of a tag element is the space between the tag element's border and its content or child elements.

Usage

1
padding(x, all = NULL, top = NULL, right = NULL, bottom = NULL, left = NULL)

Arguments

x

A tag element or .style pronoun.

all

A responsive argument.

One of 1:5 specifying a padding for all sides of the tag element, defaults to NULL, in which case the argument is ignored. 0 removes all inner space and 5 adds the most space.

top, right, bottom, left

A responsive argument.

One of 1:5 specifying a padding for the element's respective side, defaults to NULL, in which case the argument is ignored. 0 removes all inner space and 5 adds the most space.

Panels

Well panels.

wellPanel(
  radioButtons(
    inputId = "id",
    label = "Radio input",
    choices = c(
      "Choice 1",
      "Choice 2"
    )
  )
)
html_preserve
/html_preserve

Shrink well padding.

wellPanel(
  .style %>%
    padding(1),
  radioButtons(
    inputId = "id",
    label = "Radio input",
    choices = c(
      "Choice 1",
      "Choice 2"
    )
  )
)
html_preserve
/html_preserve

Auto width.

wellPanel(
  .style %>%
    padding(1),
  radioButtons(
    inputId = "id",
    label = "Radio input",
    choices = c(
      "Choice 1",
      "Choice 2"
    )
  ) %>%
    width("auto")
)
html_preserve
/html_preserve

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(htmltools)

div(
  .style %>%
    margin(2) %>%
    border("green") %>%
    padding(2) %>%
    background("red"),
  "Donec vitae dolor."
)

cascadess documentation built on Jan. 13, 2021, 5:10 p.m.