smelte

UI framework with material components built with Svelte and Tailwind CSS

Github星跟蹤圖

Smelte

Smelte logo

license
downloads
version
Discord Chat

Demo

Smelte is a UI framework built on top of Svelte and Tailwind CSS using Material Design spec (hence the name).
It comes with many components and utility functions making it easy to build beautiful responsive layouts while keeping
bundle size and performance at check all thanks to Svelte.

Installation

To get you started you need to add Smelte to your dependencies with your favorite package manager

$ npm install smelte or yarn add smelte

Then you need to add Smelte Rollup plugin (Webpack is on its way).

const smelte = require("smelte/rollup-plugin-smelte");

plugins = [
  ...your plugins,
  smelte({
    purge: production,
    output: "public/global.css", // it defaults to static/global.css which is probably what you expect in Sapper
    postcss: [], // Your PostCSS plugins
    whitelist: [], // Array of classnames whitelisted from purging
    whitelistPatterns: [], // Same as above, but list of regexes
    tailwind: {
      colors: {
        primary: "#b027b0",
        secondary: "#009688",
        error: "#f44336",
        success: "#4caf50",
        alert: "#ff9800",
        blue: "#2196f3",
        dark: "#212121"
      }, // Object of colors to generate a palette from, and then all the utility classes
      darkMode: true,
    }, // Any other props will be applied on top of default Smelte tailwind.config.js
  }),
]

Then you should add Tailwind utilites CSS in your app component.

import "smelte/src/tailwind.css";

You might also need to include material icons in your template's if you use any:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Or ship them along with Roboto if you would like to use default material font

<link
  href="https://fonts.googleapis.com/css?family=Roboto:300,400,500, Material+Icons&display=swap"
  rel="stylesheet"
/>

And you're good to go and have all the Tailwind CSS power all to yourself!

For treeshaking to work it is recommended to import each component on its own like this:

import Button from "smelte/src/components/Button";
import Treeview from "smelte/src/components/Treeview";

Components

  • Text field
  • Button
  • Select
  • Checkbox
  • Radio
  • List
  • Chip
  • Menu
  • Navigation drawer
  • Snackbar
  • Dialog
  • Card
  • Slider
  • Proper customization via class props
  • Data table
  • Autocomplete
  • Tooltip
  • Revise events (on:change, on:focus, on:input...)
  • Treeview
  • Date picker
  • Form
  • Stepper
  • Upload
  • Rating
  • Pagination
  • Breadcrumbs

Features

  • Default typography per Material design spec
  • Material icons
  • CSS ripple animation
  • Image lazy loading
  • Now SSR deployment
  • Color palette generator
  • Improve Purge CSS
  • Theming
  • Image processing (done here)
  • Svelte template (without Sapper)
  • JS ripple animation
  • Dark mode
  • IE 11 support

主要指標

概覽
名稱與所有者matyunya/smelte
主編程語言Svelte
編程語言JavaScript (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2019-06-27 07:11:19
推送於2025-02-17 13:34:49
最后一次提交2025-02-17 22:34:49
發布數0
用户参与
星數1.5k
關注者數22
派生數113
提交數744
已啟用問題?
問題數166
打開的問題數98
拉請求數104
打開的拉請求數12
關閉的拉請求數12
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?