Giter VIP home page Giter VIP logo

lucid's Introduction

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.

lucid's People

Contributors

jondlm avatar sodiumjoe avatar mute avatar ogupte avatar nathaniellee avatar alisonailea avatar liliematia avatar danhahn avatar tsantef avatar rsadres avatar njlg avatar strunkandwhite avatar oliveiraddb avatar kyle-mcguire avatar jonahgeorge avatar joelgriffith avatar tarun avatar reddyesha avatar indraneel avatar glitteringkatie avatar krishoyt avatar sirkitboard avatar chrisdopuch avatar oberonix avatar smooreappnexus avatar rkaneriya avatar slaude avatar velhala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.