A UI component library from AppNexus.
Switch branches/tags
Clone or download
Latest commit fe661b1 Sep 17, 2018
Permalink
Failed to load latest commit information.
.storybook Add SplitPanel component, docs, tests, examples. May 2, 2018
docs removes empty state from examples Jul 19, 2018
scripts Fix docspot upload script Aug 13, 2018
src Merge branch 'master' into 953-update-icons-to-fill-space Sep 14, 2018
stories adds a Title prop and replaces an input with a TextField Jun 28, 2018
tests remove debugging timeouts Nov 6, 2017
.babelrc fix docs mode Apr 25, 2018
.editorconfig Adding basic travis support Feb 19, 2016
.eslintignore Upgraded eslint, added lint fix, and removed gulp-eslint Nov 21, 2016
.eslintrc Fixes tests and linting Apr 14, 2017
.gitignore got first draft of ProgressBar working Jun 19, 2018
.npmignore Adds snapshot directories to .npmignore Nov 28, 2016
.npmrc Add .npmrc with public registry Mar 30, 2016
.prettierrc move prettier config to config file Feb 20, 2018
.stylelintrc #777: stylelint cleanup Jun 2, 2017
.travis.yml Move docs publish rom travis ci to the local `postpublish` phase Mar 7, 2018
CONTRIBUTING.md Updated README and CONTRIBUTING with create-component script instruct… Apr 26, 2018
LICENSE Initial commit Feb 17, 2016
PULL_REQUEST_TEMPLATE.md No more IE 11 Jun 6, 2017
README.md Updated README and CONTRIBUTING with create-component script instruct… Apr 26, 2018
codecov.yml Adds codecov.yml file. Nov 29, 2016
package.json v2.36.1 Aug 23, 2018
postcss.config.js upgrade bundle build to webpack 4 & loaders Apr 6, 2018
webpack.config.bundle.js restore dist/index.css to the build artifacts, to fix backward Apr 11, 2018
yarn.lock fix docs mode Apr 25, 2018

README.md

Lucid Build Status codecov Stories in Ready

A UI component library from AppNexus.

Install

Lucid can be installed with npm

npm install --save lucid-ui

or yarn

yarn add lucid-ui

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import Button from 'lucid-ui/Button';
// `import { Button } from 'lucid-ui'` also works but will result in larger bundle sizes

ReactDOM.render(
  <Button>Hello World</Button>,
  mountNode
);

Lucid uses less for its stylesheets. If you use less, you can include the styles like so:

@import "node_modules/lucid-ui/src/index.less";

If you don't use less, you can use the precompiled css file node_modules/lucid-ui/dist/index.css.

Dependencies

lucid-ui has several React peer dependencies. This means your application is responsible for declaring dependencies on compatible versions. Currently we support React 15 and 16.

Example package.json:

{
  "dependencies": {
    "lucid-ui": "^2.0.0",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
  }
}

To contribute to lucid, please see CONTRIBUTING.md.

Reducing bundle size

Path imports

If you're starting a new project it's best to simply import all your components by their paths. This will make sure that only the components you need will be included in your bundle:

import Button from 'lucid-ui/Button';
import DataTable from 'lucid-ui/DataTable';

Babel plugin

If you have an existing project using lucid you should consider using babel plugin import that can automatically transform your ES6 module imports into path imports. Under the hood it will transform import code like this:

import { Button } from 'lucid-ui';

into

import Button from 'lucid-ui/Button';

Here's a .babelrc plugin configuration that works with lucid:

"plugins": [
  [
    "import",
    {
      "libraryName": "lucid-ui",
      "libraryDirectory": "",
      "camel2DashComponentName": false
    }
  ]
]

Credits

  • BrowserStack for providing cross-browser testing infrastructure.
  • Travis CI for providing continuous integration infrastructure.
  • CodeCov for providing code coverage analysis infrastructure.