Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
useSlot hook for slot-based component customizationuseSlot for slot-based component customization
Bundle ReportChanges will increase total bundle size by 8.1kB (0.27%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @tonic-ui/react-esmAssets Changed:
Files in
Files in
view changes for bundle: @tonic-ui/react-cjsAssets Changed:
Files in
Files in
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #1126 +/- ##
==========================================
+ Coverage 81.64% 81.65% +0.01%
==========================================
Files 447 448 +1
Lines 7572 7589 +17
Branches 48 48
==========================================
+ Hits 6182 6197 +15
- Misses 1372 1374 +2
Partials 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tonic UI DemoOn 2026-04-05 04:42:55 +0000, PR #1126 (2c8cbaa) was successfully deployed. You can view it at the following link: |
…rops API Introduces `useSlot`, an internal hook for creating component slots with controlled prop merging. Migrates `ModalContent` from `TransitionComponent`/ `TransitionProps` to the new `slots`/`slotProps` API with deprecation warnings. - Add `packages/react/src/utils/useSlot.js` with `props → slotProps` merge order, ref merging via `useMergeRefs`, and dev-only warnings for missing `slot`/`slotProps` - Migrate `ModalContent` to use `useSlot` for the `transition` slot; chain DOM event handlers with `callEventHandlers` and lifecycle callbacks with `callAll` - Add comprehensive tests for slot resolution, props merging, ref merging, and dev warnings - Add `.claude/skills/tonic-ui-use-slot/` migration guide skill
Overview
Introduces
useSlotto@tonic-ui/react-hooksas the foundation for the v3 slots/slotProps API. The hook provides a standardized way to define customizable component slots, replacing ad-hocTransitionComponent/TransitionPropsandPopperComponent/PopperPropsprops.useSlot(name, { slot, slotProps, additionalProps, ref })returns[ElementType, mergedProps];slotProps(user) takes precedence overadditionalProps(component defaults); refs are merged viauseMergeRefsModalContentas the reference implementation: addsslots/slotPropsprops with deprecation warnings forTransitionComponent/TransitionProps