Shiny Bslib logo

Shiny Bslib

Organization
posit-dev
shiny-bslib

Build modern Shiny dashboards and applications using bslib (Bootstrap 5). Use when creating new Shiny apps, modernizing legacy apps (fluidPage, fluidRow/column, tabsetPanel, wellPanel, shinythemes), or working with bslib page layouts, grid systems, cards, value boxes, navigation, sidebars, filling layouts, theming, accordions, tooltips, popovers, toasts, or bslib inputs. Assumes familiarity with basic Shiny.

Overview

Publisherposit-dev
Repositoryskills
Skill nameshiny-bslib
Stars
516
Forks
53
Bundled files
15
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by posit-dev on GitHub. Read the source before you install it.

Installation

Install the Shiny Bslib AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/posit-dev/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/shiny/shiny-bslib .claude/skills/shiny-bslib
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Shiny Bslib in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Shiny Bslib on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Shiny Bslib is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Modern Shiny Apps with bslib

Build professional Shiny dashboards using bslib's Bootstrap 5 components and layouts. This skill focuses on modern UI/UX patterns that replace legacy Shiny approaches.

Quick Start

Single-page dashboard:

r
library(shiny)
library(bslib)

ui <- page_sidebar(
  title = "My Dashboard",
  theme = bs_theme(version = 5),  # "shiny" preset by default
  sidebar = sidebar(
    selectInput("variable", "Variable", choices = names(mtcars))
  ),
  layout_column_wrap(
    width = 1/3,
    fill = FALSE,
    value_box(title = "Users", value = "1,234", theme = "primary"),
    value_box(title = "Revenue", value = "$56K", theme = "success"),
    value_box(title = "Growth", value = "+18%", theme = "info")
  ),
  card(
    full_screen = TRUE,
    card_header("Plot"),
    plotOutput("plot")
  )
)

server <- function(input, output, session) {
  output$plot <- renderPlot({
    hist(mtcars[[input$variable]], main = input$variable)
  })
}

shinyApp(ui, server)

Multi-page dashboard:

r
ui <- page_navbar(
  title = "Analytics Platform",
  theme = bs_theme(version = 5),
  nav_panel("Overview", overview_ui),
  nav_panel("Analysis", analysis_ui),
  nav_panel("Reports", reports_ui)
)

Core Concepts

Page Layouts

  • page_sidebar() -- Single-page dashboard with sidebar (most common)
  • page_navbar() -- Multi-page app with top navigation bar
  • page_fillable() -- Viewport-filling layout for custom arrangements
  • page_fluid() -- Scrolling layout for long-form content

See page-layouts.md for detailed guidance.

Grid Systems

  • layout_column_wrap() -- Uniform grid with auto-wrapping (recommended for most cases)
  • layout_columns() -- 12-column Bootstrap grid with precise control

See grid-layouts.md for detailed guidance.

Cards

Primary container for dashboard content. Support headers, footers, multiple body sections, and full-screen expansion.

See cards.md for detailed guidance.

Value Boxes

Display key metrics and KPIs with optional icons, sparklines, and built-in theming.

See value-boxes.md for detailed guidance.

Navigation

  • Page-level: page_navbar() for multi-page apps
  • Component-level: navset_card_underline(), navset_tab(), navset_pill() for tabbed content

See navigation.md for detailed guidance.

Sidebars

  • Page-level: page_sidebar() or page_navbar(sidebar = ...)
  • Component-level: layout_sidebar() within cards
  • Supports conditional content, dynamic open/close, accordions
  • resizable = TRUE by default — users can drag the edge to resize on desktop

See sidebars.md for detailed guidance.

Filling Layouts

The fill system controls how components resize to fill available space. Key concepts: fillable containers, fill items, fill carriers. Fill activates when containers have defined heights.

See filling.md for detailed guidance.

Theming

  • bs_theme() with Bootswatch themes for quick styling
  • Custom colors: bg, fg, primary affect hundreds of CSS rules
  • Fonts: font_google() for typography
  • Dynamic theming: input_dark_mode() + session$setCurrentTheme()

See theming.md for detailed guidance.

UI Components

  • Accordions -- Collapsible sections, especially useful in sidebars
  • Tooltips -- Hover-triggered help text
  • Popovers -- Click-triggered containers for secondary UI/inputs
  • Toasts -- Temporary notification messages
  • Toolbars -- Compact horizontal strips of buttons, selects, and dividers for card headers and footers

See accordions.md, tooltips-popovers.md, toasts.md, and toolbars.md.

Icons

