• AndyH

Creating links with UI Fabric


Starting simple, adding a Office UI Fabric Link component to your web part takes no time at all.


Ensure you have the right import in your code:

import { Link } from 'office-ui-fabric-react/lib/Link';

In the render method, add the Link component. There are several ways to use a link in the properties, here I use onClick to execute some code:

return <Link onClick= { this._linkClicked.bind(this) }>Click me</Link>;

For example:

private _linkClicked(): void {     alert('Clicked'); }

Take a look at the Office UI Fabric site to discover more.

 

© 2019 AndyH  -  all rights reserved