All Projects → lilactown → Hx

lilactown / Hx

Licence: mit
A simple, easy to use library for React development in ClojureScript.

Programming Languages

clojure
4091 projects
clojurescript
191 projects
cljs
18 projects
clj
17 projects

Projects that are alternatives of or similar to Hx

React Awesome Slider
React content transition slider. Awesome Slider is a 60fps, light weight, performant component that renders an animated set of production ready UI general purpose sliders with fullpage transition support for NextJS and GatsbyJS. 🖥️ 📱
Stars: ✭ 2,343 (+876.25%)
Mutual labels:  react-components
React Vtree
React component for efficiently rendering large tree structures
Stars: ✭ 185 (-22.92%)
Mutual labels:  react-components
Slider
React Slider
Stars: ✭ 2,681 (+1017.08%)
Mutual labels:  react-components
Enact
An app development framework built atop React that’s easy to use, performant and customizable.
Stars: ✭ 178 (-25.83%)
Mutual labels:  react-components
Griffith
A React-based web video player
Stars: ✭ 2,287 (+852.92%)
Mutual labels:  react-components
Styled Bootstrap Components
The bootstrap components made with styled-components 💅
Stars: ✭ 196 (-18.33%)
Mutual labels:  react-components
React Native Performance Monitor
React Native Performance Monitor - Realtime graphing of React Native render performance
Stars: ✭ 174 (-27.5%)
Mutual labels:  react-components
React Image Gallery
React carousel image gallery component with thumbnail support 🖼
Stars: ✭ 2,946 (+1127.5%)
Mutual labels:  react-components
React Materials
Migrate to: https://github.com/alibaba-fusion/materials
Stars: ✭ 189 (-21.25%)
Mutual labels:  react-components
Yoshino
A themable React component library!Flexible Lightweight PC UI Components built on React! Anyone can generate easily all kinds of themes by it!
Stars: ✭ 216 (-10%)
Mutual labels:  react-components
Notus React
Notus React: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 173 (-27.92%)
Mutual labels:  react-components
React Components
List of React components I use and recommend
Stars: ✭ 182 (-24.17%)
Mutual labels:  react-components
React Ui Library Tutorial
📚React组件库搭建指南
Stars: ✭ 201 (-16.25%)
Mutual labels:  react-components
React Player Controls
⏯ Dumb and (re)useful React components for media players.
Stars: ✭ 176 (-26.67%)
Mutual labels:  react-components
Tailwind React Ui
React utility component primitives & UI framework for use with Tailwind CSS
Stars: ✭ 220 (-8.33%)
Mutual labels:  react-components
Video React
A web video player built for the HTML5 world using React library.
Stars: ✭ 2,227 (+827.92%)
Mutual labels:  react-components
Reactour
Tourist Guide into your React Components
Stars: ✭ 2,782 (+1059.17%)
Mutual labels:  react-components
React Native demo
react-native实现网易新闻和美团,实现大部分页面。使用最新的react-navigation等组件,同时支持安卓和iOS设备。
Stars: ✭ 237 (-1.25%)
Mutual labels:  react-components
React Npm Boilerplate
Boilerplate for creating React Npm packages with ES2015
Stars: ✭ 226 (-5.83%)
Mutual labels:  react-components
Nano Component
Fast & simple React component styles in under 1kb
Stars: ✭ 202 (-15.83%)
Mutual labels:  react-components

hx

Clojars Project

A simple, easy to use library for React development in ClojureScript.

Update

Development on hx has moved to helix. Helix is the latest version of hx, with some breaking changes (no hiccup parser, slightly different hooks API, and a focus on compile-time semantics).

Bug fixes will still occur for some time in hx, but new features, major fixes, etc. will occur on helix.

Example

(ns my-app.core
  (:require [hx.react :as hx :refer [defnc]]
            [hx.hooks :as hooks]
            ["react-dom" :as react-dom]))

;; `defnc` creates a function that takes a props object and returns React
;; elements. You may use it just like any normal React component.
(defnc MyComponent [{:keys [initial-name]}]
  ;; use React Hooks for state management
  (let [[name update-name] (hooks/useState initial-name)]
    [:<>
     [:div "Hello " 
      [:span {:style {:font-weight "bold"}} name] "!"]
     [:div [:input {:on-change #(update-name (-> % .-target .-value))}]]]))

(react-dom/render
  ;; hx/f transforms Hiccup into a React element.
  ;; We only have to use it when we want to use hiccup outside of `defnc` / `defcomponent`
  (hx/f [MyComponent {:initial-name "React in CLJS"}])
  (. js/document getElementById "app"))

Dependencies

You'll want to make sure you have the latest version of react, and whatever renderer you are targeting (e.g. react-dom).

npm i react react-dom

If you want to use the React Hooks API (hx.hooks), you'll need to ensure you are using React 16.8 or later.

What problems does hx solve?

hx is meant to make it simple, easy and fun to use React.js within ClojureScript. It is your bridge to the wide world of React.js in idiomatic CLJS.

The library is split into (currently) three sections, which you can feel free to mix as your project sees fit:

  1. A hiccup interpreter. Takes in [:div {:style {:color "red"}} [:span "foo"]] and spits out React.createElement calls.

  2. Helpers for creating components. defnc and defcomponent help us write plain React.js components in idiomatic ClojureScript.

  3. Helpers for using React Hooks.

What problems does hx not solve?

No opinionated state management, no custom rendering queue. Use it to build your awesome opinionated async reactive immutable app framework. hx is just a Clojure-y interface to creating plain, unadulterated React components.

Documentation

Examples

Interop:

Projects that use it

License

Copyright © 2018 Will Acton

Distributed under the MIT license.

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].