Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev cncomponentstyling #29

Merged
merged 3 commits into from
Mar 6, 2025
Merged

Conversation

Siddami
Copy link
Contributor

@Siddami Siddami commented Mar 6, 2025

feat(ui): Enhance button component with improved developer experience
feat(ui): refactor Card component to a compound component pattern

Siddami added 3 commits March 5, 2025 22:40
- Add loading state spinner, icon positioning props, and full-width option
  to make our Button component more intuitive and require less markup.
- Developers can now use leftIcon/rightIcon props instead of nesting
  elements, and enable loading states with a single prop.

Example:
- Before: <Button><Spinner /><span>Loading...</span></Button>
- After: <Button loading>Loading...</Button>
Refactor Card component to use a compound pattern with a single
export point. Now developers can import just the Card component
and access all sub-components through it (Card.Header, Card.Title,
etc). Added Card.create() helper function for quick card creation.

Makes the component more intuitive and reduces import statements.
@basii199 basii199 merged commit 9807b29 into hngprojects:main Mar 6, 2025
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.

2 participants