htmlButton: Button component

View source: R/dashHtmlComponents.R

htmlButtonR Documentation

Button component

Description

Button is a wrapper for the <button> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button

Usage

htmlButton(children=NULL, id=NULL, n_clicks=NULL,
n_clicks_timestamp=NULL, key=NULL, role=NULL,
autoFocus=NULL, disabled=NULL, form=NULL, formAction=NULL,
formEncType=NULL, formMethod=NULL, formNoValidate=NULL,
formTarget=NULL, name=NULL, type=NULL, value=NULL,
accessKey=NULL, className=NULL, contentEditable=NULL,
contextMenu=NULL, dir=NULL, draggable=NULL, hidden=NULL,
lang=NULL, spellCheck=NULL, style=NULL, tabIndex=NULL,
title=NULL, loading_state=NULL, ...)

Arguments

children

A list of or a singular dash component, string or number. The children of this component

id

Character. The ID of this component, used to identify dash components in callbacks. The ID needs to be unique across all of the components in an app.

n_clicks

Numeric. An integer that represents the number of times that this element has been clicked on.

n_clicks_timestamp

Numeric. An integer that represents the time (in ms since 1970) at which n_clicks changed. This can be used to tell which button was changed most recently.

key

Character. A unique identifier for the component, used to improve performance by React.js while rendering components See https://reactjs.org/docs/lists-and-keys.html for more info

role

Character. The ARIA role attribute

autoFocus

A value equal to: 'autofocus', 'autofocus', 'autofocus' | logical. The element should be automatically focused after the page loaded.

disabled

A value equal to: 'disabled', 'disabled' | logical. Indicates whether the user can interact with the element.

form

Character. Indicates the form that is the owner of the element.

formAction

Character. Indicates the action of the element, overriding the action defined in the <form>.

formEncType

Character. If the button/input is a submit button (type="submit"), this attribute sets the encoding type to use during form submission. If this attribute is specified, it overrides the enctype attribute of the button's form owner.

formMethod

Character. If the button/input is a submit button (type="submit"), this attribute sets the submission method to use during form submission (GET, POST, etc.). If this attribute is specified, it overrides the method attribute of the button's form owner.

formNoValidate

A value equal to: 'formnovalidate', 'formnovalidate', 'formnovalidate' | logical. If the button/input is a submit button (type="submit"), this boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the novalidate attribute of the button's form owner.

formTarget

Character. If the button/input is a submit button (type="submit"), this attribute specifies the browsing context (for example, tab, window, or inline frame) in which to display the response that is received after submitting the form. If this attribute is specified, it overrides the target attribute of the button's form owner.

name

Character. Name of the element. For example used by the server to identify the fields in form submits.

type

Character. Defines the type of the element.

value

Character. Defines a default value which will be displayed in the element on page load.

accessKey

Character. Keyboard shortcut to activate or add focus to the element.

className

Character. Often used with CSS to style elements with common properties.

contentEditable

Character. Indicates whether the element's content is editable.

contextMenu

Character. Defines the ID of a <menu> element which will serve as the element's context menu.

dir

Character. Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)

draggable

Character. Defines whether the element can be dragged.

hidden

A value equal to: 'hidden', 'hidden' | logical. Prevents rendering of given element, while keeping child elements, e.g. script elements, active.

lang

Character. Defines the language used in the element.

spellCheck

Character. Indicates whether spell checking is allowed for the element.

style

Named list. Defines CSS styles which will override styles previously set.

tabIndex

Character. Overrides the browser's default tab order and follows the one specified instead.

title

Character. Text to be displayed in a tooltip when hovering over the element.

loading_state

Lists containing elements 'is_loading', 'prop_name', 'component_name'. those elements have the following types: - is_loading (logical; optional): determines if the component is loading or not - prop_name (character; optional): holds which property is loading - component_name (character; optional): holds the name of the component that is loading. Object that holds the loading state object coming from dash-renderer

...

wildcards allowed have the form: ''data-*', 'aria-*''

Value

named list of JSON elements corresponding to React.js properties and their values

Examples

if (interactive()) {
  library(dash)

  app <- Dash$new()

  app$layout(
    htmlDiv(list(
      htmlButton("Click me!")
      )
    )
  )

  app$run_server()
}

dash documentation built on June 23, 2022, 9:11 a.m.