Shiny Core API

This page outlines Shiny Core’s API reference.

Compared to Shiny Express, Shiny Core is more structured and verbose, but also more flexible and powerful.

Newcomers may want to start with Shiny Express Shiny Core API.

Function reference

Page containers

Create a user interface page container.

ui.page_sidebar Create a page with a sidebar and a title.
ui.page_navbar Create a page with a navbar and a title.
ui.page_sidebar Create a page with a sidebar and a title.
ui.page_fillable Create a fillable page.
ui.page_fluid Create a fluid page.
ui.page_fixed Create a fixed page.
ui.page_bootstrap Create a Bootstrap UI page container.
ui.page_auto A page container which automatically decides which page function to use.
ui.page_output Create a page container where the entire body is a UI output.

UI Layouts

Control the layout of multiple UI components.

ui.sidebar Sidebar element
ui.layout_sidebar Sidebar layout
ui.layout_columns Create responsive, column-based grid layouts, based on a 12-column grid.
ui.layout_column_wrap A grid-like, column-first layout
ui.card A Bootstrap card component
ui.card_header Card header container
ui.card_footer Card footer container
ui.popover Add a popover to a UI element.
ui.tooltip Add a tooltip to a UI element.
ui.accordion Create a vertically collapsing accordion.
ui.accordion_panel Single accordion panel.
ui.column Responsive row-column based layout
ui.row Responsive row-column based layout

UI Inputs

Create UI that prompts the user for input values or interaction.

ui.input_select Create a select list that can be used to choose a single or multiple items from a list of values.
ui.input_selectize Create a select list that can be used to choose a single or multiple items from a list of values.
ui.input_slider Constructs a slider widget to select a number, date, or date-time from a range.
ui.input_date Creates a text input which, when clicked on, brings up a calendar that the user can click on to select dates.
ui.input_date_range Creates a pair of text inputs which, when clicked on, bring up calendars that the user can click on to select dates.
ui.input_checkbox Create a checkbox that can be used to specify logical values.
ui.input_checkbox_group Create a group of checkboxes that can be used to toggle multiple choices independently.
ui.input_switch Create a switch that can be used to specify logical values. Similar to input_checkbox, but implies to the user that the change will take effect immediately.
ui.input_radio_buttons Create a set of radio buttons used to select an item from a list.
ui.input_numeric Create an input control for entry of numeric values.
ui.input_text Create an input control for entry of text values.
ui.input_text_area Create a textarea input control for entry of unstructured text values.
ui.input_password Create an password control for entry of passwords.
ui.input_action_button Creates an action button whose value is initially zero, and increments by one each time it is pressed.
ui.input_action_link Creates a link whose value is initially zero, and increments by one each time it is pressed.

Value boxes

Prominently display a value and label in a box that can be expanded to show more information.

ui.value_box Value box
ui.value_box_theme Value box theme
ui.showcase_bottom Showcase bottom
ui.showcase_left_center Showcase left center
ui.showcase_top_right Showcase top right

UI panels

Visually group together a section of UI components.

ui.panel_absolute Create a panel of absolutely positioned content.
ui.panel_fixed Create a panel of absolutely positioned content.
ui.panel_conditional Create a conditional panel.
ui.panel_title Create title(s) for the application.
ui.panel_well Create a well panel.

Uploads & downloads

Allow users to upload and download files.

ui.input_file Create a file upload control that can be used to upload one or more files.
ui.download_button Create a download button
ui.download_link Create a download button.

Custom UI

Lower-level UI functions for creating custom HTML/CSS/JS

ui.HTML Mark a string as raw HTML. This will prevent the string from being escaped when rendered inside an HTML tag.
ui.TagList Create an HTML tag list (i.e., a fragment of HTML)
ui.tags Functions for creating HTML tags.
ui.markdown Convert a string of markdown to ui.HTML.
ui.include_css Include a CSS file.
ui.include_js Include a JavaScript file.
ui.insert_ui Insert UI objects.
ui.remove_ui Remove UI objects.
ui.fill.as_fillable_container Coerce a tag to a fillable container.
ui.fill.as_fill_item Coerce a tag to a fill item.
ui.fill.remove_all_fill Remove any filling layouts from a tag.
ui.css.as_css_unit Convert a value into a CSS unit.
ui.css.as_css_padding Convert a CSS unit or list of CSS units into a CSS padding value.

Update inputs

Programmatically update input values.

