Get started with ui-svelte by following these simple steps to set up your Svelte project with Tailwind CSS and the ui-svelte component library.
Use the Svelte CLI to create a new project. Replace project-name with your desired
project name.
Navigate to your project directory and add Tailwind CSS using the Svelte CLI.
Install the ui-svelte component library as a dependency in your project.
Create or update your src/app.css file with the following configuration. This
includes Tailwind CSS, ui-svelte styles, and theme color variables.
Update your src/routes/+layout.svelte file to include the Provider component and
import your CSS. The Provider component handles toast notifications and view transitions.
toastPosition - Position of toast notifications: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'toastIcon - Show icons in toast notifications (boolean)toastSolid - Use solid background for toast notifications (boolean)You can use Fontsource to easily add custom fonts to your project. The example above uses Montserrat Variable.
Then import it in your layout file as shown in step 5. You can browse available fonts at fontsource.org.
Your Svelte project is now configured with ui-svelte. You can start using components in your pages.