All Projects → day8 → Re Com

day8 / Re Com

Licence: mit
A ClojureScript library of reusable components for Reagent

Programming Languages

clojure
4091 projects
clojurescript
191 projects

Projects that are alternatives of or similar to Re Com

re-frame-http-fx-alpha
A ClojureScript client library for HTTP requests. Provides a re-frame "effect handler" keyed :http
Stars: ✭ 37 (-94.64%)
Mutual labels:  reagent, re-frame
Status React
a free (libre) open source, mobile OS for Ethereum
Stars: ✭ 3,307 (+379.28%)
Mutual labels:  reagent, re-frame
notebook
Web based Clojure notebook application/-library.
Stars: ✭ 96 (-86.09%)
Mutual labels:  reagent, re-frame
tailwind-hiccup
tailwindcss + hiccup = 👍👍
Stars: ✭ 34 (-95.07%)
Mutual labels:  reagent, re-frame
Re Frame Template
A Leiningen template for creating a re-frame application (client only)
Stars: ✭ 454 (-34.2%)
Mutual labels:  reagent, re-frame
re-alm
An Elm Architecture experiment in ClojureScript
Stars: ✭ 24 (-96.52%)
Mutual labels:  reagent, re-frame
Kee Frame
re-frame with batteries included
Stars: ✭ 289 (-58.12%)
Mutual labels:  reagent, re-frame
breaking-point
BREAKING-POINT lets you quickly define and subscribe to screen (i.e. window) breakpoints in your re-frame application
Stars: ✭ 36 (-94.78%)
Mutual labels:  reagent, re-frame
Conduit
Real world application built with ClojureScript + re-frame
Stars: ✭ 422 (-38.84%)
Mutual labels:  reagent, re-frame
Re Frisk
Take full control of re-frame app
Stars: ✭ 396 (-42.61%)
Mutual labels:  reagent, re-frame
re-pressed
re-pressed is a clojurescript library that handles keyboard events for re-frame applications.
Stars: ✭ 150 (-78.26%)
Mutual labels:  reagent, re-frame
Re Frame
A ClojureScript framework for building user interfaces, leveraging React
Stars: ✭ 4,980 (+621.74%)
Mutual labels:  reagent, re-frame
learn-re-frame-course-files
🎦 Learn re-frame course files for building Cheffy app
Stars: ✭ 51 (-92.61%)
Mutual labels:  reagent, re-frame
nw-calculator
A crafting calculator for the New World game
Stars: ✭ 16 (-97.68%)
Mutual labels:  reagent, re-frame
roll
RPG dice roller with both Rust CLI and ClojureScript Web interfaces
Stars: ✭ 14 (-97.97%)
Mutual labels:  reagent, re-frame
Stylefy
Clojure(Script) library for styling user interface components with ease.
Stars: ✭ 273 (-60.43%)
Mutual labels:  reagent, ui-components
rn-shadow-steroid
React Native with shadow-cljs on steroids
Stars: ✭ 57 (-91.74%)
Mutual labels:  reagent, re-frame
compound
A micro structure for reframe data
Stars: ✭ 116 (-83.19%)
Mutual labels:  reagent, re-frame
Lein template descjop
A Leiningen template(Clojure/ClojureScript Project) for Web based desktop application with Electron (atom-shell).
Stars: ✭ 394 (-42.9%)
Mutual labels:  reagent, re-frame
Re Frame 10x
A debugging dashboard for re-frame. X-ray vision as tooling.
Stars: ✭ 491 (-28.84%)
Mutual labels:  reagent, re-frame

CI CD GitHub tag (latest by date) Clojars Project GitHub issues GitHub pull requests License

re-com

A ClojureScript library of UI components for Reagent.

re-com provides:

  • familiar UI widgetry components such as dropdowns, date pickers, popovers, tabs, etc.
  • layout components, which arrange widgets vertically and horizontally, within splitters, etc. Plus components which put borders around their children. These various pieces can be arbitrarily nested to create sophisticated layouts.
  • a mostly Bootstrap look, mixed with some Material Design Icons.

In short, re-com attempts to provide the kind of UI basics you'd need to build a desktop-class SPA app.

It Uses Flexbox

The entire layout side of this library relies on Flexbox

Now, pretty much every modern browser has support for Flexbox so this is probably a non-issue these days, unless you need to support old versions of IE.

