building-streamlit-custom-components-v2

Scaffold bidirectional Streamlit Custom Components v2 with Vite and Python packaging.

3|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/legout/pi-config --skill building-streamlit-custom-components-v2-legout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-streamlit-custom-components-v2
Source: https://github.com/legout/pi-config/tree/main/installed-skills/developing-with-streamlit/skills/building-streamlit-custom-components-v2
Command: npx skills add https://github.com/legout/pi-config --skill building-streamlit-custom-components-v2-legout

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill solves the complexity of creating custom, bidirectional UI components for Streamlit by enforcing modern v2 API standards and preventing the use of deprecated, broken v1 patterns.

Core Features & Use Cases

  • Bidirectional Communication: Implements the state-sync loop between Python and JavaScript using modern CCv2 APIs.
  • Template-Driven Development: Provides a strict workflow for generating and maintaining packaged components using the official Streamlit template.
  • Theming Integration: Guides the implementation of CSS variables to ensure components adapt automatically to Streamlit's light and dark themes.

Quick Start

Use the building-streamlit-custom-components-v2 skill to generate a new packaged component project using the official Streamlit template.

Frequently Asked Questions about building-streamlit-custom-components-v2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build custom Streamlit components with bidirectional state synchronization?

Building interactive Streamlit UI elements requires the Custom Components v2 API to manage the bidirectional state-sync loop between Python and JavaScript. This enforces modern standards and prevents deprecated v1 patterns from breaking your application.

What is the best way to scaffold a packaged Streamlit custom component?

The best way to scaffold a packaged Streamlit custom component is using a template-driven workflow. This generates a structured project that manages assets consistently via Vite and Python packaging for reusable frontend elements.

Does Streamlit custom component development support shadow DOM isolation and type safety?

Yes, Streamlit custom component development supports shadow DOM isolation and type-safe frontend development. These requirements are enforced by the modern v2 API standards to ensure robust, isolated interactive elements.

How do I apply Streamlit light and dark themes to my custom UI components?

You apply Streamlit light and dark themes to custom UI components by integrating CSS variables. This theming integration ensures your frontend elements adapt automatically to the active Streamlit application theme.

Why should I use the Custom Components v2 API instead of older Streamlit patterns?

You should use the Custom Components v2 API because it enforces modern API standards and prevents the use of deprecated, broken v1 patterns. This ensures robust bidirectional communication and consistent asset management for your interactive elements.