ui.update_select Change the value of a select input on the client.
ui.update_selectize Change the value of a selectize.js powered input on the client.
ui.update_slider Change the value of a slider input on the client.
ui.update_date Change the value of a date input on the client.
ui.update_date_range Change the start and end values of a date range input on the client.
ui.update_checkbox Change the value of a checkbox input on the client.
ui.update_checkbox_group Change the value of a checkbox group input on the client.
ui.update_switch Change the value of a switch input on the client.
ui.update_radio_buttons Change the value of a radio input on the client.
ui.update_numeric Change the value of a number input on the client.
ui.update_text Change the value of a text input on the client.
ui.update_text_area Change the value of a text input on the client.
ui.update_navs Change the value of a navs container on the client.

Update UI Layouts

ui.update_sidebar Update a sidebar’s visibility.
ui.update_tooltip Update tooltip contents.
ui.update_popover Update the contents or title of a popover.
ui.update_accordion Dynamically set accordions’ states.
ui.update_accordion_panel Dynamically update accordion panel contents.
ui.insert_accordion_panel Insert an accordion_panel.
ui.remove_accordion_panel Remove an accordion_panel.

Rendering outputs

UI (output_*()) and server (render)ing functions for generating content server-side.

ui.output_plot Create a output container for a static plot.
ui.output_image Create a output container for a static image.
ui.output_table Create a output container for a table.
ui.output_data_frame Create an output container for an interactive table or grid. Features fast virtualized scrolling, sorting, filtering, and row selection (single or multiple).
ui.output_text Create a output container for some text.
ui.output_code Create a output container for code (monospaced text).
ui.output_text_verbatim Create a output container for some text.
ui.output_ui Create a output container for a UI (i.e., HTML) element.
render.plot Reactively render a plot object as an HTML image.
render.image Reactively render a image file as an HTML image.
render.table Reactively render a pandas DataFrame object (or similar) as a basic HTML table.
render.text Reactively render text.
render.code Reactively render text as code (monospaced).
render.ui Reactively render HTML content.
render.express Reactively render HTML content with output captured as in Shiny Express
render.download Decorator to register a function to handle a download.
render.data_frame Decorator for a function that returns a pandas DataFrame object (or similar) to render as an interactive table or grid. Features fast virtualized scrolling, sorting, filtering, and row selection (single or multiple).
render.DataGrid Holds the data and options for a data_frame output, for a spreadsheet-like view.
render.DataTable Holds the data and options for a data_frame output, for a spreadsheet-like view.

Reactive programming

reactive.calc Mark a function as a reactive calculation.
reactive.effect Mark a function as a reactive side effect.
reactive.value Create a reactive value.
reactive.Calc Mark a function as a reactive calculation.
reactive.Effect Mark a function as a reactive side effect.
reactive.Value Create a reactive value.
reactive.event Mark a function to react only when an “event” occurs.
reactive.isolate Create a non-reactive scope within a reactive scope.
reactive.invalidate_later Scheduled Invalidation
reactive.extended_task Decorator to mark an async function as a slow computation. This will cause the function to be run in a background asyncio task, and the results will be available via the ExtendedTask object returned by the decorator.
reactive.flush Run any pending invalidations (i.e., flush the reactive environment).
reactive.poll Create a reactive polling object.
reactive.file_reader Create a reactive file reader.
reactive.lock A lock that should be held whenever manipulating the reactive graph.
req Throw a silent exception for falsy values.

Create and run applications

run_app Starts a Shiny app. Press Ctrl+C (or Ctrl+Break on Windows) to stop the app.
App Create a Shiny app instance.
Inputs A class representing Shiny input values.
Outputs A class representing Shiny output definitions.
Session A class representing a user session.

Display messages

ui.help_text Create a help text element
ui.notification_show Show a notification to the user.
ui.notification_remove Remove a notification.
ui.modal Creates the UI for a modal dialog, using Bootstrap’s modal class.
ui.modal_show Show a modal dialog.
ui.modal_remove Remove a modal dialog box.
ui.modal_button Creates a button that will dismiss a modal.
ui.Progress Initialize a progress bar.

Modules

module.ui
module.server

Developer facing tools

Session
Create output renderers Package author methods for creating new output renderers.
htmltools methods
ExtendedTask Supervise an extended, long-running task

Types

Miscellaneous types
Tag types
Exception types

Shiny Express

Functions for Shiny Express applications

Context manager components
Page functions
Display functions

Deprecated

ui.panel_main Deprecated. Please supply the *args of panel_main directly to layout_sidebar.
ui.panel_sidebar Deprecated. Please use sidebar instead.
ui.nav Deprecated. Please use nav_panel() instead of nav().
render.transformer.output_transformer Deprecated. Please use Renderer instead.
render.transformer.resolve_value_fn Resolve the value function

Experimental

These methods are under consideration and are considered unstable. However, if there is a method you are excited about, please let us know!

Card Cards are a common organizing unit for modern user interfaces (UI). At their core, they’re just rectangular containers with borders and padding. However, when utilized properly to group related information, they help users better digest, engage, and navigate through content.