All Projects → react-lds → react-lds

react-lds / react-lds

Licence: MIT license
⚡ React components for the Salesforce Lightning Design System

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-lds

socket.io-react
A High-Order component to connect React and Socket.io easily
Stars: ✭ 67 (+139.29%)
Mutual labels:  react-components
best-of-react
🏆 A ranked list of awesome React open-source libraries and tools. Updated weekly.
Stars: ✭ 364 (+1200%)
Mutual labels:  react-components
rebass
⚛️ React primitive UI components built with styled-system.
Stars: ✭ 7,844 (+27914.29%)
Mutual labels:  react-components
mdb4-react-ui-kit
React Bootstrap with Material Design - Powerful and free UI KIT
Stars: ✭ 74 (+164.29%)
Mutual labels:  react-components
cnode-react
a web app for cnode.org with react + react-router + react-redux
Stars: ✭ 23 (-17.86%)
Mutual labels:  react-components
Registration-and-Login-using-MERN-stack
Simple Registration and Login component with MERN stack
Stars: ✭ 210 (+650%)
Mutual labels:  react-components
superglue
A productive library for Classic Rails, React and Redux
Stars: ✭ 106 (+278.57%)
Mutual labels:  react-components
react-jwt-auth
React JWT Authentication & Authorization example - React.js Login and Registration example
Stars: ✭ 307 (+996.43%)
Mutual labels:  react-components
bezier-react
React components library that implements Bezier Design System.
Stars: ✭ 85 (+203.57%)
Mutual labels:  react-components
klyva
A state management library that follows the React component model
Stars: ✭ 53 (+89.29%)
Mutual labels:  react-components
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (+203.57%)
Mutual labels:  react-components
dumb-bem
Simple BEM react components generator
Stars: ✭ 32 (+14.29%)
Mutual labels:  react-components
resource-center
New version of the resource center built with ReactJS
Stars: ✭ 89 (+217.86%)
Mutual labels:  react-components
react-fundamentals
React fundamentals
Stars: ✭ 15 (-46.43%)
Mutual labels:  react-components
react-semantic-render
Semantic helper components for rendering content with React.
Stars: ✭ 13 (-53.57%)
Mutual labels:  react-components
boilerplate-react-redux-pwa
It's sample boilerplate with pwa + react + redux + redux-saga
Stars: ✭ 14 (-50%)
Mutual labels:  react-components
Salesforce-Custom-Path-Assistant-LWC
A Salesforce custom path assistant built using only Lightning Web Components
Stars: ✭ 37 (+32.14%)
Mutual labels:  salesforce-lightning
ancestor
💀 UI primitives for ReScript and React
Stars: ✭ 144 (+414.29%)
Mutual labels:  react-components
deer-ui
Deer UI 一个可插拔,轻量级的 React 组件库
Stars: ✭ 46 (+64.29%)
Mutual labels:  react-components
react-sanctum
Easily hook up your React app to Laravel Sanctum and Laravel Fortify
Stars: ✭ 100 (+257.14%)
Mutual labels:  react-components

React LDS Travis

react-lds provides React components for the Salesforce Lightning Design System.

Installation

To install the stable version with npm, run:

npm install --save react react-dom moment moment-timezone moment-range
npm install react-lds --save

Usage

react-lds exports components as modules. You can consume these via import in your own React components.

import React from 'react';
import { Badge } from 'react-lds';

const HelloWorld = props => (
  <Badge theme="warning" label={props.message} />
);

Head over to the Storybook Docs to see a list of available components and their usage as well as interactive sample implementations of each component.

ES Modules

By default, react-lds transpiles to commonJS modules. You can import ES modules directly by importing components from react-lds/es. This enables tree-shaking when using Webpack or similiar bundlers.

// CommonJS import (Supported browsers: IE11+, last 2 versions)
import { Badge } from 'react-lds';
// ES import (Supported browsers: last 2 versions)
import { Badge } from 'react-lds/es';

Do not mix imports from react-lds and react-lds/es in your codebase. This will duplicate code.

Context

In order to use ReactLDS, you will have to provide assetBasePath via the React Context.

import { Children, Component } from 'react';
import PropTypes from 'prop-types';

class AssetPathProvider extends Component {
  getChildContext() {
    return {
      assetBasePath: 'assets/',
    };
  }

  render() {
    const { children } = this.props;

    return (
      <div>
        {children}
      </div>
    );
  }
}

AssetPathProvider.propTypes = {
  children: PropTypes.node.isRequired,
};

AssetPathProvider.childContextTypes = {
  assetBasePath: PropTypes.string,
};

Development

yarn install and yarn start. Add or modify stories in ./stories Happy hacking!

Scaffold components

New components can be scaffolded with hygen templates. To add a component, run npx hygen component new --name Foo.

Developing while embedded into a react project

npm link in this folder. After you changed stuff, run npm build to update the files inside the ./dist folder, because that's the entry point for external react applications.

In your react app: npm link react-lds.

Publish

  • Open a new pull request from /release/{version}
  • Adjust version in package.json
  • Write CHANGELOG.md
  • Merge into master and add a new tag. Travis will do the rest

react-lds started as a Propertybase project in 2016 and was maintained by Propertybase between 2016-2020.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].