Navigate to the above-created directory.
Run Yeoman SharePoint Generator to create the solution.
Solution Name
Hit enter to have a default name (spfx-officeuifabric in this case) or type in any other name for your solution.
Selected choice - Hit enter
Target for component
Here, we can select the target environment where we are planning to deploy the client webpart; i.e., SharePoint Online or SharePoint OnPremise (SharePoint 2016 onwards).
Selected choice - SharePoint Online only (latest)
Place of files
We may choose to use the same folder or create a subfolder for our solution.
Selected choice - Same folder
Deployment option
Selecting Y will allow the app to be deployed instantly to all sites and will be accessible everywhere.
Selected choice - N (install on each site explicitly)
Type of client-side component to create
We can choose to create a client-side web part or an extension. Choose a web part option.
Selected choice - WebPart
Web part name
Hit enter to select the default name or type in any other name.
Selected choice - OfficeUIFabricExamples
Web part description
Hit enter to select the default description or type in any other value.
Selected choice - Office UI Fabric Integration with SPFx
Framework to use
Select any JavaScript framework to develop the component. Available choices are (No JavaScript Framework, React, and Knockout)
Selected choice - React
Yeoman generator will perform scaffolding process to generate the solution. The scaffolding process will take a significant amount of time.
Once the scaffolding process is completed, lock down the version of project dependencies by running the below command.
In the command prompt type the below command to open the solution in the code editor of your choice.
Office UI Fabric Components
Office UI Fabric has the below-categorized components,
Basic Inputs
- Button
- Checkbox
- ChoiceGroup
- ComboBox
- ContextualMenu
- Dropdown
- Label
- Link
- Rating
- Slider
- SpinButton
- TextField
- Toggle
Navigation
- Breadcrumb
- CommandBar
- Nav
- OverflowSet
- Pivot
- SearchBox
Content
- ActivityItem
- Calendar
- DetailsList
- Facepile
- GroupedList
- Icon
- Image
- List
- Persona
Pickers
- Pickers
- ColorPicker
- DatePicker
- PeoplePicker
- SwatchColorPicker
Progress & Validation
- MessageBar
- ProgressIndicator
- Shimmer
- Spinner
Surfaces
- Callout
- Dialog
- DocumentCard
- HoverCard
- Layer
- Modal
- Overlay
- Panel
- ScrollablePane
- TeachingBubble
- Tooltip
- Coachmark
Utilities
- FocusTrapZone
- FocusZone
- MarqueeSelection
- ResizeGroup
- Selection
- Themes
ow to use Office UI Fabric Components in SPFx WebPart
- Navigate to Office UI Fabric Components site here.
- Select and expand the Category of your component.
- Click the component node.
- Below is an example of selecting a button component.
- Alternatively, search your component from the search box.
- Click Variants tab to see the variations for use of the component.
- Click “Show code” to get the code for the component.
- Copy entire code or part of it to use in your SPFx solution.