build-shiny-module

Solid

Build reusable Shiny modules with proper namespace isolation using NS(). Covers module UI/server pairs, reactive return values, inter-module communication, and nested module composition. Use when extracting a reusable component from a growing Shiny app, building a UI widget used in multiple places, encapsulating complex reactive logic behind a clean interface, or composing larger applications from smaller, testable units.

Web & Frontend 33 stars 4 forks Updated today MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
51
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Build Shiny Module Create reusable Shiny UI/server module pairs with proper namespace isolation, reactive communication, and composability. ## When to Use - Extracting a reusable component from a growing Shiny app - Building a UI widget that will be used in multiple places - Encapsulating complex reactive logic behind a clean interface - Composing larger applications from smaller, testable units ## Inputs - **Required**: Module purpose and functionality description - **Required**: Input/output contract (what the module receives and returns) - **Optional**: Whether the module nests other modules (default: no) - **Optional**: Framework context (golem, rhino, or vanilla) ## Procedure ### Step 1: Define the Module Interface Before writing code, define what the module accepts and returns: ```text Module: data_filter Inputs: reactive dataset, column names to filter on Outputs: reactive filtered dataset UI: filter controls (selectInput, sliderInput, dateRangeInput) ``` **Got:** Clear contract specifying reactive inputs, reactive outputs, and UI elements. **If fail:** If the interface is unclear, the module is probably too broad. Split it into smaller modules with single responsibilities. ### Step 2: Create the Module UI Function ```r #' Data Filter Module UI #' #' @param id Module namespace ID #' @return A tagList of filter controls #' @export dataFilterUI <- function(id) { ns <- NS(id) tagList( selectInput( ns("column"), "Filter column", cho...

Details

Author
pjt222
Repository
pjt222/agent-almanac
Created
1 years ago
Last Updated
today
Language
JavaScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

module-design

Use when designing or reviewing a module or interface boundary, extracting a helper or wrapper, or deciding whether an abstraction is worth it. Favors deep modules, information hiding, and composition over speculative layering.

1 Updated 1 weeks ago
yuri-semenenko
Web & Frontend Featured

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.

497 Updated yesterday
posit-dev
Code & Development Listed

designing-deep-modules

Guides designing, reviewing, and refactoring modules for depth — maximizing functionality hidden behind minimal interfaces. Analyzes module boundaries, identifies shallow modules and classitis, applies deep module heuristics (pull complexity downward, define errors out of existence, design for the common case), and produces refactoring plans. Covers information hiding, leaky abstractions, and abstraction boundaries based on Ousterhout's A Philosophy of Software Design. Use when designing module interfaces, reviewing code for shallow abstractions, refactoring pass-through layers, evaluating API surface area, reducing interface complexity, or applying deep module principles at any scale (functions, classes, packages, services, APIs).

0 Updated 4 weeks ago
msewell