Code Monkey home page Code Monkey logo

lp-components's Introduction

NPM version

lp-components

Reusable UI components for React apps.

import React from 'react'
import { Spinner } from '@launchpadlab/lp-components'

function MyLoadingComponent({ data }) {
  return data ? <div>{data}</div> : <Spinner />
}

This library contains components for status indicators, custom inputs, flash messages and more. A full list of available components can be found in the documentation or in the interactive component playground.

Documentation

Documentation and usage info can be found in docs.md.

Migration Guides

Contribution

This package follows the Opex NPM package guidelines. Please refer to the linked document for information on contributing, testing and versioning.

Additional info

Size Limit

This library uses size-limit to prevent size bloat. The yarn size script is run in CI to check that the package size is under the limit specified in .size-limit.js. For a visualization of this package's relative dependency sizes, you can run yarn size --why.

React Storybook

This library uses React Storybook to render components in a development sandbox. In order to view the storybook, run yarn run storybook and navigate to the localhost port indicated.

Every new component added to this library should be accompanied by a new story in the storybook.

When pull requests are submitted, a Heroku review app will be deployed containing the revised storybook so that reviewers can view the changes made.

DateInput styles

The DateInput component requires special styles in order to render correctly. These styles most be imported from the react-datepicker folder in node_modules and imported into your sass. To do this, make the following changes to your webpack.config.js and application.scss:

webpack.config.js:

Add a line near the top of the file specifying the path to the react-datepicker styles:

const datePickerPath = path.resolve(__dirname, '../node_modules/react-datepicker/src/stylesheets')

Then, add this path to the includePaths array of the sass loader:

{
    test: /.scss$/,
    loader: "sass",
    query: { includePaths: [ ... , datePickerPath ] }
}

application.scss:

Import the react-datepicker styles by adding this line:

@import "datepicker";

lp-components's People

Contributors

dpikt avatar lpluser avatar chawes13 avatar inveterateliterate avatar francirp avatar mwislek avatar greenkeeper[bot] avatar marchwiany avatar danparnella avatar ghrlee avatar rgaban avatar renovate[bot] avatar aojin avatar jhp0621 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.