Convert Figma logo to code with AI

svelteuidev logosvelteui

SvelteUI Monorepo

1,297
63
1,297
67

Top Related Projects

37,442

⚡️ Simple, Modular & Accessible UI Components for your React Applications

71,906

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.

A utility-first CSS framework for rapid UI development.

Quick Overview

SvelteUI is a comprehensive UI component library for Svelte applications. It provides a set of customizable, accessible, and performant components to help developers build modern web interfaces quickly and efficiently. The library is designed with a focus on flexibility and ease of use.

Pros

  • Extensive collection of pre-built, customizable components
  • Fully typed with TypeScript support
  • Accessible components following WCAG guidelines
  • Lightweight and performant, leveraging Svelte's efficient compilation

Cons

  • Relatively new project, may have fewer community resources compared to more established libraries
  • Documentation could be more comprehensive for some advanced use cases
  • Limited theme customization options compared to some other UI libraries
  • Smaller ecosystem of third-party extensions and plugins

Code Examples

  1. Using the Button component:
<script>
  import { Button } from '@svelteuidev/core';
</script>

<Button>Click me</Button>
  1. Creating a responsive layout with the Grid component:
<script>
  import { Grid, Col } from '@svelteuidev/core';
</script>

<Grid>
  <Col span={12} md={6} lg={4}>Column 1</Col>
  <Col span={12} md={6} lg={4}>Column 2</Col>
  <Col span={12} md={6} lg={4}>Column 3</Col>
</Grid>
  1. Using the Modal component:
<script>
  import { Modal, Button } from '@svelteuidev/core';
  let opened = false;
</script>

<Button on:click={() => (opened = true)}>Open Modal</Button>

<Modal {opened} on:close={() => (opened = false)} title="Example Modal">
  <p>This is the modal content.</p>
</Modal>

Getting Started

To start using SvelteUI in your Svelte project:

  1. Install the package:
npm install @svelteuidev/core
  1. Import and use components in your Svelte files:
<script>
  import { Button, Text } from '@svelteuidev/core';
</script>

<Button>Click me</Button>
<Text>Hello, SvelteUI!</Text>
  1. (Optional) Add the SvelteUI provider at the root of your app for global theming:
<script>
  import { SvelteUIProvider } from '@svelteuidev/core';
</script>

<SvelteUIProvider>
  <!-- Your app content here -->
</SvelteUIProvider>

Competitor Comparisons

37,442

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Pros of Chakra UI

  • Larger community and ecosystem, with more resources and third-party extensions
  • More comprehensive documentation and examples
  • Wider browser compatibility and more extensive component library

Cons of Chakra UI

  • Steeper learning curve due to its extensive API and features
  • Larger bundle size, which may impact performance for smaller projects
  • React-specific, limiting its use to React-based applications

Code Comparison

Chakra UI (React):

import { Box, Button } from '@chakra-ui/react'

function Example() {
  return (
    <Box>
      <Button colorScheme="blue">Click me</Button>
    </Box>
  )
}

SvelteUI (Svelte):

<script>
import { Box, Button } from '@svelteuidev/core'
</script>

<Box>
  <Button color="blue">Click me</Button>
</Box>

Both libraries offer a similar component-based approach, but Chakra UI is tailored for React, while SvelteUI is designed specifically for Svelte applications. Chakra UI provides more customization options out of the box, while SvelteUI aims for simplicity and Svelte-specific optimizations. The choice between the two largely depends on the framework you're using and the level of customization required for your project.

71,906

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

Pros of shadcn-ui

  • More customizable and flexible, allowing for easier integration with existing projects
  • Provides a CLI tool for easy component installation and customization
  • Offers a wider range of pre-built components and variants

Cons of shadcn-ui

  • Requires more setup and configuration compared to SvelteUI's out-of-the-box approach
  • Less opinionated design system, which may require more effort to maintain consistency
  • Documentation is less comprehensive than SvelteUI's

Code Comparison

SvelteUI:

<Button>Click me</Button>
<Input placeholder="Enter text" />
<Select items={options} />

shadcn-ui:

<Button variant="outline">Click me</Button>
<Input type="text" placeholder="Enter text" />
<Select>
  {options.map((option) => (
    <SelectItem key={option.value} value={option.value}>
      {option.label}
    </SelectItem>
  ))}
</Select>

The code comparison shows that shadcn-ui requires more explicit configuration and setup for components, while SvelteUI offers a more concise syntax. However, shadcn-ui's approach allows for greater flexibility and customization options.

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.

Pros of Primitives

  • More comprehensive set of UI components, offering a wider range of options for developers
  • Stronger focus on accessibility, ensuring better support for users with disabilities
  • Larger and more active community, potentially leading to faster bug fixes and feature updates

Cons of Primitives

  • Steeper learning curve due to its more complex API and extensive customization options
  • Requires more setup and configuration compared to SvelteUI's more opinionated approach
  • Not specifically designed for Svelte, which may lead to integration challenges in Svelte projects

Code Comparison

Primitives (React):

import * as Dialog from '@radix-ui/react-dialog';

<Dialog.Root>
  <Dialog.Trigger>Open</Dialog.Trigger>
  <Dialog.Content>
    <Dialog.Title>Dialog Title</Dialog.Title>
    <Dialog.Description>Dialog content goes here</Dialog.Description>
  </Dialog.Content>
</Dialog.Root>

SvelteUI (Svelte):

<script>
import { Modal } from '@svelteuidev/core';
</script>

<Modal opened={true} onClose={() => {}}>
  <h2>Modal Title</h2>
  <p>Modal content goes here</p>
