Reagent screenshot

Reagent

Author Avatar Theme by Reagent project
Updated: 19 Mar 2025
4810 Stars

A minimalistic ClojureScript interface to React.js

Overview:

Reagent is a simple ClojureScript interface to React that provides an efficient way to write React components using primarily ClojureScript functions. This tool allows developers to leverage the power of React while using familiar ClojureScript syntax to create dynamic and interactive user interfaces.

Features:

  • Efficient React Components: Write React components using plain ClojureScript functions.
  • Hiccup-like Markup: Reagent uses Hiccup-like markup for defining components.
  • State Management: Manage component state using Reagent’s version of atom.
  • Performance Optimization: Reagent leverages ClojureScript to optimize rendering and improve performance.
  • Small Code Size: Despite the powerful features, Reagent maintains a compact code size for efficiency.
  • Support for React 17: Reagent is tested against React 17 and ensures compatibility with other versions.

Installation:

To create a new Reagent project using Leiningen template, run the following command:

lein new reagent my-project

For setting up a Reagent project without a Clojure backend, execute the following command:

lein new reagent +re-frame my-project

To add Reagent to an existing project, include the following dependency in your project.clj:

[reagent "x.y.z"]

If React is not provided by npm or Cljsjs React packages, ensure to provide React for Reagent to function properly.

Summary:

Reagent offers a seamless integration of React components within ClojureScript applications. By utilizing a familiar syntax and providing performance optimization, developers can efficiently create dynamic user interfaces. With support for React 17 and a compact code size, Reagent simplifies the development process while ensuring compatibility with various React versions.