Git Product home page Git Product logo

antizer's Introduction

antizer

Antizer is a ClojureScript library implementing Ant Design React components for Reagent and Rum.

Ant Design is an enterprise-class UI design language and React-based implementation with the following features:

  • An enterprise-class UI design language for web applications.
  • A set of high-quality React components out of the box.
  • Extensive API documentation and examples.

Resources

Status

All the Ant Design components should be fully functional and production-ready. If you discover any missing or invalid components, please file a ticket.

Who's Using Antizer

Please let me know if you are using Antizer within your project, and I will gladly add that in here.

Usage

To use Antizer, add the following to your project.clj:

[antizer "0.2.2"]

You would also need to add the ClojureScript React library that you will be using.

For Reagent:

[reagent "X.Y.Z"]

For Rum:

[rum "X.Y.Z"]

It is also necessary to include the Ant Design CSS stylesheet in your HTML page. The CSS files can be obtained from the following classpaths:

  • cljsjs/antd/development/antd.inc.css
  • cljsjs/antd/production/antd.min.inc.css

You can also follow the instructions for customization with LESS here.

Quick Example

For Reagent:

(require '[antizer.reagent :as ant])
(require '[reagent.core :as r])

(defn render []
  [ant/button {:on-click #(ant/message-info "Hello Reagent!")} "Click me"])

(defn init! []
  (r/render [render] (.-body js/document)))

For Rum:

(require '[antizer.rum :as ant])
(require '[rum.core :as rum])

(defn render []
  (ant/button {:on-click #(ant/message-info "Hello Rum!")} "Click me"))

(defn init! []
  (rum/mount (render) (.-body js/document)))

Examples

To compile the examples:

lein with-profile +examples cljsbuild once

To compile the examples and enable hot reloading with figwheel:

lein with-profile +examples-dev figwheel

After compilation, open up the respective HTML page in the examples/resources folder in your browser.

Changes

0.2.2

  • Updated antd library to 2.12.3.
  • Fixed resource typo in README.md and documentation.
  • Added missing components: Breadcumb.Item.
  • Added new component: Input.TextArea.
  • Fixed layout issue in examples.
  • Added note on DatePicker and Calendar known issues.

0.2.1

  • Updated antd library to 2.11.2.
  • Updated instructions for CSS file inclusion.
  • Added Avatar component and example.
  • Fixed layout and CSS styles for examples.
  • Fixed cljsbuild settings for examples.

Known Issues

DatePicker and Calendar date text are not displayed in the correct language when no date value has been set.

This is due to how the moment.js library is being packaged currently. The date values must always be present for the components in order for the date to be displayed correctly. A bug report has been filed with the antd library here.

Here is a workaround for now:

  • Set default-value to a moment object ie: :default-value (js/moment) when using the DatePicker or Calendar component.
  • Disable the clear date feature by setting :allow-clear to false.

Acknowledgement

Thanks to Ant Design, cljsjs/antd, Reagent, Rum and of course ClojureScript, without which this project would not be possible.

License

Copyright © 2017 Michael Lim

Licensed under Eclipse Public License (see LICENSE).

antizer's People

Contributors

priornix avatar

Watchers

 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.