All Projects → aforemny → Elm Mdc

aforemny / Elm Mdc

Licence: apache-2.0
Elm port of the Material Components for the Web CSS/JS library

Programming Languages

elm
856 projects

Projects that are alternatives of or similar to Elm Mdc

Vue Bootstrap With Material Design
Vue Bootstrap with Material Design - Powerful and free UI KIT
Stars: ✭ 803 (+137.57%)
Mutual labels:  framework, material-design
Materialize
Materialize, a CSS Framework based on Material Design
Stars: ✭ 38,630 (+11328.99%)
Mutual labels:  framework, material-design
Flaui
UI automation library for .Net
Stars: ✭ 892 (+163.91%)
Mutual labels:  framework, user-interface
Mdb Ui Kit
Bootstrap 5 & Material Design 2.0 UI KIT
Stars: ✭ 21,830 (+6358.58%)
Mutual labels:  framework, material-design
elm-mwc
Experimental Elm bindings to Material Components for the Web Webcomponents library
Stars: ✭ 15 (-95.56%)
Mutual labels:  material-components, user-interface
Framework7 Vue
Deprecated! Build full featured iOS & Android apps using Framework7 & Vue
Stars: ✭ 682 (+101.78%)
Mutual labels:  framework, material-design
Material Design For Bootstrap
Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
Stars: ✭ 9,463 (+2699.7%)
Mutual labels:  framework, material-design
Materialbanner
A library that provides an implementation of the banner widget from the Material design.
Stars: ✭ 241 (-28.7%)
Mutual labels:  material-design, material-components
Finalcut
A text-based widget toolkit
Stars: ✭ 244 (-27.81%)
Mutual labels:  framework, user-interface
Mag.js
MagJS - Modular Application Glue
Stars: ✭ 157 (-53.55%)
Mutual labels:  framework, user-interface
Material Framework
[Unmaintained] An easy to use material design based framework.
Stars: ✭ 383 (+13.31%)
Mutual labels:  framework, material-design
Visualplus
🎨 The VisualPlus Framework (VPF) for WinForms allows you to rapidly deploy professional .NET applications with customizable components and controls.
Stars: ✭ 268 (-20.71%)
Mutual labels:  framework, user-interface
Material Foundation
Material Design version of Foudation for Sites by Zurb
Stars: ✭ 361 (+6.8%)
Mutual labels:  framework, material-design
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+5843.79%)
Mutual labels:  material-design, material-components
Material Components Web
Modular and customizable Material Design UI components for the web
Stars: ✭ 15,931 (+4613.31%)
Mutual labels:  material-design, material-components
Angular Bootstrap With Material Design
Angular Bootstrap with Material Design - Powerful and free UI KIT
Stars: ✭ 1,031 (+205.03%)
Mutual labels:  framework, material-design
Material Admin
Free Material Admin Template
Stars: ✭ 219 (-35.21%)
Mutual labels:  material-design, material-components
Material Backdrop
A simple solution for implementing Backdrop pattern for Android
Stars: ✭ 221 (-34.62%)
Mutual labels:  material-design, material-components
Ionic Framework
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
Stars: ✭ 45,802 (+13450.89%)
Mutual labels:  framework, material-design
Tonic
A Low Profile Component Framework. Stable, Minimal, Auditable, and Build-Tool-Free.
Stars: ✭ 265 (-21.6%)
Mutual labels:  framework, user-interface

Material Components for the Web for Elm

Build Status

Elm-mdc allows you to write beautiful Elm applications with a Material Design look. It uses the CSS from Google's Material Components for the Web, but reimplements the JavaScript in Elm.

Screenshots

Demo

Live demo & package documentation (not released on package.elm-lang.org yet, see Building the documentation below).

Getting started

Create an index.html that looks like this:

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Getting Started</title>

  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" rel="stylesheet">
  <link href="elm-mdc/material-components-web.css" rel="stylesheet">

</head>
<body class="mdc-typography">
  <script src="elm-mdc/elm-mdc.js"></script>
  <script src="elm.js"></script>
  <div id="elm">
    <script type="text/javascript">
      Elm.Main.init({ node: document.getElementById('elm') });
    </script>
  </div>
</body>

The first three CSS files are provided by Google. The fourth CSS file is provided by this library and contains the MDC CSS.

Put the JavaScript in the body. The first JavasSript file, elm-mdc.js, is provided by this library. The second JavaScript file, called elm.js here, is your compiled Elm application.

Make sure that the file elm-mdc.js is correctly served by your web server, as otherwise this library will behave unexpectedly. See below for instructions on how to build elm-mdc.js as well as material-components-web.css.

Install

Assuming an empty directory, you create an elm-mdc application as follows:

  1. elm init.
  2. Install this library from github:
git clone [email protected]:aforemny/elm-mdc.git
  1. Build the required sources:
cd elm-mdc
make
cd ..
  1. Add the required libraries (see elm-mdc/elm.json):
elm install elm/regex
elm install elm/svg
elm install elm/json
elm install K-Adam/elm-dom
  1. Change the source-directories property in elm.json to include elm-mdc:
    "source-directories": [
        "src",
        "elm-mdc/src"
    ],
  1. Create an index.html as above.
  2. Create your first application, for now let's just copy the hello world example: cp -p elm-mdc/examples/hello-world/Main.elm src/Main.elm
  3. Compile it: elm make src/Main.elm --output app.js

And that's it.

Example application

See examples/hello-world/ for a full example. You have to run make in the root repository before to create the files elm-mdc.js and material-components-web.css.

module Main exposing (..)

import Browser
import Html exposing (Html, text)
import Material
import Material.Button as Button
import Material.Options as Options


type alias Model =
    { mdc : Material.Model Msg
    }


defaultModel : Model
defaultModel =
    { mdc = Material.defaultModel
    }


type Msg
    = Mdc (Material.Msg Msg)
    | Click


main : Program () Model Msg
main =
    Browser.element
        { init = \_ -> init
        , subscriptions = subscriptions
        , update = update
        , view = view
        }


init : ( Model, Cmd Msg )
init =
    ( defaultModel, Material.init Mdc )


subscriptions : Model -> Sub Msg
subscriptions model =
    Material.subscriptions Mdc model


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        Mdc msg_ ->
            Material.update Mdc msg_ model

        Click ->
            ( model, Cmd.none )


view : Model -> Html Msg
view model =
    Html.div []
        [
          Button.view Mdc "my-button" model.mdc
              [ Button.ripple
              , Options.onClick Click
              ]
              [ text "Click me!" ]
        ]

Build instructions

Building the demo

$ make build-demo
$ open build/index.html

Building the demo on Windows

$ build.cmd build-demo
$ build/index.html

Building the documentation

$ make docs

Building the documentation on Windows

$ build.cmd docs

Starterkit and hot reload

To get started with this library more easily, have a look at the elm-mdc starterkit. This contains a fully featured example that demonstrates hot code reload.

History

The implementation is based on debois/elm-mdl, which uses the now abandoned Material Design Lite framework.

Contribute

Contributions are warmly encouraged - please get in touch! Use GitHub to report bugs, too.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].