Fluent UI Components in Power Apps

Fluent UI Components in Microsoft Power Apps

Fluent UI Components

Fluent UI provides a set of reusable components and design patterns for building modern, responsive, and accessible user interfaces. These custom components can be used within PowerApps to create custom forms, interfaces, and data visualization.

Using Fluent UI components ensures consistency in design, reduces development time, and improves the overall user experience.

Prerequisites

Create PowerApps Solution

pac pcf init -n "name" -ns "namespace" -t [dataser field]
  • "name" (-n) is a project name.
  • "namespace" (-ns) is the namespace for the project.
  • "type" (-t) can either be a dataset or a field.

Create Power Apps solution

Install Core React, React-Dom, and Fluent UI Packages

npm install react react-dom @fluentui/react

Install Core React, React-Dom, and Fluent UI Packages

Install type definitions for the above packages as dev dependencies

npm install -–save-dev @types/react @types/react-dom

Install all dependencies

Structure for Components

I usually create a separate folder and add components to it.

  • Created a new folder - Components.
  • Created TSX files for components and added source code to them.
    File structure

Please look at the developer Fluent UI site for Fluent UI components, its use, and guidelines (I have tried a few of them).

Render the Fluent UI Components


Import required dependencies

  • On top of the file, import React and React-dom.
  • Import form component

UI Components

Render the components

  • In the updateView function, use ReactDOM and React.createElement to create and render Fluent UI components.
  • Save the changes, and it's done.

Render the Components

Save the changes made in the index.ts file and run the command.

npm start watch

Output

Output


Similar Articles