wa_button: Create a 'wa-button' component

View source: R/wa_button.R

wa_buttonR Documentation

Create a wa-button component

Description

Generated wrapper for the Web Awesome wa-button component. When used as a Shiny input, the component exposes action semantics through ⁠input$<input_id>⁠. The Shiny input invalidates on each committed action rather than publishing a durable value payload. Each committed action publishes a numeric action value. Generated from Web Awesome metadata.

Usage

wa_button(
  input_id,
  ...,
  class = NULL,
  style = NULL,
  value = NULL,
  disabled = NULL,
  name = NULL,
  appearance = NULL,
  custom_error = NULL,
  dir = NULL,
  download = NULL,
  formaction = NULL,
  formenctype = NULL,
  formmethod = NULL,
  formnovalidate = NULL,
  formtarget = NULL,
  href = NULL,
  lang = NULL,
  loading = NULL,
  pill = NULL,
  rel = NULL,
  size = NULL,
  target = NULL,
  title = NULL,
  type = NULL,
  variant = NULL,
  with_caret = NULL,
  with_end = NULL,
  with_start = NULL,
  end = NULL,
  start = NULL
)

Arguments

input_id

Shiny input id for the component. This is also used as the rendered DOM id attribute.

...

Child content for the component's default slot.

class

Optional CSS class string.

style

Optional inline CSS style string.

value

String. The value of the button, submitted as a pair with the button's name as part of the form data, but only when this button is the submitter. This attribute is ignored when href is present.

disabled

Boolean. Default: FALSE. Disables the button.

name

String. Default: null. The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter. This attribute is ignored when href is present.

appearance

Enumerated string. Allowed values: accent, filled, filled-outlined, outlined, plain. Default: accent. The button's visual appearance.

custom_error

String. Default: null. Optional Web Awesome attribute.

dir

String. Optional Web Awesome attribute.

download

String. Tells the browser to download the linked file as this filename. Only used when href is present.

formaction

String. Used to override the form owner's action attribute. This wrapper argument sets the HTML formaction attribute, which maps to the component's formAction field/property.

formenctype

Enumerated string. Allowed values: application/x-www-form-urlencoded, multipart/form-data, text/plain. Used to override the form owner's enctype attribute. This wrapper argument sets the HTML formenctype attribute, which maps to the component's formEnctype field/property.

formmethod

Enumerated string. Allowed values: get, post. Used to override the form owner's method attribute. This wrapper argument sets the HTML formmethod attribute, which maps to the component's formMethod field/property.

formnovalidate

Boolean. Default: FALSE. Used to override the form owner's novalidate attribute. This wrapper argument sets the HTML formnovalidate attribute, which maps to the component's formNoValidate field/property.

formtarget

Used to override the form owner's target attribute. This wrapper argument sets the HTML formtarget attribute, which maps to the component's formTarget field/property.

href

String. When set, the underlying button will be rendered as an ⁠<a>⁠ with this href instead of a ⁠<button>⁠.

lang

String. Optional Web Awesome attribute.

loading

Boolean. Default: FALSE. Draws the button in a loading state.

pill

Boolean. Default: FALSE. Draws a pill-style button with rounded edges.

rel

String. When using href, this attribute will map to the underlying link's rel attribute.

size

Enumerated string. Allowed values: large, medium, small. Default: medium. The button's size.

target

Enumerated string. Allowed values: ⁠_blank⁠, ⁠_parent⁠, ⁠_self⁠, ⁠_top⁠. Tells the browser where to open the link. Only used when href is present.

title

String. Default: "". Optional Web Awesome attribute.

type

Enumerated string. Allowed values: button, reset, submit. Default: button. The type of button. Note that the default value is button instead of submit, which is opposite of how native ⁠<button>⁠ elements behave. When the type is submit, the button will submit the surrounding form.

variant

Enumerated string. Allowed values: brand, danger, neutral, success, warning. Default: neutral. The button's theme variant. Defaults to neutral if not within another element with a variant.

with_caret

Boolean. Default: FALSE. Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior.

with_end

Boolean. Default: FALSE. Only required for SSR. Set to TRUE if you're slotting in an end element so the server-rendered markup includes the end slot before the component hydrates on the client.

with_start

Boolean. Default: FALSE. Only required for SSR. Set to TRUE if you're slotting in a start element so the server-rendered markup includes the start slot before the component hydrates on the client.

end

An element, such as ⁠<wa-icon>⁠, placed after the label.

start

An element, such as ⁠<wa-icon>⁠, placed before the label.

Value

An HTML tag for the component.

Shiny Bindings

⁠input$<input_id>⁠ uses action semantics and invalidates on each committed action rather than publishing a durable value payload. The Shiny action value is returned as a numeric action value.


shiny.webawesome documentation built on April 22, 2026, 1:09 a.m.