Skip to content

feat: Add Slottable from Radix UI for better component composition#139

Open
xxxijustwei wants to merge 2 commits intotremorlabs:mainfrom
xxxijustwei:feat/button-slottable
Open

feat: Add Slottable from Radix UI for better component composition#139
xxxijustwei wants to merge 2 commits intotremorlabs:mainfrom
xxxijustwei:feat/button-slottable

Conversation

@xxxijustwei
Copy link

Description

This PR introduces the usage of Slottable from @radix-ui/react-slot in the Button component. The main change is replacing the direct rendering of children with Slottable, which provides better component composition and flexibility.

Key changes:

  • Added Slottable from Radix UI
  • Restructured loading state rendering using Slottable
  • Simplified the loading state logic

Related issue(s)
None

What kind of change does this PR introduce? (check at least one)

  • Bug fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • New Feature (BREAKING CHANGE which adds functionality)
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

How has this been tested?

The changes have been tested in the following scenarios:

  • Button component with Slottable integration
  • Button component with loading states
  • Button component with children composition

The PR fulfils these requirements:

  • It's submitted to the main branch
  • Add refs #XXX or fixes #XXX to the related issue section if your PR refers to or fixes an issue.
  • My change requires a change to the documentation. (Managed by Tremor Team)
  • I have added tests to cover my changes
  • Check the "Allow edits from maintainers" option while creating your PR.
  • By contributing to Tremor, you confirm that you have read and agreed to Tremor's CONTRIBUTING.md guideline. You also agree that your contributions will be licensed under the Apache License 2.0 license.

@vercel
Copy link

vercel bot commented May 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tremor-storybook ❌ Failed (Inspect) May 10, 2025 7:11am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant