Reference
Page layouts
The shape a whole page takes.
-
bc_page_sidebar()bc_sidebar_toggle()A collapsible
bc_sidebar()beside a<main>region, with a header carrying the sidebar toggle and a title. -
bc_nav_item()bc_page_navbar()A sticky top navigation bar over a
<main>region. -
For servers that answer with HTML text rather than tags, like plumber2, ambiorix or nanonext. Writes the doctype, the head and the body, with the stylesheet and every script the components asked for already linked.
Serving Basecoat
The stylesheet and scripts a page needs.
-
The Basecoat stylesheet and scripts as an
htmltools::htmlDependency(), placed in the page<head>. Served from the files bundled with this package by default, or from jsDelivr. -
The style packs Basecoat ships, as named on its installation page. All of them are bundled with this package.
-
A CSS file of your own as an
htmltools::htmlDependency(). Reach forbc_deps(theme = )instead, which orders it against the style pack for you. -
Basecoat initialises its components on load and when new DOM is inserted, so this is only wanted where markup is restored from a cache rather than parsed.
-
JavaScript bindings that let a Shiny app read and update the basecoat inputs Shiny cannot already:
bc_radio_group(),bc_slider(),bc_select()andbc_combobox(). -
Prints a component to the viewer with the Basecoat stylesheet and scripts attached, or writes its HTML when there is nowhere to show it.
Layout
Regions that hold other components.
-
bc_card()bc_card_action()bc_card_body()bc_card_footer()bc_card_header()A titled container, built from a header, a body and a footer.
-
bc_sidebar()bc_sidebar_group()bc_sidebar_item()bc_sidebar_separator()bc_sidebar_submenu()A fixed navigation panel beside the page content.
-
A scrollable region carrying the Basecoat scrollbar or
scrollbar-smclass. -
A display or navigation row in a semantic
<article>or<a>element. -
A centred empty-state with an optional icon, title, description and actions.
Actions
Controls that do something when clicked.
-
A
<button>carrying the Basecoatbtnclass. -
bc_button_group()bc_button_group_separator()Joins related controls into a single
button-groupshell. -
bc_dropdown_checkbox()bc_dropdown_group()bc_dropdown_item()bc_dropdown_menu()bc_dropdown_radio()bc_dropdown_separator()A menu of actions in an inline popover beside its trigger.
-
bc_command()bc_command_group()bc_command_item()bc_command_separator()A searchable command palette or standalone command list.
-
bc_pagination()bc_pagination_ellipsis()bc_pagination_item()bc_pagination_next()bc_pagination_previous()A set of page controls built from the Button classes in a
navlandmark. -
A button that flips the
darkclass on<html>, toggling the page theme.
Inputs
Form controls and the field wrappers around them.
-
bc_field()bc_field_group()bc_field_separator()bc_fieldset()A single form control wrapped with its label and helper text.
-
A
<label>carrying the Basecoatlabelclass. -
An
<input>carrying the Basecoatinputclass, optionally wrapped with a label in afield. -
bc_input_group()bc_input_group_addon()A group shell for a native control with inline or block addons.
-
A multiline
<textarea>carrying the Basecoattextareaclass, optionally wrapped with a label in afield. -
A checkbox input paired with its label in a Basecoat
field. -
A single radio input with its label, wrapped in a field.
-
A radio group component with individual radio inputs.
-
A binary toggle built on a native checkbox with
role="switch", paired with its label in a horizontalfield. -
A range input component styled as a slider.
-
A dropdown of options, with a hidden input carrying what was chosen.
-
A helper function to create individual select options.
-
bc_native_select()bc_native_select_group()bc_native_select_option()A native
<select>carrying the Basecoatselectclass, optionally wrapped with a label in afield. -
A searchable select with an editable text input and a hidden value input.
-
A selectable entry in a combobox listbox.
-
A headed set of options separated from the rest of the list.
-
A horizontal rule between combobox groups.
Navigation
Moving between views.
-
A tab component with navigation and content panels.
-
A helper function to create individual tab content panels.
-
bc_breadcrumb()bc_breadcrumb_item()bc_breadcrumb_separator()A navigation landmark listing the page hierarchy, with separators inserted between items.
Overlays
Content layered over the page.
-
A modal dialog component using native HTML dialog element.
-
A button that opens a dialog.
-
A modal that interrupts the user and expects an explicit response, built on a native
<dialog class="alert-dialog">. -
A modal side panel built on a native
<dialog>element. -
An inline popover of content beside its trigger.
-
A tooltip component using Basecoat CSS.
-
bc_toast()bc_toast_trigger()bc_toaster()A stack of transient notifications appended to a toaster.
Display
Components that show state rather than collect it.
-
A short message with an optional icon, title, body and action.
-
bc_avatar()bc_avatar_badge()bc_avatar_group()A small round image with an initials fallback.
-
A small inline status label.
-
A single key label in an inline
<kbd>. -
A bar showing how far along a task is.
-
A block that stands in for content that has not arrived.
-
A loading indicator as the
loader-circleLucide icon with theanimate-spinutility. -
bc_accordion()bc_accordion_item()A vertically stacked set of collapsible sections built on native
<details>elements.
Misc
-
A page for building a theme: an input per token, a light and dark pair, a style pack to start from, and the CSS to download.