AlmondCSS: Almond.CSS

AlmondCSSR Documentation

Almond.CSS

Description

A ...

Super class

classless::Classless -> AlmondCSS

Methods

Public methods

Inherited methods

Method new()

Create a new Almond.CSS object

Usage
AlmondCSS$new()
Returns

A new AlmondCSS object


Method createPage()

Create a page with Almond.CSS

Usage
AlmondCSS$createPage(..., title = NULL, lang = NULL)
Arguments
...

The contents of the document body

title

The browser window title (defaults to the host URL of the page)

lang

ISO 639-1 language code for the HTML page


Method textInput()

Create an input control for entry of unstructured text values

Usage
AlmondCSS$textInput(
  input_id,
  label,
  value = "",
  placeholder = "",
  inline = FALSE
)
Arguments
input_id

The input slot that will be used to access the value.

label

Display label for the control

value

Initial value

placeholder

A character string giving the user a hint as to what can be entered into the control

inline

Logical, whether the component is in-line with sibling elements

Returns

A text input control that can be added to a UI definition


Method passwordInput()

Create an password control for entry of passwords

Usage
AlmondCSS$passwordInput(
  input_id,
  label,
  value = "",
  placeholder = "",
  inline = FALSE
)
Arguments
input_id

The input slot that will be used to access the value.

label

Display label for the control

value

Initial value

placeholder

A character string giving the user a hint as to what can be entered into the control

inline

Logical, whether the component is in-line with sibling elements

Returns

A password input control that can be added to a UI definition


Method textAreaInput()

Create a textarea input control for entry of unstructured text values

Usage
AlmondCSS$textAreaInput(
  input_id,
  label,
  value = "",
  placeholder = "",
  inline = FALSE
)
Arguments
input_id

The input slot that will be used to access the value.

label

Display label for the control

value

Initial value

placeholder

A character string giving the user a hint as to what can be entered into the control

inline

Logical, whether the component is in-line with sibling elements

Returns

A textarea input control that can be added to a UI definition


Method numericInput()

Create a numeric input control for entry of unstructured text values

Usage
AlmondCSS$numericInput(
  input_id,
  label,
  value = "",
  min = NULL,
  max = NULL,
  placeholder = "",
  inline = FALSE
)
Arguments
input_id

The input slot that will be used to access the value.

label

Display label for the control

value

Initial value

min

Minimum valid value

max

Maximum valid value

placeholder

A character string giving the user a hint as to what can be entered into the control

inline

Logical, whether the component is in-line with sibling elements

Returns

A numeric input control that can be added to a UI definition


Method dateInput()

Create a date input control for entry of unstructured text values

Usage
AlmondCSS$dateInput(
  input_id,
  label,
  value = "",
  min = NULL,
  max = NULL,
  placeholder = "",
  inline = FALSE
)
Arguments
input_id

The input slot that will be used to access the value.

label

Display label for the control

value

Initial value

min

Minimum valid value

max

Maximum valid value

placeholder

A character string giving the user a hint as to what can be entered into the control

inline

Logical, whether the component is in-line with sibling elements

Returns

A date input control that can be added to a UI definition


Method selectInput()

Create a select list that can be used to choose a single or multiple items from a list of values

Usage
AlmondCSS$selectInput(
  input_id,
  label,
  choices,
  selected = NULL,
  multiple = FALSE,
  inline = FALSE
)
Arguments
input_id

The input slot that will be used to access the value.

label

Display label for the control

choices

List of values to select from

selected

The initially selected value (or multiple values if multiple = TRUE).

multiple

Is selection of multiple items allowed?

inline

Logical, whether the component is in-line with sibling elements

Returns

A select list control that can be added to a UI definition


Method almondInput()

Almond.css adds a couple of tags to inputs that some classless inputs don't have

Usage
AlmondCSS$almondInput(input, inline = FALSE)
Arguments
input

Some UI input

inline

Logical, whether the component is in-line with sibling elements


Method clone()

The objects of this class are cloneable with this method.

Usage
AlmondCSS$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Source

<https://github.com/alvaromontoro/almond.css>

See Also

almondPage

selectCLInput Convert Classless Input to Almond.css Input

Examples

library(shiny)
library(classless)

almond <- AlmondCSS$new()

ui <- almond$createPage(
  tags$header(
    "Almond Application"
  ),
  tags$body(
    tags$section(
      tags$h2("Contents"),
      tags$p("Paragraph")
    ),
    tags$section(
      tags$h2("Inputs"),
      tags$form(
        almond$textInput("text", "Text Input"),
        almond$numericInput("number", "Numeric Input")
      )
    )
  )
)

if (interactive()) {
  server <- function(input, output, session) {}
  shinyApp(ui, server)
}


ashbaldry/classless documentation built on June 2, 2022, 12:55 a.m.