Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/fabric-website/src/pages/GetStarted/GetStartedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ export class GetStartedPage extends React.Component<any, any> {
</CodeBlock>
</li>
<li>
<p>With office-ui-fabric-react as a dependency in your package.json file, you can now start using components and styling. To reference a component, import it and use it in your render method:</p>
<p>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. Note that wrapping your application in the Fabric component is required to support RTL, keyboard focus and other features.</p>
<CodeBlock language='javascript' isLightTheme={ true }>
{
`import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Fabric } from 'office-ui-fabric-react/lib/Fabric';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';

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

ReactDOM.render(<MyPage />, document.body.firstChild);`
}
Expand Down
7 changes: 4 additions & 3 deletions packages/office-ui-fabric-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ 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:
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. Note that wrapping your application in the Fabric component is required to support RTL, keyboard focus and other features.

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

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

ReactDOM.render(<MyPage />, document.body.firstChild);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ export class GettingStartedPage extends React.Component<any, any> {
}</p>

<p>{
`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:`
`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. Note that wrapping your application in the Fabric component is required to support RTL, keyboard focus and other features.`
}</p>

<div className='ms-GettingStartedPage-code'>
<Highlight className='typescript'>{
`import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Fabric } from 'office-ui-fabric-react/lib/Fabric';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';

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

ReactDOM.render(<MyPage />, document.body.firstChild);`
}</Highlight>
Expand Down