Drawer

Description

A modal side panel built on a native <dialog> element.

Usage

bc_drawer(
  ...,
  id = NULL,
  side = "bottom",
  trigger = "Open Drawer",
  title = NULL,
  description = NULL,
  actions = NULL,
  class = NULL
)

Arguments

Argument Description
... Content for the drawer body.
id String. The ID for the dialog.
side String. The viewport side the drawer slides from. One of bottom (default), top, right or left.
trigger String. The trigger button's label, or NULL for no button.
title String. A header title shown above the body.
description String. A header description under the title.
actions A tag or tag list. Footer actions pinned below the body.
class String. Extra classes for the dialog.

Value

A trigger button and a <dialog class="drawer">, or just the dialog when trigger = NULL and no opener is wanted.

Examples

bc_drawer(
  bc_switch(
    "cookies-essential",
    "Essential",
    checked = TRUE,
    disabled = TRUE,
    description = "Needed for the site to work. Always on."
  ),
  bc_switch(
    "cookies-analytics",
    "Analytics",
    description = "Counts visits so we know which pages earn their keep."
  ),
  bc_switch(
    "cookies-marketing",
    "Marketing",
    description = "Lets advertisers follow you between sites."
  ),
  title = "Cookies",
  description = "Choose what this site may store on your device.",
  trigger = "Cookie settings",
  actions = htmltools::tagList(
    bc_dialog_close("Reject non-essential", variant = "outline"),
    bc_dialog_close("Accept all")
  )
)

Cookies

Choose what this site may store on your device.

Needed for the site to work. Always on.

Counts visits so we know which pages earn their keep.

Lets advertisers follow you between sites.