GithubHelp home page GithubHelp logo

amdkholil / smelte Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matyunya/smelte

0.0 2.0 0.0 3 MB

UI framework with material components built with Svelte and Tailwind CSS

Home Page: https://smeltejs.com/

License: MIT License

JavaScript 24.63% HTML 1.16% CSS 4.70% Svelte 69.51%

smelte's Introduction

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 add the Smelte Rollup plugin (after svelte but before css). Webpack support coming soon.

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: {
      theme: {
        extend: {
          spacing: {
            72: "18rem",
            84: "21rem",
            96: "24rem"
          }
        }
      }, // Extend Tailwind theme
      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

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

smelte's People

Contributors

matyunya avatar micha-lmxt avatar kiho avatar bradak1 avatar dependabot[bot] avatar tcd93 avatar dimfeld avatar cliveportman avatar thienpow avatar mzyy94 avatar bogdandarius avatar csaltos avatar davidfou avatar gtosh4 avatar xynkfrost avatar techniq avatar sanderverkuil avatar babycourageous avatar katyo avatar eraviart avatar dctalbot avatar shedali avatar mkelandis avatar m4dz avatar jacksloan avatar valterkraemer avatar ianfabs avatar gstvribs avatar chrrubin avatar chirag64 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.