metroWindow: Create a Metro 4 window

Description Usage Arguments Note Author(s) Examples

View source: R/metroWindow.R

Description

Build a Metro window

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
metroWindow(
  ...,
  title = NULL,
  icon = NULL,
  shadow = TRUE,
  header_color = NULL,
  content_color = NULL,
  content_text_color = NULL,
  minimize = TRUE,
  closable = TRUE,
  draggable = FALSE,
  resizable = FALSE,
  width = NULL,
  height = NULL
)

Arguments

...

Any UI element.

title

Window title.

icon

Window icon.

shadow

Whether to display a shadow around the window. TRUE by default.

header_color

Header background color.

content_color

Content background color.

content_text_color

Content text color.

minimize

Whether the window can be minimized. TRUE by default.

closable

Whether the window can be closed. TRUE by default.

draggable

Whether the window can be dragged. FALSE by default.

resizable

Whether the window can be resized. FALSE by default.

width

Window width.

height

Window height.

Note

It is better to use only 2 windows per page and embed them as in the example below.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
if(interactive()){
 library(shiny)
 library(shinyMetroUi)

 shiny::shinyApp(
  ui = metroPage(
    allow_loading = TRUE,
    fluidRow(
      metroCell(
        metroWindow(
          title = "Window",
          resizable = TRUE,
          width = "100%",
          header_color = "red",
          content_color = "black",
          content_text_color = "yellow",
          # content
          metroTilesGrid(
            metroTile(
              size = "small",
              color = "indigo",
              icon = "github",
              url = "https://github.com/olton/Metro-UI-CSS"),
            metroTile(size = "small", color = "green", icon = "envelop"),
            metroTile(size = "small", color = "blue", col_position = 1, row_position = 2),
            metroTile(size = "small", color = "orange", col_position = 2, row_position = 2),
            metroTile(
              size = "wide",
              color = "pink",
              sliderInput("obs", "Number of observations:",
                          min = 0, max = 1000, value = 500
              )
            ),
            metroTile(
              size = "large",
              color = "green",
              selected = TRUE,
              plotOutput("distPlot")
            )
          )
        )
      ),
      metroCell(
        metroWindow(
          title = "Window",
          resizable = TRUE,
          width = "100%",
          header_color = "red",
          content_color = "black",
          content_text_color = "yellow",
          # content
          metroTilesGrid(
            metroTile(size = "large",color = "brown", icon = "windows"),
            metroTile(size = "wide", color = "crimson", icon = "envelop"),
            metroTile(size = "small", color = "cobalt", col_position = 1, row_position = 2),
            metroTile(size = "small", color = "olive", col_position = 2, row_position = 2)
          )
        )
      )
    )
  ),
  server = function(input, output) {
    output$distPlot <- renderPlot({
      hist(rnorm(input$obs))
    })
  }
 )
}

RinteRface/shinyMetroUi documentation built on Dec. 31, 2019, 8:47 a.m.