Convert Figma logo to code with AI

themesberg logoflowbite-svelte

Official Svelte components built for Flowbite and Tailwind CSS

2,097
253
2,097
147

Top Related Projects

Svelte Material UI Components

Svelte implementation of the Carbon Design System

A complete design system and component solution, built on Tailwind.

A pretty cool UI kit for Svelte

Quick Overview

Flowbite-Svelte is an official Svelte component library built on top of the Flowbite design system and Tailwind CSS. It provides a set of accessible, customizable, and responsive UI components for building modern web applications using Svelte.

Pros

  • Extensive collection of pre-built, customizable components
  • Built on top of Tailwind CSS, allowing for easy customization and consistency
  • Fully accessible components following WAI-ARIA standards
  • Active development and community support

Cons

  • Relatively new project, may have some stability issues
  • Heavy reliance on Tailwind CSS, which might not be suitable for all projects
  • Limited documentation compared to more established component libraries

Code Examples

  1. Using a Button component:
<script>
  import { Button } from 'flowbite-svelte';
</script>

<Button color="blue">Click me</Button>
  1. Creating a simple form with Input and Checkbox components:
<script>
  import { Input, Checkbox, Label } from 'flowbite-svelte';
</script>

<form>
  <Label for="email">Email</Label>
  <Input id="email" type="email" placeholder="name@flowbite.com" required />
  
  <Checkbox>Remember me</Checkbox>
</form>
  1. Implementing a responsive Navbar:
<script>
  import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte';
</script>

<Navbar let:hidden let:toggle>
  <NavBrand href="/">
    <img src="/logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
    <span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">
      Flowbite
    </span>
  </NavBrand>
  <NavHamburger on:click={toggle} />
  <NavUl {hidden}>
    <NavLi href="/" active={true}>Home</NavLi>
    <NavLi href="/about">About</NavLi>
    <NavLi href="/services">Services</NavLi>
  </NavUl>
</Navbar>

Getting Started

  1. Install Flowbite-Svelte and its dependencies:
npm i flowbite-svelte flowbite tailwindcss @tailwindcss/forms
  1. Add Flowbite to your tailwind.config.cjs:
const config = {
  content: [
    "./src/**/*.{html,js,svelte,ts}",
    "./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}",
  ],

  plugins: [
    require('flowbite/plugin')
  ],

  darkMode: 'class',
  
  theme: {
    extend: {
      colors: {
        // flowbite-svelte color system
        primary: { 50: '#FFF5F2', 100: '#FFF1EE', 200: '#FFE4DE', 300: '#FFD5CC', 400: '#FFBCAD', 500: '#FE795D', 600: '#EF562F', 700: '#EB4F27', 800: '#CC4522', 900: '#A5371B'},
      }
    }
  }
};

module.exports = config;
  1. Import and use Flowbite-Svelte components in your Svelte files as shown in the code examples above.

Competitor Comparisons

Svelte Material UI Components

Pros of svelte-material-ui

  • Implements the official Material Design guidelines, providing a consistent and familiar UI
  • Offers a wide range of components, including complex ones like data tables and dialogs
  • Provides TypeScript support out of the box

Cons of svelte-material-ui

  • Steeper learning curve due to adherence to Material Design principles
  • Larger bundle size compared to Flowbite Svelte
  • Less customizable without breaking Material Design guidelines

Code Comparison

svelte-material-ui:

<script>
  import Button from '@smui/button';
</script>

<Button on:click={() => alert('Clicked!')}>
  Click me
</Button>

Flowbite Svelte:

<script>
  import { Button } from 'flowbite-svelte';
</script>

<Button on:click={() => alert('Clicked!')}>
  Click me
</Button>

Both libraries offer similar component usage, but svelte-material-ui follows Material Design principles more strictly, while Flowbite Svelte provides a more lightweight and flexible approach to UI components.

Svelte implementation of the Carbon Design System

Pros of Carbon Components Svelte

  • Comprehensive design system with a wide range of components
  • Follows IBM's Carbon Design System, ensuring consistency and accessibility
  • Extensive documentation and design guidelines

Cons of Carbon Components Svelte

  • Larger bundle size due to the extensive component library
  • Steeper learning curve for developers unfamiliar with the Carbon Design System
  • Less flexibility in customization compared to Flowbite Svelte

Code Comparison

Carbon Components Svelte:

<script>
import { Button } from "carbon-components-svelte";
</script>

<Button>Click me</Button>

Flowbite Svelte:

<script>
import { Button } from "flowbite-svelte";
</script>

<Button>Click me</Button>

While the basic usage is similar, Carbon Components Svelte offers more props and variants aligned with the Carbon Design System, whereas Flowbite Svelte provides a more lightweight and customizable approach.

Carbon Components Svelte is ideal for projects requiring a comprehensive, enterprise-level design system, while Flowbite Svelte is better suited for developers seeking a more flexible and lightweight component library with easier customization options.

A complete design system and component solution, built on Tailwind.

