ds_button: Button Component

View source: R/ds-button.R

ds_buttonR Documentation

Button Component

Description

Create a styled button using Designsystemet styles. ds_action_button() is a drop-in replacement for shiny::actionButton() with the same ⁠(inputId, label, ...)⁠ argument order.

Usage

ds_button(
  label,
  inputId = NULL,
  variant = c("primary", "secondary", "tertiary"),
  size = NULL,
  icon = FALSE,
  loading = FALSE,
  disabled = FALSE,
  fullwidth = FALSE,
  type = "button",
  ...
)

ds_action_button(inputId, label, ...)

Arguments

label

The button label.

inputId

Input ID (first argument, matching shiny::actionButton).

variant

Button variant: "primary", "secondary", or "tertiary".

size

Size variant: "sm", "md", or "lg".

icon

If TRUE, creates an icon-only button.

loading

If TRUE, shows loading state.

disabled

If TRUE, disables the button.

fullwidth

If TRUE, makes the button full width.

type

Button type: "button", "submit", or "reset".

...

Additional attributes.

Value

A Shiny tag object.

Examples

ds_button("Click me", inputId = "btn")
ds_button("Submit", variant = "primary", type = "submit")
ds_button("Cancel", variant = "secondary")
ds_action_button("btn", "Click me")

shinyds documentation built on Aug. 22, 2026, 5:08 p.m.