Docs for Custom Components V2#12877
Merged
sfc-gh-dmatthews merged 5 commits intodevelopfrom Oct 28, 2025
Merged
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates docstrings for Custom Components V2 to improve documentation. The changes focus on expanding and clarifying the documentation for component registration, mounting, and type definitions without modifying any functional code.
Key Changes
- Enhanced docstrings with detailed parameter descriptions, usage guidelines, and comprehensive examples
- Added extensive documentation for both Python and TypeScript interfaces
- Included practical examples demonstrating component creation patterns and common use cases
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/streamlit/components/v2/types.py | Expanded BidiComponentCallable docstring with detailed parameter descriptions, usage notes, and two complete examples |
| lib/streamlit/components/v2/bidi_component/state.py | Improved BidiComponentResult docstring to clarify its purpose and structure, moved parameter docs to __init__ method |
| lib/streamlit/components/v2/init.py | Extensively documented the component function with detailed parameter descriptions, important notes, and three practical examples |
| frontend/component-v2-lib/src/types.ts | Enhanced TypeScript type documentation with detailed JSDoc comments, usage guidelines, and a complete typed example |
Contributor
✅ PR preview is ready!
|
Collaborator
sfc-gh-bnisco
left a comment
There was a problem hiding this comment.
Really great docs, thank you so much! A couple of comments/suggestions inline.
sfc-gh-bnisco
approved these changes
Oct 28, 2025
github-actions bot
pushed a commit
that referenced
this pull request
Oct 29, 2025
## Describe your changes The PR updates the docstrings for Custom Components V2. ## GitHub Issue Link (if applicable) ## Testing Plan n/a docs only --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. --------- Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
The PR updates the docstrings for Custom Components V2.
GitHub Issue Link (if applicable)
Testing Plan
n/a docs only
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.