DEV Community

Cover image for Show dev: Flowbite Svelte - Open-source UI component library
Zoltán Szőgyényi for Themesberg

Posted on • Originally published at flowbite-svelte.com

Show dev: Flowbite Svelte - Open-source UI component library

Flowbite Svelte is a free and open-source UI component library based on the core Flowbite components and built with native Svelte components and interactivity handling.

This library features hundreds of interactive elements such as navbars, dropdowns, modals, and sidebars all handled by Svelte and based on the utility classes from Tailwind CSS.

Getting started

Learn how to get started with Flowbite Svelte by following the quickstart guide and start leveraging the interactive Svelte components coupled with Flowbite and Tailwind CSS.

Svelte UI component library

Using SvelteKit

You can install SvelteKit or Svelte to start your app. For SvelteKit:

npm create svelte@latest my-app
cd my-app
npm install
Enter fullscreen mode Exit fullscreen mode

Using Svelte

If you want to get started with Svelte:

npm create vite@latest myapp -- --template svelte
cd myapp
npm install
Enter fullscreen mode Exit fullscreen mode

Install Tailwind CSS

In order to enable the utility classes from Tailwind CSS install the package using NPM:

npx svelte-add@latest tailwindcss
npm i
Enter fullscreen mode Exit fullscreen mode

Run a local development server by running:

npm run dev
Enter fullscreen mode Exit fullscreen mode

Install Flowbite Svelte

Run the following command to install all Flowbite dependencies and libraries:

npm i flowbite flowbite-svelte classnames @popperjs/core
Enter fullscreen mode Exit fullscreen mode

Configuration

Update the tailwind.config.cjs file from your root project folder to let the Tailwind CSS compiler know where to look for the utility classes and also set up the Flowbite plugin.

const config = {
  content: [
    "./src/**/*.{html,js,svelte,ts}",
    "./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}",
  ],

  theme: {
    extend: {},
  },

  plugins: [
    require('flowbite/plugin')
  ],
  darkMode: 'class',
};

module.exports = config;
Enter fullscreen mode Exit fullscreen mode

That's it! Now you should be able to work with the Flowbite Svelte library and import components such as the navbar, dropdown, modal, and more.

Svelte

Svelte is a modern and growing front-end compiler. Developers build boilerplate-free components using languages HTML, CSS and JavaScript. Svelte compiles your code to tiny, framework-less vanilla JS.

Tailwind CSS

Flowbite Svelte leverages the utility classes from the popular Tailwind CSS framework allowing greater customization capabilities directly from a component level in Svelte.

Flowbite Ecosystem

Flowbite is also available in other frameworks such as vanilla JS with HTML, React, Vue, Angular, and even integration possibilities with back-end frameworks such as Laravel, Django, Flask, and Phoenix.

Check out the main GitHub repository to explore other libraries too as well as the Figma design system.

UI Components

Flowbite Svelte has a rich collection of commonly used components coded with Svelte that leverage the utility classes from Tailwind CSS and you can check out the full list of components by navigating through the components section in the sidebar on the left side of the page.

Contributing

Flowbite Svelte is a free and open-source UI component library built with Svelte native components and based on the Flowbite ecosystem and contributions are more than welcome.

Check out contributing guide to learn how you can be a part of the open-source community.

License

Flowbite Svelte is a free and open-source UI component library licensed under the MIT License.

Top comments (0)