Element is built and distributed as an npm package. This means that it can be bundled and included in any Node JS application with just an
import element from 'element'; import brandfile from './brandfile'; // Create a new Element server. // The brandfile contains any configuration changes // you might want to make. const server = element(brandfile); // Element uses Express JS under the hood. You can add // any custom routes you may need or leverage any connect-style // middleware the same way you would in vanilla Express. server.get('/hello-world', (req, res) => res.send('Hello World!')); // Start listening on port 3000. Running Element gets you a default // homepage and common templates like articles and galleries // out of the box. server.listen(3000);
Components are the foundation of every Element template. A component could be anything: A video player, an inline gallery, or a list of content, to name a few examples. They can also be replaced with custom markup or functionality based on each brand or site's needs.