Skip to contents

The components on this page turn shadshiny from a component library into an application toolkit: a client-side data table, the dashboard shells, and the flow inputs. The previews are live – sort the table, drag the rating, hold the stepper – but with no Shiny server attached they won’t echo values back.

For the reactive side, see Data tables, Dashboards & charts, and Forms & validation.

Data table

shad_data_table() is a bound input, not an output. It serialises the frame once and does all sorting, filtering, paging and selection in the browser. input$<id> reports {selected, sort, filter, page, pageSize}.

Click a header to sort, Shift+click to add a second sort key, and use the search box or the per-column filters to narrow the rows.

Code
shad_data_table("tbl_demo", cars, columns = list(model = shad_col("Model", width = "12rem"), mpg = shad_col("MPG", format = shad_fmt_number(1)), cyl = shad_col("Cylinders", align = "center"), hp = shad_col("Horsepower", format = shad_fmt_number(0)), wt = shad_col("Weight", format = shad_fmt_number(2, suffix = " t"))), selection = "multiple", filter = "global", page_size = 5)

Formatted cells

shad_col(format=) takes one of the shad_fmt_*() formatters. Each keeps the raw value as the sort key, so a $1,200.00 cell still sorts numerically and a formatted date still sorts chronologically.

Code
shad_data_table("tbl_fmt", sales, columns = list(order = shad_col("Order #", width = "8rem"), amount = shad_col("Amount", format = shad_fmt_number(2, prefix = "$")), margin = shad_col("Margin", format = shad_fmt_percent(1)), date = shad_col("Date", format = shad_fmt_date("%b %d, %Y")), status = shad_col("Status", format = shad_fmt_badge(c(paid = "default", pending = "secondary", refunded = "destructive")))), filter = "none", page_size = 5)

Value box

A shadshiny addition: no shadcn/ui counterpart.

shad_value_box() is the KPI card. delta_direction = "auto" (the default) reads the sign off the delta string, so "+12.5%" is up and "-3%" is down – pass delta_direction explicitly when the arrow shouldn’t follow the sign (a falling error rate is good news).

Revenue
$45,231 +20.1%
vs. last month
Subscribers
2,350 +180
Error rate
0.9% -0.4%
Lower is better
Active now
573
Code
shad_value_box("$45,231", "Revenue", delta = "+20.1%", icon = "credit-card", caption = "vs. last month")
shad_value_box("2,350", "Subscribers", delta = "+180", icon = "users")
shad_value_box("0.9%", "Error rate", delta = "-0.4%", delta_direction = "up", icon = "activity", caption = "Lower is better")
shad_value_box("573", "Active now", icon = "zap", size = "sm")

Sparkline

A shadshiny addition: no shadcn/ui counterpart.

shad_sparkline() is a tiny inline chart with no axes, no labels, and no plotting stack – one SVG path (or a row of bars) that stretches to fill its box. Every mark is painted with the theme’s chart tokens, so the light/dark switch at the top of this page restyles these in CSS, with no re-render.

Code
shad_sparkline(c(31, 40, 28, 51, 42, 62, 58, 70), type = "line")
shad_sparkline(c(31, 40, 28, 51, 42, 62, 58, 70), type = "area")
shad_sparkline(c(31, 40, 28, 51, 42, 62, 58, 70), type = "bar", color = 2)
shad_sparkline(c(31, 40, 28, 51, 42, 62, 58, 70), type = "step", color = 3)

Non-finite values break the series rather than being interpolated across, and bars hang off a zero baseline once the data crosses it:

Code
shad_sparkline(c(4, 9, NA, NA, 6, 12, 8), type = "area")
shad_sparkline(c(-4, -1, 2, 5, -3, 6), type = "bar", color = 4)

Dropped into shad_value_box(sparkline = ) it fills the strip at the foot of the card:

Revenue
$45,231 +20.1%
Subscribers
2,350 +180
Code
shad_value_box("$45,231", "Revenue", delta = "+20.1%", sparkline = shad_sparkline(c(31, 40, 28, 51, 42, 62), type = "area"))
shad_value_box("2,350", "Subscribers", delta = "+180", sparkline = shad_sparkline(c(12, 19, 15, 27, 24, 31), type = "bar", color = 2))

Mini donut

A shadshiny addition: no shadcn/ui counterpart.

shad_mini_donut() shows a few parts of a whole, with optional content in the middle. thickness = 1 gives a pie.

62%
Code
shad_mini_donut(c(62, 24, 14), center = "62%")
shad_mini_donut(c(3, 1), size = "5rem", thickness = 0.5)
shad_mini_donut(c(3, 1), size = "5rem", thickness = 1)
shad_mini_donut(c(1, 1, 1, 1, 1), size = "5rem")

Chart container

shad_chart_container() is the card shell around a plotOutput() or any htmlwidget, with an optional legend strip. The stage below holds a static image in place of a plot, since these pages have no R server behind them.

