gatsby-plugin-fabric-ui
Gatsby plugin for the Office Fabric UI framework. Adds the boilerplate needed for server-side rendering, which Gatsby performs during gatsby build
.
Installation
npm install office-ui-fabric-react gatsby-plugin-fabric-ui
Usage
After installing the plugin, add it to your site's config file:
gatsby-config.js
moduleexports = plugins: 'gatsby-plugin-fabric-ui';
Then you can use any of the components as usual:
import React from 'react';import DefaultButton from 'office-ui-fabric-react'; const Index = <div> <DefaultButton>Hello world!</DefaultButton> </div>; ;
See the test folder for an example Gatsby site.
Compatibility
Currently only tested with:
react
v16gatsby
v2office-ui-fabric-react
v6
Contributing
- Clone this repo.
npm install
- Make changes to
gatsby-ssr.jsx
. Please also prettier vianpm run format
. - To test your changes, run the sample project:
cd testnpm installnpm run build # test that SSR works properly npm run develop # launches the sample site
- In the main package, you can also run
npm test
.