Package 'w3css'

Title: W3CSS for 'shiny'
Description: An implementation of W3 CSS <https://www.w3schools.com/w3css/> for 'shiny'.
Authors: Colin Fay [aut, cre]
Maintainer: Colin Fay <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9004
Built: 2024-06-21 02:28:53 UTC
Source: https://github.com/ThinkR-open/w3css

Help Index


W3.CSS Buttons

Description

Implementation of W3.CSS Buttons, as described in https://www.w3schools.com/w3css/w3css_buttons.asp

Usage

w3_actionButton(
  inputId,
  label,
  type = c("btn", "button", "bar", "block", "circle", "ripple"),
  ...
)

Arguments

inputId

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

label

The contents of the button or link–usually a text label, but you could also use any other HTML, like an image.

type

Class to apply to the button

...

Named attributes to be applied to the button or link.

Value

a UI element

Examples

w3_actionButton("ok", "Go")

W3.CSS Animations

Description

Implementation of W3.CSS Animations, as described in https://www.w3schools.com/w3css/w3css_animate.asp

Usage

w3_animate_top()

w3_animate_bottom()

w3_animate_left()

w3_animate_right()

w3_animate_opacity()

w3_animate_zoom()

w3_animate_fading()

w3_spin()

Value

A W3 CSS class.

Examples

w3_animate_top()

W3.CSS Badges

Description

Implementation of W3.CSS Badges, as described in https://www.w3schools.com/w3css/w3css_badges.asp

Usage

w3_badge()

Value

A CSS class.

Examples

w3_badge()

W3.CSS Borders

Description

Implementation of W3.CSS borders, as described in www.w3schools.com/w3css/w3css_borders.asp.

Usage

w3_border()

w3_border_top()

w3_border_right()

w3_border_bottom()

w3_border_left()

w3_border_0()

w3_border_color(color)

w3_hover_border_color(color)

w3_bottombar()

w3_leftbar(color)

w3_rightbar(color)

w3_topbar(color)

Arguments

color

One of W3 css color

Value

A W3 CSS class.

Examples

w3_border()
w3_border_top()

W3.CSS Colors

Description

Implementation of W3.CSS colors, as described in www.w3schools.com/w3css/w3css_colors.asp.

Usage

w3_color(color)

w3_text_color(color)

w3_hover_color(color)

Arguments

color

One of W3 css color

Value

A css class

Examples

w3_color("red")
w3_color("pink")
w3_color("blue")

W3.CSS colors

Description

W3.CSS colors

Usage

w3_colors

Format

A vector of colors

Source

https://www.w3schools.com/w3css/w3css_colors.asp


W3.CSS Containers

Description

Implementation of W3.CSS Containers, as described in https://www.w3schools.com/w3css/w3css_containers.asp

Usage

w3_container(..., type = "div")

Arguments

...

Content of the container

type

HTML tag to use as a container. Default is div.

Value

A tag.

Examples

# Simple container
w3_container("hey there")
# Container with a 'teal'-colored background
w3_container("hey there", class = w3_color("teal"))

W3.CSS Dropdowns

Description

Implementation of W3.CSS Dropdowns, as described in https://www.w3schools.com/w3css/w3css_dropdowns.asp

Usage

w3_dropdown(
  button_text = "Hover Over Me!",
  content = list(),
  button_class = NULL,
  content_style = NULL
)

Arguments

button_text

Text to display inside the button

content

Content of the dropdown

button_class

Additional class to add to the button

content_style

Additional style to add to the content tag

Value

An HTML div tag

Examples

w3_dropdown(
  button_text = "Hover Over Me!",
  content = "and I'll show you something cool",
)

W3.CSS Built-In Responsiveness

Description

Implementation of W3.CSS Built-In Responsiveness, as described in https://www.w3schools.com/w3css/w3css_responsive.asp

Usage

w3_half(...)

w3_third(...)

w3_twothird(...)

w3_quarter(...)

w3_threequarter(...)

w3_rest(...)

w3_col(...)

Arguments

...

UI elements to include

Value

a UI element.

Examples

w3_half("hey there")

W3.CSS Text

Description

Implementation of W3.CSS Text, as described in https://www.w3schools.com/w3css/w3css_text.asp

Usage

w3_left_align()

w3_right_align()

w3_center()

w3_wide()

w3_opacity()

Value

A CSS Class

Examples

w3_left_align()

W3.CSS Lists

Description

Implementation of W3.CSS Lists, as described in https://www.w3schools.com/w3css/w3css_lists.asp

Usage

w3_list(..., ul_class = "")

Arguments

...