We build desktop-class apps to run in controlled browser environments like Electron. So, we know we're dealing with Chrome.

Warning: No Mobile Focus

None of the components have been designed with mobile in mind. We said we had a desktop app focus, right?

Neither have we been worried too much about code size because other design goals have taken precedence. To give you some idea, our main demo app which includes every component, plus all demo code and plenty of yadda yadda explanatory strings, comes to about 167K compressed when using :optimizations :advanced (700K uncompressed). That number includes ReactJS plus the ClojureScript libs and runtime. So, everything. Note: these numbers no longer match the demo app. We wanted to show off some of the debug features in our demo app, so we backed away from fully advanced, minified compilation.

So, Without Ado Being Any Furthered ...

Start by looking at the demo.

Navigating The Source

When you are running the demo app, look to the the right of each page's titles, and you'll see hyperlinks which will take you to the associated source code. That's a convenient way to navigate to either the components themselves or the demo code.

When browsing more generally, look in the src directory or this repo, you'll notice two sub-directories:

  • re-com - the library itself - the components
  • re-demo - the demo app, which shows how to use the components

Useful Commands

  1. Getting The Repo

    git clone https://github.com/day8/re-com.git
    
    cd re-com
    
  2. Compiling And Running The Demo

    lein watch
    

    This will run the demo, by doing:

    • a clean
    • a compile

    Wait until [:demo] Build completed. is displayed in the console indicating the dev HTTP server is ready.

    Now you can open http://localhost:3449/ in your browser.

  3. Run The (erm, modest) Tests

    lein ci
    

    This will:

    • clean
    • compile the tests
    • compile in release mode as a basic optimized build check
  4. Run or Debug the tests:

    lein watch
    
  5. Deploy The Demo App To S3 bucket

    This will only work if you have the right credentials in your env:

    lein deploy-aws
    

Using re-com

re-com is available from clojars. Add it to your project.clj dependencies:

Clojars Project

You should now be able to require the re-com.core namespace, which exposes all of the API functions documented in the re-demo example app.

You'll then need to include these asset folders in your app: https://github.com/day8/re-com/tree/master/run/resources/public/assets

As far as your index.html is concerned, take inspiration from here: https://github.com/day8/re-com/tree/master/run/resources/public

In particular, you'll need bootstrap (assumedly via a CDN):

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css">

And a reference to these two CSS files (make sure re-com.css appears after bootstrap.css):

<link rel="stylesheet" href="assets/css/material-design-iconic-font.min.css">
<link rel="stylesheet" href="assets/css/re-com.css">

And a reference to the Roboto fonts (but this can be overridden relatively easily):

<link href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300' rel='stylesheet' type='text/css'>

Reagent comes bundled with a matching version of ReactJS, so you don't need to include it explicitly.

MVC

If you decide to use re-com, consider also using re-frame (an MVC-ish framework).

Although both re-frame and re-com can be used independently of each other, they dovetail well.

Lein Template

See re-frame-template.

The Missing Components

  • tree (not hard, just haven't needed one yet)
  • menus - there's a dropdown, but no cascading menus
  • accordion
  • maybe a dockable LHS navbar
  • virtual grid. Straight v-box is good enough at small grids, so no problem there. But when the number of rows gets huge, you need a widget which does virtual rows, otherwise there's just too much DOM and there's performance problems. Can we use Fixed Data Tables for React?
  • drag and drop.
  • animations / transitions. We have ideas. They seem clunky.
  • Focus management - When the user presses tab, to which field does focus move?

Helping

  1. Where the docs are wrong or fall short, write up something better. Because our docs take the form of an app written in ClojureScript using re-com, you're actually exercising your knowledge of re-com as you do this.
  2. See the list of missing components above. You'll have to produce the component itself, including a params spec, plus the extra page in the demo app.
  3. Test re-com on new browsers and iron out any quirks. Our focus is strictly Chrome.

When creating new components, we have found it useful to use the CSS from existing JavaScript projects (assuming their licence is compatible with MIT) and then replace the JavaScript with ClojureScript. Reagent really is very nice.

Also, please refer to CONTRIBUTING.md for further details on creating issues and pull requests.

License

Copyright © 2015-2021 Michael Thompson

Distributed under The MIT License (MIT) - See LICENSE.txt

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