Registry / web-framework / elemental

elemental

JSON →
library0.4.0jsnpmunverified

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.

npm install elemental
INSTALL
IMPORT
SIG · ELEMENTAL
E
elemental
web-frameworkjavascriptv0.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Button
import { Button } from 'elemental';
const { Button } = require('elemental');
Elemental was developed during an era when ES Modules were becoming prevalent, but CommonJS was still common. While ESM `import` syntax is shown in examples, CJS `require` might have been used in older Node.js contexts. Ensure your build system (Webpack/Browserify) handles this appropriately.
Alert
import { Alert } from 'elemental';
import Alert from 'elemental/lib/Alert';
Components are intended to be imported as named exports from the 'elemental' package. Direct deep imports from 'lib/' paths, while sometimes seen in older projects for tree-shaking, are not the officially documented approach and may not work as expected or break in patched versions.
Spinner
import { Spinner } from 'elemental';
import * as Elemental from 'elemental'; const MySpinner = Elemental.Spinner;
While importing all exports (`* as Elemental`) is syntactically valid, it can lead to larger bundle sizes if not properly tree-shaken by your bundler. Prefer named imports for specific components.

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'));
Debug
Known issues
breakingElemental UI is built for React versions `^0.14.0 || ^15.0.0`. It is incompatible with modern React versions (16+), requiring significant polyfills or wrappers, and will likely break without extensive modifications due to changes in React's API and lifecycle methods.
fix
Use Elemental UI with a compatible React environment (React 0.14.x or 15.x) or consider migrating to a actively maintained UI library. Backporting to newer React versions is highly complex and not recommended.
affects: >=0.6.1
gotchaElemental UI relies on LESS for its styling. You must configure your build process (e.g., Webpack with `less-loader`) to compile and include the `elemental.less` stylesheet, otherwise components will render unstyled.
fix
Ensure your project's build configuration includes a LESS compiler (e.g., `npm install less less-loader --save-dev` and configure Webpack to handle `.less` files). Then, import the main stylesheet: `@import '~elemental/less/elemental.less';` in your global CSS/LESS file.
affects: >=0.1.0
breakingThe Elemental UI project is effectively abandoned, with its last npm publish and GitHub activity dating back approximately seven years (as of late 2017). This means no further bug fixes, security updates, or feature development will occur.
fix
For new projects, avoid Elemental UI. For existing projects, plan for migration to a currently maintained React UI library (e.g., Ant Design, Material UI, Elemental Plus - a separate project for Vue).
affects: >=0.6.1
gotchaThe peer dependency `react-addons-css-transition-group` is deprecated in modern React. Using Elemental UI with newer React setups might lead to warnings or require manual integration of `react-transition-group` (its spiritual successor), if a compatible version can even be found for the old React versions Elemental requires.
fix
This issue is inherent to using an abandoned library with old dependencies. The most robust fix is migrating to a modern UI library. If strictly adhering to Elemental, ensure all specified peer dependencies are installed, even if deprecated.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Invariant Violation: Minified React error #XXX; visit https://reactjs.org/docs/error-decoder.html?invariant=XXX for the full message.
This generic React error often indicates a mismatch between Elemental UI's expected React environment (very old versions) and the React version installed in your project, or a misuse of old React APIs.
fix
Verify that your `react` and `react-dom` peer dependencies exactly match the `^0.14.0 || ^15.0.0` range specified by Elemental. Downgrade your React versions if necessary, or use `npm install --legacy-peer-deps` (if applicable) to force install compatible versions.
Module not found: Error: Can't resolve 'elemental/less/elemental.less' in 'your-app-path'
The main LESS stylesheet for Elemental UI is not being correctly resolved or imported by your build system, or `less-loader` is not configured.
fix
Ensure `less-loader` is installed and properly configured in your Webpack (or equivalent) setup to handle `.less` files. Add `@import '~elemental/less/elemental.less';` to your main stylesheet. Verify `node_modules` is included in your loader paths.
TypeError: Cannot read property 'propTypes' of undefined
This often occurs when trying to use React components that rely on the `React.PropTypes` API, which was removed in React v15.5. Elemental UI predates this change.
fix
While `prop-types` package can polyfill this for *some* cases, the fundamental incompatibility with modern React due to other API changes remains. The only true fix is to use Elemental with `react@<15.5` or migrate to a new UI library.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
reactrequiredPeer dependency for rendering UI components. Requires older React versions.
react-domrequiredPeer dependency for rendering React components to the DOM. Requires older React versions.
react-addons-css-transition-grouprequiredPeer dependency for handling CSS transitions in React components. Requires older React versions.
lessrequiredElemental styles are written in LESS, requiring a LESS compiler in the build process for styling to be applied.
Agent activity
6 hits · last 30 days
node
6
Resources
elemental — npm install elemental · libregistry