Description Usage Arguments See Also Examples
The font()
utility modifies the color, size, weight, case, or alignment of
a tag element's text. All arguments default to NULL
, in which case they are
ignored. For example, font(.., size = "lg")
increases font size without
affecting color, weight, case, or alignment.
1 |
tag |
A tag element. |
color |
One of " |
size |
One of |
weight |
One of |
case |
One of |
align |
A responsive argument. One of |
Other design utilities:
active()
,
affix()
,
background()
,
border()
,
display()
,
float()
,
height()
,
padding()
,
scroll()
,
shadow()
,
width()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ### Changing text color
card(
header = h3("Important!") %>%
font(color = "amber"),
div(
"This is a reminder."
)
) %>%
border(color = "amber")
### Changing font size
div(
p("Extra small") %>%
font(size = "xs"),
p("Small") %>%
font(size = "sm"),
p("Medium") %>%
font(size = "base"),
p("Large") %>%
font(size = "lg"),
p("Extra large") %>%
font(size = "xl")
)
### Changing font weight
# Make an element's text bold, italic, light, or monospace.
p("Curabitur lacinia pulvinar nibh.") %>%
font(weight = "bold")
p("Proin quam nisl, tincidunt et.") %>%
font(weight = "light")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.