Skip to contents

Emits <section class="el-container"> directly, as Element does.

Usage

el_container(
  ...,
  id = NULL,
  direction = NULL,
  style = NULL,
  class = NULL,
  session = NULL
)

Arguments

...

Child components, typically el_header(), el_aside(), el_main() and el_footer().

id

Optional container id.

direction

"horizontal" or "vertical". Defaults to vertical when a direct child is a header or footer, matching Element Plus.

style

Extra inline style.

class

Extra CSS classes.

session

Deprecated. Inside a module, wrap id in ns(), as for any Shiny input; a session given here namespaces id once more, with a warning.

Value

A Shiny UI element.

Details

Element's container styles are plain CSS, so no Vue instance is needed – and none is wanted: one mounted over the container would recompile the components placed inside it and detach them.

Binding

No argument follows v_bind(): a layout drawn as markup by R.

Examples

# Header above a sidebar and main area
el_container(
  el_header("Title"),
  el_container(
    el_aside(width = "200px", "Sidebar"),
    el_main("Content")
  )
)
#> <section class="el-container is-vertical">
#>   <header class="el-header" style="--el-header-height:60px">Title</header>
#>   <section class="el-container">
#>     <aside class="el-aside" style="--el-aside-width:200px">Sidebar</aside>
#>     <main class="el-main">Content</main>
#>   </section>
#> </section>

# Nested inputs work, unlike with the previous Vue template approach
el_container(
  el_header(el_switch("dark_mode", value = FALSE)),
  el_main(el_slider("amount", value = 50))
)
#> <section class="el-container is-vertical">
#>   <header class="el-header" style="--el-header-height:60px">
#>     <div id="dark_mode" data-shiny-vue style="display: contents">
#>       <script type="text/x-template" data-shiny-vue-template><div id="dark_mode_container" style="display: contents">
#>   <el-switch v-bind="$optional(&#39;switch&#39;)" v-model="value" :disabled="disabled" :active-text="activeText" :inactive-text="inactiveText" :style="{ &#39;--el-switch-on-color&#39;: activeColor || undefined, &#39;--el-switch-off-color&#39;: inactiveColor || undefined, &#39;--el-switch-border-color&#39;: borderColor || undefined }" :active-value="activeValue" :inactive-value="inactiveValue" @change="handleChange"></el-switch>
#> </div></script>
#>       <script type="application/json" data-shiny-vue-options>{"options":{"data":{"value":false,"disabled":false,"activeText":"","inactiveText":"","activeColor":"","inactiveColor":"","activeValue":true,"inactiveValue":false,"width":null,"name":null,"validateEvent":null,"activeActionIcon":null,"activeIcon":null,"ariaLabel":null,"beforeChange":null,"borderColor":null,"inactiveActionIcon":null,"inactiveIcon":null,"inlinePrompt":null,"loading":null,"size":null,"tabindex":null},"methods":{"handleChange":"function(value) { }"}},"input":"value","rate":null,"type":null,"use":["shinyElement.plugin"],"optional":{"switch":{"width":"width","name":"name","validate-event":"validateEvent","active-action-icon":"activeActionIcon","active-icon":"activeIcon","aria-label":"ariaLabel","before-change":"beforeChange","border-color":"borderColor","inactive-action-icon":"inactiveActionIcon","inactive-icon":"inactiveIcon","inline-prompt":"inlinePrompt","loading":"loading","size":"size","tabindex":"tabindex"}},"evals":["options.methods.handleChange"]}</script>
#>     </div>
#>   </header>
#>   <main class="el-main">
#>     <div id="amount" data-shiny-vue style="display: contents">
#>       <script type="text/x-template" data-shiny-vue-template><div id="amount_container" style="display: contents">
#>   <el-slider v-bind="$optional(&#39;slider&#39;)" v-model="value" :min="min" :max="max" :step="step" :range="range" :disabled="disabled" :show-input="showInput" :show-stops="showStops" :show-tooltip="showTooltip" :vertical="vertical" @change="handleChange"></el-slider>
#> </div></script>
#>       <script type="application/json" data-shiny-vue-options>{"options":{"data":{"value":50,"min":0,"max":100,"step":1,"range":false,"disabled":false,"showInput":false,"showStops":false,"showTooltip":true,"vertical":false,"height":null,"marks":null,"label":null,"inputSize":null,"showInputControls":null,"tooltipClass":null,"formatTooltip":null,"ariaLabel":null,"formatValueText":null,"persistent":null,"placement":null,"rangeEndLabel":null,"rangeStartLabel":null,"size":null,"validateEvent":null},"methods":{"handleChange":"function(value) { }"}},"input":"value","rate":{"policy":"debounce","delay":250},"type":null,"use":["shinyElement.plugin"],"optional":{"slider":{"height":"height","marks":"marks","label":"label","input-size":"inputSize","show-input-controls":"showInputControls","tooltip-class":"tooltipClass","format-tooltip":"formatTooltip","aria-label":"ariaLabel","format-value-text":"formatValueText","persistent":"persistent","placement":"placement","range-end-label":"rangeEndLabel","range-start-label":"rangeStartLabel","size":"size","validate-event":"validateEvent"}},"evals":["options.methods.handleChange"]}</script>
#>     </div>
#>   </main>
#> </section>