Elemental UI Framework

0.6.1 · abandoned · verified Sun Apr 19

Elemental is an open-source React & CSS UI Framework designed for building web applications, developed by Thinkmill. The project's latest version is 0.6.1, and its primary focus was to provide a modular set of UI components built to natively implement React patterns, particularly for use with KeystoneJS. While the original vision included being 'currently under development' and responsive to feedback for API experimentation and styling transitions, the project has not seen updates since around 2017, making it effectively abandoned. It supported older React versions (0.14 and 15) and leveraged LESS for styling, requiring a LESS compiler in the build process. Key differentiators included its unopinionated default style and flexible theming capabilities, built upon React.js, LESS, Babel, and Gulp.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates rendering a Button, an Alert, and a Spinner component from Elemental UI in a basic React application, including toggling the alert visibility. It highlights the need for LESS compilation for styles.

import React from 'react';
import ReactDOM from 'react-dom';
import { Button, Alert, Spinner } from 'elemental';

// Elemental's styles are written in LESS and need to be imported or compiled.
// For a modern setup, you would typically configure your build tool (e.g., Webpack)
// to process LESS files and import the main stylesheet.
// E.g., in your main JS/TS entry file or a global CSS file:
// @import './node_modules/elemental/less/elemental.less';
// Or compile it via CLI: lessc ./node_modules/elemental/less/elemental.less styles.min.css

function App() {
  const [showAlert, setShowAlert] = React.useState(false);

  return (
    <div>
      <h1>Elemental UI Demo</h1>
      <Button onClick={() => alert('Hello from Elemental!')} type="primary">
        Click Me
      </Button>
      <Button onClick={() => setShowAlert(!showAlert)} type="link">
        Toggle Alert
      </Button>
      {showAlert && (
        <Alert type="info">
          This is an Elemental Alert!
          <Button type="link" onClick={() => setShowAlert(false)}>Close</Button>
        </Alert>
      )}
      <div style={{ padding: '20px' }}>
        <Spinner size="lg" />
      </div>
    </div>
  );
}

ReactDOM.render(<App />, document.getElementById('root'));

view raw JSON →