🚧🚧🚧 This repository is under development. 🚧🚧🚧
- React
- TypeScript
- Tailwind CSS
- Vite
- Storybook
We can do that through Polymorphism. Polymorphism stands for "multiple forms". In our case, we want to render the Badge into multiple forms - a tag
, div
, etc.
We can do that with:
-
as
prop - allows us to replace rendered HTML elements in a React component from the outside by passing them in as props -
TypeScript - to define the needed types and allowed props based on the
as
prop
Theme Provider
=> cleaner templates
- Multiple props over Single - use multiple props for defining the outlook of a component
- Documentation + Examples