Documentation is under development.
Installation
To integrate components into your project, simply execute the following steps and configure the plugin:
Configuration
Tailwind css
Set up Tailwind CSS: If you haven't already, follow the Tailwind CSS installation instructions to set up your project.
Plugin
Configure @typeweave/plugin in config file:
Important Note:
When importing styles, please be aware of the following distinction:
-
Use above to only include one component styles, allowing TailwindCSS to generate optimized CSS for that specific component. Each component's documentation specifies its style paths.
-
Use above to include styles for all components. Note that this approach will result in a significantly larger CSS file size, as it includes styles for all components, even if you're only using the one component. This may impact page load times and performance. Choose the appropriate import to optimize your TailwindCSS setup and minimize CSS file size!
For example, this tailwind.config.ts
includes styles for Button
, dialog
and Input
components.
and apply bg-background
and text-foreground
classes to the body
tag using any method, assuming you're working with Next.js.
Usage
import
Import components from @typeweave/react
Important Note:
@typeweave/react does not provide a main export. Instead, i recommend importing components directly from their respective files to leverage tree shaking and optimize bundle size. Each component's documentation specifies its import details.
Incorrect importBy importing components directly, you can take advantage of tree shaking and only include the components you need in your build, reducing unnecessary code and optimizing performance.