shadshiny ships a small, curated icon set drawn from Lucide – enough to cover the components
without pulling in a font or an icon package. Reference an icon
by name anywhere a component takes an icon
argument, or render one directly with shad_icon().
Icon names are validated. Passing a name that isn’t in the set below throws an error rather than rendering nothing, so typos surface immediately.
Using icons
shad_icon("search") # a bare 16×16 SVG
shad_button("Search", icon = "search") # leading icon
shad_button(icon = "plus", size = "icon") # icon-only button
shad_badge("Verified", icon = "check") # in a badge
shad_menu_item("mail", "Send mail", icon = "mail") # in a menu
shad_sidebar_item("inbox", "Inbox", icon = "mail") # in the sidebarGet the full list programmatically with
shad_icon_names().
The set
Every icon in the package, at its native size. The name under each is
exactly what you pass to icon =.
Sizing & colour
Icons inherit the current text colour (currentColor), so
they tint themselves to whatever context they sit in – wrap one in a
coloured element and it follows. They render at 1rem by
default; to resize a standalone icon, pass an inline style
through ... (it overrides the default sizing), or attach
the shad-icon--sm / shad-icon--lg class.
Missing an icon?
The set is intentionally minimal. For anything outside it, pass your
own SVG (or any tag) wherever an icon argument is accepted
– the constructors take a tag just as readily as a name:
custom <- htmltools::tags$svg(
xmlns = "http://www.w3.org/2000/svg", viewBox = "0 0 24 24",
width = "16", height = "16", fill = "none", stroke = "currentColor",
`stroke-width` = "2", htmltools::tags$path(d = "M12 2v20M2 12h20")
)
shad_button("Custom", icon = custom)