Installation
Get started with Popui by installing the package and configuring your Svelte project.Prerequisites
Before installing Popui, ensure your project meets these requirements:Svelte 5
Popui requires Svelte 5.0.0 or higher
Node.js
Node.js 16.x or higher recommended
Popui is built specifically for Svelte 5 and uses its latest features including runes and snippets. It is not compatible with earlier Svelte versions.
Install the Package
Install Popui using your preferred package manager:Package Details
- Package name:
@invopop/popui - Current version:
0.1.54 - License: MIT
- Peer dependencies: Svelte ^5.0.0
Configure Tailwind CSS
Popui is styled with Tailwind CSS and requires it to be configured in your project.Install Tailwind CSS (if not already installed)
If you don’t have Tailwind CSS in your project, install it:
Import Popui's Tailwind theme
Add the Popui theme to your main CSS file (e.g.,
app.css or global.css):app.css
The theme import should come before the Tailwind directives to ensure proper style loading.
Optional: Add Tailwind Plugins
For enhanced functionality with form components, consider installing these Tailwind plugins:tailwind.config.js:
tailwind.config.js
Verify Installation
Test your installation by importing and using a simple component:+page.svelte
SvelteKit Configuration
If you’re using SvelteKit, ensure yoursvelte.config.js is configured correctly:
svelte.config.js
TypeScript Support
Popui includes full TypeScript definitions. No additional setup is required for TypeScript support. You can import types from the package:Troubleshooting
Components don't have styling
Components don't have styling
This usually means Tailwind isn’t configured correctly. Ensure:
- You’ve imported the Popui theme CSS
- Your Tailwind content paths include the Popui package
- Your build tool is processing the CSS files
TypeScript errors about missing types
TypeScript errors about missing types
Make sure you’re using Svelte 5.0.0 or higher. Check your
package.json:Import errors
Import errors
Verify that the package is installed correctly:If not found, try reinstalling:
Build errors with Vite
Build errors with Vite
If you encounter build errors, ensure you’re using compatible versions:
- Vite 5.x or higher
- @sveltejs/vite-plugin-svelte 4.x or higher
For more help, check the GitHub Issues or view the Storybook examples.
Next Steps
Quick Start Guide
Ready to build? Follow our quick start guide to create your first component.