supermacro / elm-antd

The official Ant Design UI Kit for Elm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gDelgado14/elm-antd logo

Elm Ant Design

ELM_ANTD This project is using Percy.io for visual regression testing.

Component Gallery

API Documentation

Bringing the amazing Ant Design kit to Elm!

Styled entirely using elm-css! No external stylesheet needed. Just elm install supermacro/elm-antd and you're all good to go!

Early Development Notice:

Elm Ant Design is not fully implemented and in a early / exploratory phase. A lot of APIs may not work yet (in the event that this is the case, please report it as an issue - which I will prioritize). The current API is subject to frequent change, but because Elm is super cool 😎, any breaking changes are guaranteed to be released under a Major release (as per semver).

Installation

elm install supermacro/elm-antd

Usage

Render stylesheet at the root of your Elm project

Elm Antd has a stylesheet implemented in Elm that you must hook up at the root of your elm project. You must use one of Ant.Css.defaultStyles or Ant.Css.createThemedStyles customTheme (see official docs to learn about theming).

import Ant.Css

view : Model -> Html Msg
view model =
    div []
      [ Ant.Css.defaultStyles
      , viewApp model
      ]

Apply Normalize Css

Elm Ant Design is built with normalize.css as its blank canvas.

You should add normalize.css to your project or else the components may not look as expected.

You have three options:

  • Add normalize.css as a link tag to your html directly
<link href="https://pagecdn.io/lib/normalize/8.0.1/normalize.min.css" rel="stylesheet" crossorigin="anonymous"  >
import Css.ModernNormalize as ModernNormalize

view : Model -> Html Msg
view _ =
    [ ModernNormalize.globalHtml
    , Ant.Css.defaultStyles
      -- Your application view comes here
    ]
  • Use a bundler for NodeJS to load normalize into your app at build-time.

npm module Link: https://www.npmjs.com/package/normalize

require('normalize')

[Optional] - Add Extra animations

There are additional animations you can add to your elm-antd project by adding JS event handlers to your app.

You can add them in one of two ways:

  • Add the following script tag to the head of your html file:
<script src="https://cdn.jsdelivr.net/npm/elm-antd-extras@1.0.0/index.js"></script>
  • install elm-antd-extras npm package and use a bundling tool like webpack, gulp, etc in order to include the code into your html file

Contributing

Want to help out?

  • Check out the issues, and search for "good first issue" or "help wanted"!
  • Check out the CONTRIBUTING doc

Inspiration:

About

The official Ant Design UI Kit for Elm

License:MIT License


Languages

Language:Elm 97.6%Language:JavaScript 2.1%Language:Dockerfile 0.1%Language:Shell 0.1%Language:HTML 0.1%