JSPM

@patternfly/react-core

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 96497
  • Score
    100M100P100Q164470F
  • License Apache-2.0

This library provides a set of common React components for use with the PatternFly reference implementation.

Package Exports

  • @patternfly/react-core
  • @patternfly/react-core/dist/esm/components/Button
  • @patternfly/react-core/dist/esm/components/Button/Button.js
  • @patternfly/react-core/dist/esm/components/Title
  • @patternfly/react-core/dist/esm/components/Title/Title.js
  • @patternfly/react-core/dist/js/components/Button
  • @patternfly/react-core/dist/js/components/Button/Button
  • @patternfly/react-core/dist/js/components/Button/Button.js
  • @patternfly/react-core/dist/js/components/Title/Title
  • @patternfly/react-core/dist/js/components/Title/Title.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@patternfly/react-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@patternfly/react-core

This package provides Core PatternFly components for the PatternFly 4.

Installing

yarn add @patternfly/react-core

or

npm install @patternfly/react-core --save

Usage

Pre-requisites

It's strongly advised to use the Patternfly Base CSS in your whole project, or some components may diverge in appearance:

import '@patternfly/react-core/styles/patternfly.css';

Example Component Usage

import React from 'react';
import { Button } from '@patternfly/react-core';

export default (
  <Button variant="primary">Button</Button>
);

All css related to each component is provided alongside it. There is no component level CSS to import.

Documentation

A comprehensive list of components and detailed usage of each can be found on the PatternFly React Docs website You can also find how each component is meant to be used from a design perspective on the PatternFly 4 Core website.

Contributing Components

This library makes use of the babel plugin from @patternfly/react-styles to enable providing the CSS alongside the components. This removes the need for consumers to use (style|css|sass)-loaders. For an example of using CSS from core you can reference Button.js. For any CSS not provided by core please use the StyleSheet.create utility from @patternfly/react-styles. This will prevent collisions with any consumers, and allow the CSS to be bundled with the component.

Building

yarn build

Note the build scripts for this are located in the root package.json under yarn build.

Testing

Testing is done at the root of this repo. To only run the patternfly-react tests:

yarn test packages/react-core