Learn R Programming

calcite (version 1.0.0)

calcite_action_bar: Create a Calcite Action Bar Component

Description

Action Bar is composed of calcite_action()s used for core operations in the interface. When given an id, it acts as a Shiny input that reports the text of the currently active action as input$id.

Usage

calcite_action_bar(
  ...,
  id = NULL,
  expand_disabled = NULL,
  expanded = NULL,
  floating = NULL,
  layout = NULL,
  overflow_actions_disabled = NULL,
  position = NULL,
  scale = NULL
)

Value

An object of class calcite_component

Arguments

...

calcite_action() or calcite_action_group() components

id

Optional ID. When provided, input$id will contain the text of the currently active action.

expand_disabled

When TRUE, disables the expand/collapse toggle.

expanded

When TRUE, the action bar is expanded showing text labels.

floating

When TRUE, the component is in a floating state.

layout

Layout direction of the actions: "vertical", "horizontal", or "grid".

overflow_actions_disabled

When TRUE, disables automatic overflowing of actions into menus.

position

Position of the component: "start" or "end".

scale

Size of the expand action: "s", "m", or "l".

Details

Shiny Integration

When id is provided, input$id returns the text of the currently active calcite_action(). The action bar manages active state automatically — clicking an action activates it and deactivates all others.

observeEvent(input$my_bar, {
  cat("Active action:", input$my_bar, "\n")
})

Use update_calcite() to programmatically set the active action by passing the text value of the action to activate.

References

Official Documentation

Examples

Run this code
calcite_action_bar(
  id = "my_bar",
  calcite_action(text = "Layers", icon = "layers", active = TRUE),
  calcite_action(text = "Legend", icon = "legend")
)

Run the code above in your browser using DataLab