# toolbar() basic attributes and defaults Code show_raw_html(toolbar("Item 1", "Item 2")) Output
Item 1 Item 2
--- Code show_raw_html(toolbar("Item 1", "Item 2", gap = "10px")) Output
Item 1 Item 2
# toolbar() aligns correctly Code show_raw_html(toolbar("Item 1", "Item 2", align = "left")) Output
Item 1 Item 2
--- Code show_raw_html(toolbar("Item 1", "Item 2", align = "right")) Output
Item 1 Item 2
    # toolbar_input_button() tests

        Code
          show_raw_html(toolbar_input_button(id = "label_only", label = "Click me",
            show_label = TRUE))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "test_btn", label = "Click me", icon = shiny::icon(
            "star"), ))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "test_btn", label = "Click me", icon = shiny::icon(
            "star"), show_label = TRUE))
        Output
    # toolbar_input_button() disabled parameter

        Code
          show_raw_html(toolbar_input_button(id = "disabled_btn", label = "Disabled",
            disabled = TRUE, show_label = TRUE))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "enabled_btn", label = "Enabled",
            disabled = FALSE, show_label = TRUE))
        Output
    # toolbar_input_button() border parameter

        Code
          show_raw_html(toolbar_input_button(id = "no_border", label = "No Border",
            border = FALSE, show_label = TRUE))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "with_border", label = "With Border",
            border = TRUE, show_label = TRUE))
        Output
    # toolbar_input_button() tooltip parameter

        Code
          show_raw_html(toolbar_input_button(id = "tooltip_default", label = "Help",
            icon = shiny::icon("question")))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "tooltip_false", label = "No Tooltip",
            icon = shiny::icon("question"), tooltip = FALSE))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "tooltip_custom", label = "Help", icon = shiny::icon(
            "question"), tooltip = "Click for assistance"))
        Output
    ---

        Code
          show_raw_html(toolbar_input_button(id = "both_label_tooltip", label = "Save",
            icon = shiny::icon("save"), show_label = TRUE, tooltip = "Save your work"))
        Output
    # toolbar_divider() creates divider element

        Code
          show_raw_html(toolbar_divider())
        Output
--- Code show_raw_html(toolbar_divider(gap = "20px")) Output
    ---

        Code
          show_raw_html(toolbar_divider(width = "5px", gap = "2rem"))
        Output
    # toolbar_input_select() markup snapshots

        Code
          show_raw_html(toolbar_input_select(id = "select1", label = "Basic select",
            choices = c("A", "B", "C"), tooltip = FALSE))
        Output
Basic select
    ---

        Code
          show_raw_html(toolbar_input_select(id = "select2", label = "Select with selected",
            choices = c("Option 1", "Option 2", "Option 3"), selected = "Option 2",
            tooltip = FALSE))
        Output
Select with selected
    ---

        Code
          show_raw_html(toolbar_input_select(id = "select3", label = "Select with custom class",
            choices = c("X", "Y", "Z"), class = "bg-success-subtle", style = "width: 400px",
            tooltip = FALSE))
        Output
Select with custom class
# toolbar_input_select() handles grouped choices Code show_raw_html(grouped_select) Output
Grouped select
    # toolbar_input_select() tooltip parameter

        Code
          show_raw_html(toolbar_input_select(id = "tooltip_true", label = "My Select Label",
            choices = c("A", "B"), tooltip = TRUE))
        Output
My Select Label
    ---

        Code
          show_raw_html(toolbar_input_select(id = "with_tooltip", label = "With tooltip",
            choices = c("A", "B"), tooltip = "This is helpful information"))
        Output
With tooltip
    # toolbar_input_select() icon parameter

        Code
          show_raw_html(toolbar_input_select(id = "with_icon", label = "With icon",
            choices = c("A", "B"), icon = shiny::icon("filter"), tooltip = FALSE))
        Output
With icon
    ---

        Code
          show_raw_html(toolbar_input_select(id = "icon_tooltip", label = "Icon and tooltip",
            choices = c("A", "B"), icon = shiny::icon("star"), tooltip = "Select an option"))
        Output
Icon and tooltip
    # update_toolbar_input_select() validates label parameter

        Code
          update_toolbar_input_select("test_id", label = "", session = session)
        Condition
          Error in `update_toolbar_input_select()`:
          ! `label` must be a non-empty string.

    ---

        Code
          update_toolbar_input_select("test_id", label = "   ", session = session)
        Condition
          Error in `update_toolbar_input_select()`:
          ! `label` must be a non-empty string.

    ---

        Code
          update_toolbar_input_select("test_id", label = 123, session = session)
        Condition
          Error in `update_toolbar_input_select()`:
          ! `label` must be a non-empty string.

    ---

        Code
          update_toolbar_input_select("test_id", label = c("A", "B"), session = session)
        Condition
          Error in `update_toolbar_input_select()`:
          ! `label` must be a non-empty string.

    # toolbar_input_select() validates selected is in choices

        Code
          toolbar_input_select(id = "test", label = "Test", choices = c("A", "B", "C"),
          selected = "D", tooltip = FALSE)
        Condition
          Error in `toolbar_input_select()`:
          ! `selected` value 'D' is not in `choices`.

    ---

        Code
          toolbar_input_select(id = "test", label = "Test", choices = c(`Label A` = "val_a",
            `Label B` = "val_b"), selected = "Label A", tooltip = FALSE)
        Condition
          Error in `toolbar_input_select()`:
          ! `selected` value 'Label A' is not in `choices`.

    ---

        Code
          toolbar_input_select(id = "test", label = "Test", choices = list(`Group 1` = c(
            "A", "B"), `Group 2` = c("C", "D")), selected = "E", tooltip = FALSE)
        Condition
          Error in `toolbar_input_select()`:
          ! `selected` value 'E' is not in `choices`.

    # update_toolbar_input_select() validates selected is in choices

        Code
          update_toolbar_input_select("test_id", choices = c("A", "B", "C"), selected = "D",
          session = session)
        Condition
          Warning:
          `selected` value 'D' is not in `choices`.