JSPM

office-ui-fabric-react

0.27.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 45395
  • Score
    100M100P100Q151568F
  • License MIT

Reusable React components for building experiences for Office 365.

Package Exports

  • office-ui-fabric-react
  • office-ui-fabric-react/lib
  • office-ui-fabric-react/lib-amd/components/Panel/Panel.scss
  • office-ui-fabric-react/lib/Breadcrumb
  • office-ui-fabric-react/lib/Button
  • office-ui-fabric-react/lib/Callout
  • office-ui-fabric-react/lib/Checkbox
  • office-ui-fabric-react/lib/ChoiceGroup
  • office-ui-fabric-react/lib/ColorPicker
  • office-ui-fabric-react/lib/CommandBar
  • office-ui-fabric-react/lib/ContextualMenu
  • office-ui-fabric-react/lib/DatePicker
  • office-ui-fabric-react/lib/DetailsList
  • office-ui-fabric-react/lib/Dialog
  • office-ui-fabric-react/lib/DocumentCard
  • office-ui-fabric-react/lib/Dropdown
  • office-ui-fabric-react/lib/Fabric
  • office-ui-fabric-react/lib/Facepile
  • office-ui-fabric-react/lib/FocusTrapZone
  • office-ui-fabric-react/lib/FocusZone
  • office-ui-fabric-react/lib/Image
  • office-ui-fabric-react/lib/Label
  • office-ui-fabric-react/lib/Layer
  • office-ui-fabric-react/lib/Link
  • office-ui-fabric-react/lib/List
  • office-ui-fabric-react/lib/MessageBar
  • office-ui-fabric-react/lib/Nav
  • office-ui-fabric-react/lib/Overlay
  • office-ui-fabric-react/lib/Panel
  • office-ui-fabric-react/lib/PeoplePicker
  • office-ui-fabric-react/lib/Persona
  • office-ui-fabric-react/lib/Pivot
  • office-ui-fabric-react/lib/ProgressIndicator
  • office-ui-fabric-react/lib/SearchBox
  • office-ui-fabric-react/lib/Slider
  • office-ui-fabric-react/lib/Spinner
  • office-ui-fabric-react/lib/TextField
  • office-ui-fabric-react/lib/Toggle
  • office-ui-fabric-react/lib/common/DirectionalHint
  • office-ui-fabric-react/lib/components/Button
  • office-ui-fabric-react/lib/components/Callout
  • office-ui-fabric-react/lib/components/Callout/Callout.scss.js
  • office-ui-fabric-react/lib/components/Checkbox
  • office-ui-fabric-react/lib/components/Checkbox/Checkbox
  • office-ui-fabric-react/lib/components/ChoiceGroup
  • office-ui-fabric-react/lib/components/ChoiceGroup/ChoiceGroup
  • office-ui-fabric-react/lib/components/CommandBar
  • office-ui-fabric-react/lib/components/CommandBar/CommandBar
  • office-ui-fabric-react/lib/components/ContextualMenu
  • office-ui-fabric-react/lib/components/DatePicker
  • office-ui-fabric-react/lib/components/DatePicker/DatePicker
  • office-ui-fabric-react/lib/components/DetailsList
  • office-ui-fabric-react/lib/components/DetailsList/DetailsList
  • office-ui-fabric-react/lib/components/DetailsList/DetailsRow
  • office-ui-fabric-react/lib/components/Dialog
  • office-ui-fabric-react/lib/components/Dialog/Dialog
  • office-ui-fabric-react/lib/components/Dialog/Dialog.scss.js
  • office-ui-fabric-react/lib/components/Dialog/DialogFooter
  • office-ui-fabric-react/lib/components/Dropdown
  • office-ui-fabric-react/lib/components/Dropdown/Dropdown
  • office-ui-fabric-react/lib/components/Fabric
  • office-ui-fabric-react/lib/components/FocusZone
  • office-ui-fabric-react/lib/components/Image
  • office-ui-fabric-react/lib/components/Image/Image
  • office-ui-fabric-react/lib/components/Image/Image.Props
  • office-ui-fabric-react/lib/components/Image/Image.scss.js
  • office-ui-fabric-react/lib/components/Label
  • office-ui-fabric-react/lib/components/Label/Label
  • office-ui-fabric-react/lib/components/Link
  • office-ui-fabric-react/lib/components/MessageBar
  • office-ui-fabric-react/lib/components/MessageBar/MessageBar
  • office-ui-fabric-react/lib/components/Panel
  • office-ui-fabric-react/lib/components/Panel/Panel
  • office-ui-fabric-react/lib/components/Persona/Persona
  • office-ui-fabric-react/lib/components/Pivot
  • office-ui-fabric-react/lib/components/Pivot/Pivot
  • office-ui-fabric-react/lib/components/Pivot/PivotItem
  • office-ui-fabric-react/lib/components/SearchBox
  • office-ui-fabric-react/lib/components/SearchBox/SearchBox
  • office-ui-fabric-react/lib/components/Slider
  • office-ui-fabric-react/lib/components/Slider/Slider
  • office-ui-fabric-react/lib/components/Spinner
  • office-ui-fabric-react/lib/components/Spinner/Spinner
  • office-ui-fabric-react/lib/components/TextField
  • office-ui-fabric-react/lib/components/TextField/TextField
  • office-ui-fabric-react/lib/components/Toggle
  • office-ui-fabric-react/lib/components/Toggle/Toggle
  • office-ui-fabric-react/lib/index
  • office-ui-fabric-react/lib/utilities/css
  • office-ui-fabric-react/lib/utilities/dateMath/DateMath
  • office-ui-fabric-react/lib/utilities/decorators/withResponsiveMode
  • office-ui-fabric-react/lib/utilities/decorators/withViewport
  • office-ui-fabric-react/lib/utilities/dragdrop
  • office-ui-fabric-react/lib/utilities/dragdrop/DragDropHelper
  • office-ui-fabric-react/lib/utilities/positioning
  • office-ui-fabric-react/lib/utilities/router/index
  • office-ui-fabric-react/lib/utilities/selection/Selection
  • office-ui-fabric-react/lib/utilities/selection/index
  • office-ui-fabric-react/package.json

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 (office-ui-fabric-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Office UI Fabric for React

A library of reusable, generic React components

Overview

Fabric React components are built as production ready components to be used in Microsoft products, but generalized, documented, and reusable. This enables us and our partners to more easily build great applications without spending a ton of time implementing the same things over and over.

Each component is designed to be RTL friendly, keyboard accessible, screen reader friendly, themeable, and generalized. TypeScript definition files are also included, so if you use TypeScript (which isn't a requirement), you will get compiler validation and using an editor like VS Code, you'll get intellisense. Each component is exported as a named module that can be easily imported in your code, allowing your external bundler to create small bundles that include just what you need.

Getting started

Integrating components into your project depends heavily on your setup. The recommended setup is to use a bundler such as Webpack which can resolve NPM package imports in your code and can bundle the specific things you import.

Within an npm project, you should install the package and save it as a dependency:

npm install --save office-ui-fabric-react

This will add the fabric-react project as a dependency in your package.json file, and will drop the project under node_modules/office-ui-fabric-react.

The library includes commonjs entry points under the lib folder. To use a control, you should be able to import it and use it in your render method:

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Button } from 'office-ui-fabric-react/lib/Button';

const MyPage = () => (<div><Button>I am a button.</Button></div>);

ReactDOM.render(<MyPage />, document.body.firstChild);

Notes on module vs path-based imports

While it is possible to import all components as named imports from the main module entry point, it is not recommended to do so without using a bundler that supports es6 tree shaking. In other words, if you import the Button component like this:

import { Button } from 'office-ui-fabric-react';

...this would work, but then unless you are using a tree-shaking bundler such as Rollup.js or Webpack 2, Webpack will assume you want every module exported from the main entry file to be included in your final bundle, which produces unnecessary large bundles and slows your page load down. Instead you can import the specific paths to trim down your bundle size:

import { Button } from 'office-ui-fabric-react/lib/Button';
import { Dropdown } from 'office-ui-fabric-react/lib/Dropdown';
import { List } from 'office-ui-fabric-react/lib/List';

Using an AMD bundler like r.js

If your project relies on AMD modules, they are dropped in the lib-amd folder. You will need to set up your bundler to handle the imports correctly. This may require you to symlink or copy the folder into your pre-bundle location.

Building the project

If you would like to build the project (to add functionality or fix issues) you can:

  • git clone the repo
  • npm install
  • gulp serve

This will open a web browser with the example page. You can make changes to the code which will automatically build and refresh the page using live-reload.