Recommended: bsicons package (Bootstrap Icons, designed for bslib):

r
bsicons::bs_icon("graph-up")
bsicons::bs_icon("people", size = "2em")

Browse icons: https://icons.getbootstrap.com/

Alternative: fontawesome package:

r
fontawesome::fa("envelope")

Accessibility for icon-only triggers: When an icon is used as the sole trigger for a tooltip, popover, or similar interactive element (no accompanying text), it must be accessible to screen readers. By default, icon packages mark icons as decorative (aria-hidden="true"), which hides them from assistive technology.

  • bsicons::bs_icon(): Provide title — this automatically sets a11y = "sem"
    r
    tooltip(
      bs_icon("info-circle", title = "More information"),
      "Tooltip content here"
    )
  • fontawesome::fa(): Set a11y = "sem" and provide title
    r
    tooltip(
      fa("circle-info", a11y = "sem", title = "More information"),
      "Tooltip content here"
    )

The title should describe the purpose of the trigger (e.g., "More information", "Settings"), not the icon itself (e.g., not "info circle icon").

Special Inputs

  • input_switch() -- Toggle switch (modern checkbox alternative)
  • input_dark_mode() -- Dark mode toggle
  • input_task_button() -- Button for long-running operations
  • input_code_editor() -- Code editor with syntax highlighting
  • input_submit_textarea() -- Textarea with explicit submission

See inputs.md for detailed guidance.

Common Workflows

Building a Dashboard

  1. Choose page layout: page_sidebar() (single-page) or page_navbar() (multi-page)
  2. Add theme with bs_theme() (consider Bootswatch for quick start)
  3. Create sidebar with inputs for filtering/controls
  4. Add value boxes at top for key metrics (set fill = FALSE on container)
  5. Arrange cards with layout_column_wrap() or layout_columns()
  6. Enable full_screen = TRUE on all visualization cards
  7. Add thematic::thematic_shiny() for plot theming

Modernizing an Existing App

See migration.md for a complete mapping of legacy patterns to modern equivalents. Key steps:

  1. Replace fluidPage() with page_sidebar() or page_navbar()
  2. Replace fluidRow()/column() with layout_columns()
  3. Wrap outputs in card(full_screen = TRUE)
  4. Add theme = bs_theme(version = 5)
  5. Convert key metrics to value_box() components
  6. Replace tabsetPanel() with navset_card_underline()

Guidelines

  1. Prefer bslib page functions (page_sidebar(), page_navbar(), page_fillable(), page_fluid()) over legacy equivalents (fluidPage(), navbarPage())
  2. Use layout_column_wrap() or layout_columns() for grid layouts instead of fluidRow()/column(), which don't support filling layouts
  3. Wrap outputs in card(full_screen = TRUE) when building dashboards -- full-screen expansion is a high-value feature
  4. Set fill = FALSE on layout_column_wrap() containers holding value boxes (they shouldn't stretch to fill height)
  5. Pin Bootstrap version: include theme = bs_theme(version = 5) or a preset theme
  6. Use thematic::thematic_shiny() in the server so base R and ggplot2 plots match the app theme
  7. Use responsive widths like width = "250px" in layout_column_wrap() for auto-adjusting columns
  8. Group sidebar inputs with accordion() when sidebars have many controls
  9. See migration.md for mapping legacy Shiny patterns to modern bslib equivalents

Avoid Common Errors

  1. Avoid directly nesting card() containers. navset_card_*() functions are already cards; nav_panel() content goes directly inside them without wrapping in card()
  2. Only use layout_columns() and layout_column_wrap() for laying out multiple elements. Single children should be passed directly to their container functions.
  3. Never nest page_*() functions. Only use one top-level page function per app.

Reference Files

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Shiny Bslib AI skill do?

Build modern Shiny dashboards and applications using bslib (Bootstrap 5). Use when creating new Shiny apps, modernizing legacy apps (fluidPage, fluidRow/column, tabsetPanel, wellPanel, shinythemes), or working with bslib page layouts, grid systems, cards, value boxes, navigation, sidebars, filling layouts, theming, accordions, tooltips, popovers, toasts, or bslib inputs. Assumes familiarity with basic Shiny.

Why use Shiny Bslib on TypingMind?

Because you install it once and use it with any model. Shiny Bslib is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Shiny Bslib in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/posit-dev/skills/tree/main/shiny/shiny-bslib. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Shiny Bslib?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Shiny Bslib?

As many as you like. As long as a model supports skills, you can use Shiny Bslib with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Shiny Bslib AI skill free?

Yes. It is published on GitHub by posit-dev under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