</Modal>

Both libraries provide flexible UI components, but Primitives offers more granular control at the cost of complexity, while SvelteUI provides a more straightforward, Svelte-specific implementation.

A utility-first CSS framework for rapid UI development.

Pros of Tailwind CSS

  • Highly customizable with a utility-first approach
  • Extensive documentation and large community support
  • Framework-agnostic, can be used with any JavaScript framework

Cons of Tailwind CSS

  • Steeper learning curve for developers new to utility-first CSS
  • Can lead to verbose class names in HTML markup
  • Requires additional configuration for optimal performance

Code Comparison

Tailwind CSS:

<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
  Click me
</button>

SvelteUI:

<Button color="blue" size="md">
  Click me
</Button>

Summary

Tailwind CSS offers a utility-first approach with extensive customization options, while SvelteUI provides pre-built components specifically for Svelte applications. Tailwind CSS has a larger community and can be used across various frameworks, but it may require more setup and lead to longer class names. SvelteUI offers a more straightforward implementation for Svelte projects but is limited to that ecosystem.

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


Logo

SvelteUI

NPM GitHub contributors npm npm Help wanted Discord

SvelteUI is an all inclusive Svelte library - Components, Actions, Utilities, Animations
What more could you ask for ¯\_(ツ)_/¯
Explore the docs »
Report Bug · Request Feature


About The Project

Read the Changelog

Features

  • SvelteKit and SSR Compatible
  • TypeScript and type definitions are supported, but optional
  • All components are accessible according to WAI-ARIA standards
  • Dark theme included, as well as a custom theming api
  • Minimal third-party dependency usage
  • Easy setup - Zero Configuration

Packages

@svelteui/core - core components library with 40+ components

@svelteui/composables - collection of 20+ useful actions and utilities

@svelteui/dates - calendars, date and time pickers based on SvelteUI components

@svelteui/preprocessors - Svelte preprocessor library to assist in many areas of development

@svelteui/motion - collection of transitions to utilize on dom elements

@svelteui/prism - code highlight component built with prism action


Getting help

I want to build a friendly community that is happy to help those who need it. Help build one up by joining the discord |:


Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  • If you have a suggestion that would make this project better, submit an issue
  • If you would like to directly contribute, read the contribution guide then submit a PR

Contributors


License

Everything in the project is distributed under the MIT License


Contact

(back to top)

Roadmap & TO-DO's

Here is where you can find the Roadmap for SvelteUI up to version 1.0

We would love to hear from you in issues, discussions, and discord to improve the roadmap. As we proceed along our roadmap, we continue to learn. As a result, some of the listed topics may no longer be relevant to us, therefore as the project develops, we might add or remove topics. We will pay close attention to your suggestions and if necessary, modify our plans.

We use certain "Marks" to give you quick indications of the current state of any item in the roadmap. The colorful icons can be displayed by typing :COLOR_circle:

Annotation legend:

MarkDescription
!low level of priority
!!medium level of priority
!!!high level of priority
:red_circle:no work has been started
:yellow_circle:actively being worked on or going to start working
:green_circle:work has been completed

There are different categories on the roadmap. Items for versions 0.8–1.0 and potential future plans are included in each category. To make things quick and simple to view, the items are listed in a table.

Roadmap is currently a WIP

REPO/MISC:

StatusPriorityDescription
:red_circle:!Move Stitches to peer-deps (svelteui-core)
:green_circle:!!Upgrade to latest SvelteKit version (leverage Vite 3.0.0)
:green_circle:!!Migrate package manager from npm to yarn
:yellow_circle:!!Migrate dev environment to Storybook for all packages
:red_circle:!!Add peerdeps fix to prepare:release script
:red_circle:!!Figure out how to get cjs,esm,umd distributions in release processes
:red_circle:!!!Figure out how to add minification to the release processes

Version 1.0.0:

Future:

DOCS:

  • [ ]
StatusPriorityDescription
:yellow_circle:!!!Migration to SvelteKit

Version 1.0.0:

Future:

SVELTEUI-CORE:

Component creation, deletion, and modification should always be discussed with a maintainer before taking any action (Discord, Issues, and Discussions)!

StatusPriorityDescription
:red_circle:!Create Section component
:red_circle:!Create ScrollArea component
:red_circle:!Create Accordion component
:red_circle:!Create ARIA component
:red_circle:!Create Slider component
:red_circle:!Create SegmentedControl component
:green_circle:!Create Chip component
:red_circle:!Create Select component
:green_circle:!!!Find an effective solution to SSR in SSR mode (#172)
:green_circle:!!!Find an effective solution to SSR in SSG mode (#107)
:red_circle:!!!Fix types for native events

Version 1.0.0:

Future:

SVELTEUI-COMPOSABLES:

Composable creation and deletion should always be discussed with a maintainer before taking any action (Discord, Issues, and Discussions)!

StatusPriorityDescription
:red_circle:!Placeholder

Version 1.0.0:

Future:

SVELTEUI-DATES:

StatusPriorityDescription
:red_circle:!!Create TimePicker component
:yellow_circle:!!!Complete Calendar component

Version 1.0.0:

Future:

SVELTEUI-PREPROCESSORS:

Version 1.0.0:

Future:

  • think of new preprocessors to create

SVELTEUI-PRISM:

StatusPriorityDescription
:red_circle:!Add more tokens to style object
:red_circle:!!!Adapt new styling practices

Version 1.0.0:

Future:

SVELTEUI-NOTIFICATIONS:

  • create new notifications package

(back to top)