Socket
Book a DemoInstallSign in
Socket

electrode-demo-index

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electrode-demo-index

An extendable class for demos in Electrode components

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
3
Weekly downloads
 
Created
Source

Electrode Demo Index

NPM version Dependency Status devDependency Status

A shared demo component for Electrode components.

Installation

npm i --save-dev electrode-demo-index

Usage

Components should implement a demo/demo.jsx file as follows.

demo/demo.jsx

import React from "react";
import Demo from "electrode-demo-index";

import * as libraryScope from "../src/index";

const locale = "en";
const messages = require(`../src/lang/${locale}.json`);
const localeData = require(`react-intl/locale-data/${locale}`);

addLocaleData(localeData);

const components = [
  {
    title: "Component Title",
    examples: [
      {
        title: "Example Title",
        type: "playground",
        code: require("./examples/EXAMPLE_FILE.example")
      } // any additional examples here
    ]
  } // any additional components here
];
const localScope = {IntlProvider, messages, locale};

const demo = () => <Demo libraryScope={libraryScope} components={components} />;

export default demo;

Built with :heart: by Team Electrode @WalmartLabs.

Keywords

electrode

FAQs

Package last updated on 02 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.