Revenue by month
Jan – Jun 2026
This year Last year
Code
shad_chart_container(title = "Revenue by month", description = "Jan – Jun 2026", legend = TRUE, legend_labels = c("This year", "Last year"), aspect = "wide", shad_skeleton(width = "100%", height = "100%"))

In an app the child is your plot, and shad_theme_ggplot2() (or the plotly / echarts4r equivalents) restyles the figure onto the active palette:

output$plot <- renderPlot({
  shad_current_theme()          # re-render when the theme changes at runtime
  ggplot(df, aes(month, revenue)) +
    geom_col(fill = shad_chart_colors(1)) +
    shad_theme_ggplot2()
})

Timeline

A shadshiny addition: no shadcn/ui counterpart.

  1. Order placed
    Payment authorised.
  2. Packed
    Left the fulfilment centre.
  3. In transit
    Out for delivery.
  4. Delivered
    Expected today by 18:00.
Code
shad_timeline(shad_timeline_item("Order placed", time = "09:14", description = "Payment authorised.", icon = "check"), shad_timeline_item("Packed", time = "11:02", description = "Left the fulfilment centre.", icon = "package"), shad_timeline_item("In transit", time = "14:30", status = "active", description = "Out for delivery.", icon = "map-pin"), shad_timeline_item("Delivered", status = "muted", last = TRUE, description = "Expected today by 18:00.", icon = "home"))

Stepper

A shadshiny addition: no shadcn/ui counterpart.

shad_stepper() holds the 1-based index of the active step. linear = TRUE stops the user skipping ahead of the current step.

Code
shad_stepper("wiz", active = 2, shad_step("Account", description = "Email and password"), shad_step("Profile", description = "Name and avatar"), shad_step("Billing", description = "Card details"), shad_step("Done", description = "Confirm"))
shad_stepper("wiz_v", active = 2, orientation = "vertical", shad_step("Draft"), shad_step("In review", description = "Waiting on a second approver"), shad_step("Published", error = TRUE))

Tree

A shadshiny addition: no shadcn/ui counterpart.

shad_tree_item() takes the value first, then the label. Nest items to build branches; lazy = TRUE marks a branch whose children arrive later via update_shad_tree(children=).

  • R
    • app.R
    • ui.R
  • README.md
Code
shad_tree("files", selected = "app.R", selection = "single", shad_tree_item("R", "R", icon = "folder", expanded = TRUE, shad_tree_item("app.R", "app.R", icon = "file"), shad_tree_item("ui.R", "ui.R", icon = "file")), shad_tree_item("www", "www", icon = "folder", shad_tree_item("style.css", "style.css", icon = "file")), shad_tree_item("data", "data", icon = "folder", lazy = TRUE), shad_tree_item("README", "README.md", icon = "file"))

Rating

A shadshiny addition: no shadcn/ui counterpart.

Code
shad_rating("r1", label = "Rating", value = 3)
shad_rating("r2", label = "Half steps", value = 3.5, half = TRUE)
shad_rating("r3", label = "Read-only", value = 4, readonly = TRUE)
shad_rating("r4", label = "Ten stars", value = 7, max = 10, size = "sm")

Number input

A shadshiny addition: no shadcn/ui counterpart.

A text input with hold-to-repeat stepper buttons. precision fixes the decimal places; min / max clamp the value.

Code
shad_number_input("qty", label = "Quantity", value = 1, min = 0, max = 99)
shad_number_input("price", label = "Price", value = 9.99, step = 0.01, precision = 2)
shad_number_input("dis", label = "Disabled", value = 5, disabled = TRUE)

Dropzone

A shadshiny addition: no shadcn/ui counterpart.

shad_dropzone() bridges to a hidden fileInput(), so input$<id> is the standard Shiny files data frame (name, size, type, datapath) – every renderTable(input$files) you already have keeps working.

CSV or Excel, up to 5 MB each
PNG or JPG, square works best
Code
shad_dropzone("files", label = "Attachments", multiple = TRUE, accept = c(".csv", ".xlsx"), hint = "CSV or Excel, up to 5 MB each")
shad_dropzone("avatar", label = "Avatar", accept = "image/*", hint = "PNG or JPG, square works best")

Form messaging

shad_form_summary() is a shadshiny addition; the rest mirrors shadcn/ui’s Form messaging.

The pieces shad_validator() drives from the server. In an app you rarely place these by hand – the validator sets them for you – but they’re plain components.

Looks good.
Enter a valid email address.
This name is already taken.
214/280
Code
shad_form_message("Looks good.", type = "success")
shad_form_message("Enter a valid email address.", type = "error")
shad_form_message("This name is already taken.", type = "warning")
shad_form_counter(214, 280)
shad_form_summary("errs", errors = c(email = "Enter a valid email address.", pw = "Password must be at least 8 characters."))

See also