Pros of Skeleton

  • More comprehensive UI toolkit with a wider range of components and utilities
  • Built-in dark mode support and theming capabilities
  • Active community and frequent updates

Cons of Skeleton

  • Steeper learning curve due to its extensive feature set
  • Potentially larger bundle size compared to Flowbite Svelte

Code Comparison

Skeleton:

<script>
  import { Button } from '@skeletonlabs/skeleton';
</script>

<Button variant="filled">Click me</Button>

Flowbite Svelte:

<script>
  import { Button } from 'flowbite-svelte';
</script>

<Button>Click me</Button>

Both libraries offer easy-to-use component imports, but Skeleton provides more customization options out of the box. Skeleton's approach to theming and variants is more extensive, while Flowbite Svelte focuses on simplicity and ease of use.

Skeleton's ecosystem includes additional features like a CLI for project setup and a Tailwind plugin, making it a more comprehensive solution for larger projects. Flowbite Svelte, on the other hand, is lighter and may be more suitable for smaller projects or those requiring quick implementation.

Ultimately, the choice between these libraries depends on the specific needs of your project, such as the desired level of customization, project size, and development timeline.

A pretty cool UI kit for Svelte

Pros of Attractions

  • Lighter weight and more focused component library
  • Simpler API with less configuration required
  • Better TypeScript support out of the box

Cons of Attractions

  • Fewer components and features compared to Flowbite Svelte
  • Less active community and fewer updates
  • Limited customization options for some components

Code Comparison

Attractions:

<Button>Click me</Button>
<TextField label="Name" />
<Checkbox>Check this</Checkbox>

Flowbite Svelte:

<Button>Click me</Button>
<Input label="Name" />
<Checkbox>Check this</Checkbox>

The code syntax is similar between the two libraries, with minor differences in component naming conventions. Attractions tends to use more descriptive names (e.g., TextField vs Input), while Flowbite Svelte follows a more concise naming approach.

Both libraries offer a straightforward way to implement common UI components in Svelte applications. Attractions provides a more streamlined experience with fewer options, which can be beneficial for smaller projects or developers who prefer simplicity. Flowbite Svelte, on the other hand, offers a wider range of components and customization options, making it more suitable for larger, more complex applications that require extensive UI functionality.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

FLOWBITE-SVELTE

npm version npm downloads npm downloads license Discord

⚠️ Flowbite Svelte is currently in early development and APIs and packages are likely to change quite often.

Flowbite Svelte UI components
Build websites even faster with Svelte components on top of Tailwind CSS

Flowbite Svelte is an official Flowbite UI component library for Svelte. All interactivities are handled by Svelte.

Visualize this repo's codebase

Installation

Documentation

For full documentation, visit flowbite-svelte.com.

Components

Alert Badge Breadcrumb
Svelte Alerts Svelte Badge Svelte Breadcrumbs
Button Button group Card
Svelte Buttons Svelte Button Group Svelte Cards
Dropdown Forms List group
Svelte Dropdown Svelte Forms Svelte List group
Typography Modal Tabs
Svelte Typography Svelte Modal Svelte Tabs
Navbar Pagination Timeline
Svelte Navbar Svelte Pagination Svelte Timeline
Progress bar Table Toast
Svelte Progress Bar Svelte Tables Svelte Toast
Tooltip Datepicker Spinner
Svelte Tooltips Svelte Datepicker Svelte Spinner
Footer Accordion Sidebar
Svelte Footer Svelte Accordion Svelte Sidebar
Carousel Avatar Rating
Svelte Carousel Svelte Avatar Svelte Rating
Input Field File Input Search Input
Svelte Input Field Svelte File Input Svelte Search Input
Select Textarea Checkbox
Svelte Select Svelte Textarea Svelte Checkbox
Radio Toggle Range Slider
Svelte Radio Svelte Toggle Svelte Range Slider
Floating Label Mega Menu Skeleton
Svelte Floating Label Svelte Mega Menu Svelte Skeleton
KBD (keyboard) Drawer (offcanvas) Popover
Svelte KBD (Keyboard) Svelte Drawer (offcanvas) Svelte Popover
Video Heading Paragraph
Svelte Video Svelte Heading Svelte Paragraph
Blockquote Image List
Svelte Blockquote Svelte Image Svelte List
Link Text Horizontal line (HR)
Svelte Link Svelte Text Svelte HR
Speed Dial Stepper(TBA) Indicators
Svelte Speed Dial Svelte Stepper Svelte Indicators
Bottom Navigation Sticky Banner Gallery (Masonry)
Svelte Bottom Navigation Bar Svelte Bottom Sticky Banner Svelte Image Gallery (Masonry)

Community

If you need help or just want to discuss about the library join the community on Github:

⌨️ Discuss about Flowbite on GitHub

For casual chatting with others using the library:

💬 Join the Flowbite Discord Server

Contribute

Please read how to contribute if you'd like to be part of the Flowbite community of contributors.

Changelog

View the full changelog on this page.

License

Flowbite Svelte is open-source under the MIT License.

NPM DownloadsLast 30 Days