refactor(docs): component preview performance
Closes #
๐ Description
Refactors documentation component previews for better performance and optimizes Select component styling.
โณ๏ธ Current behavior (updates)
- Select component indicator uses translate for positioning.
- Documentation contains duplicate Select examples.
- data-focus ring styles are present in some contexts where they may be unnecessary.
- Component previews in documentation have potential performance bottlenecks.
๐ New behavior
- Uses flex layout instead of translate for Select indicator positioning.
- Removes duplicate Select examples from documentation.
- Removes data-focus ring styles.
- Optimizes component preview rendering performance in documentation.
Code Block: Implements a lightweight placeholder strategy for collapsed code blocks. Instead of rendering the full code immediately, only a small highlighted snippet (first 5 lines) is rendered initially to significantly reduce DOM nodes.
CSS Optimization: Applies advanced CSS containment properties to ComponentPreviewContainer to isolate layout calculation and enable browser-native lazy rendering:
contain- isolates the component's style, layout, and paint from the rest of the page.content-visibility- skips rendering work for off-screen previews.contain-intrinsic-size- reserves space to prevent layout shifts when content is skipped.
๐ฃ Is this a breaking change (Yes/No):
No.
๐ Additional Information
| Before | After |
|---|---|
โ ๏ธ No Changeset found
Latest commit: 352902bfb9cf7fb8086ff92e8a6867e5ce5918cc
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| heroui | Preview | Comment | Dec 10, 2025 7:24pm | |
| heroui-sb | Preview | Comment | Dec 10, 2025 7:24pm |
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
โจ Finishing touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
refactor/preview-performance
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
npm i https://pkg.pr.new/heroui-inc/heroui/@heroui/react@5975
npm i https://pkg.pr.new/heroui-inc/heroui/@heroui/styles@5975
commit: 352902b