a list tagList

ul_class

Additional CSS class for the ul.

Value

a tagList

Examples

w3_list(
  htmltools::tags$li("one")
)

W3.CSS Modal

Description

Implementation of W3.CSS Modal, as described in https://www.w3schools.com/w3css/w3css_modal.asp

Usage

w3_modal(
  inputId,
  title = "",
  body = "",
  footer = "",
  color = "",
  display = "none"
)

w3_show_modal(inputId, session = shiny::getDefaultReactiveDomain())

w3_hide_modal(inputId, session = shiny::getDefaultReactiveDomain())

Arguments

inputId

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

title, body, footer

Content to add in the modal

color

W3 CSS Color

display

Display style of the modal (either 'none' or 'block')

session

The session object passed to function given to shinyServer. Default is getDefaultReactiveDomain().

Value

a modal UI, or used for side effects.

Examples

w3_modal("one modal")

W3.CSS Padding

Description

Implementation of W3.CSS Padding, as described in https://www.w3schools.com/w3css/w3css_padding.asp

Usage

w3_padding(value = c("", 16, 24, 32, 48, 64, "small", "large"))

Arguments

value

The value of the padding. Must be one of "", 16, 24, 32, 48, 64, "small", or "large".

Value

A CSS class

Examples

w3_padding(16)

W3 CSS Page

Description

W3 CSS Page

Usage

w3_page(...)

Arguments

...

Content of the page

Value

A shiny UI using W3.CSS

Examples

w3_page("hey there")

W3.CSS Panels

Description

Implementation of W3.CSS colors, as described in www.w3schools.com/w3css/w3css_panels.asp.

Usage

w3_panel(..., with_close = FALSE)

Arguments

...

Content of the panel.

with_close

Add a close button to the panel.

Value

A tag.

Examples

# Simple container
w3_panel("hey there")
# Container with a 'teal'-colored background
w3_panel("hey there", class = w3_color("teal"))

W3.CSS Input

Description

Implementation of W3.CSS Input, as described in https://www.w3schools.com/w3css/w3css_input.asp

Usage

w3_radioButton(inputId, label, choices, choiceNames = NULL)

w3_selectInput(inputId, label, choices, selected = NULL)

w3_updateSelectInput(
  inputId,
  label = NULL,
  choices = NULL,
  session = shiny::getDefaultReactiveDomain()
)

w3_textInput(inputId, label, placeholder = "")

w3_passwordInput(inputId, label, placeholder = "")

w3_dateInput(inputId, label, value = Sys.Date(), min = "", max = "")

w3_editableListInput(inputId, label, choices, ul_class = "", li_class = "")

w3_numericInput(
  inputId,
  label,
  value = NULL,
  min,
  max,
  step = NULL,
  placeholder = ""
)

w3_updateNumericInput(
  inputId,
  label = NULL,
  placeholder = NULL,
  value = NULL,
  min = NULL,
  max = NULL,
  step = NULL,
  session = shiny::getDefaultReactiveDomain()
)

w3_checkbox(inputId, label, value = FALSE)

w3_checkboxGroupInput(
  inputId,
  label = NULL,
  choices,
  selected = NULL,
  choiceNames = NULL
)

Arguments

inputId

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

label

Display label for the control, or NULL for no label.

choices

List of values to select from (if elements of the list are named then that name rather than the value is displayed to the user). If this argument is provided, then choiceNames and choiceValues must not be provided, and vice-versa. The values should be strings; other types (such as logicals and numbers) will be coerced to strings.

choiceNames

List of names and values, respectively, that are displayed to the user in the app and correspond to the each choice (for this reason, choiceNames and choiceValues must have the same length). If either of these arguments is provided, then the other must be provided and choices must not be provided. The advantage of using both of these over a named list for choices is that choiceNames allows any type of UI object to be passed through (tag objects, icons, HTML code, ...), instead of just simple text. See Examples.

selected

The initially selected value. If not specified, then it defaults to the first item in choices. To start with no items selected, use character(0).

session

The session object passed to function given to shinyServer. Default is getDefaultReactiveDomain().

placeholder

A character string giving the user a hint as to what can be entered into the control. Internet Explorer 8 and 9 do not support this option.

value

Initial value.

min

The minimum allowed date. Either a Date object, or a string in yyyy-mm-dd format.

max

The maximum allowed date. Either a Date object, or a string in yyyy-mm-dd format.

ul_class, li_class

CSS class for the internal elements.

step

Interval to use when stepping between min and max

Value

Input UI elements

Examples

w3_actionButton(
  "w3_actionButton",
  "Show Modal"
)