Power Apps Component Framework
The Power Apps Component Framework (PCF) is another means of creating and publishing components that developers can import and use in their apps. This type of code-based component can transform displays like the one shown in Figure 4-12 into various types of graphics and charts, as shown in Figure 4-13, and add controls such as sliders and dials to provide users with control over numeric values. Code components can also display information retrieved from services outside the app.

FIGURE 4-12 Display without Power Apps Component Framework

FIGURE 4-13 Display with Power Apps Component Framework
Need More Review? PCF Coding
Unlike most of the Power Platform tools and technologies, PCF does require the use of code, and Microsoft has released a Power Apps CLI (command-line interface) tool that allows developers to create and work on PCF code components https://aka.ms/PowerAppsCLI.
As with component libraries, PCF provides resources for developers that can create a unified appearance and experience across all of an organization’s apps. There is also a growing community of component developers that make their work available online on an open source basis.
To deploy PCF code components, developers package them into a solution file and import the file into the Common Data Service. From there, individual app developers can add them to canvas or model-driven apps.
PCF code components must include the following three elements:
■ Manifest—A metadata file in XML format that specifies the name of the component, how it can be used, what properties can be configured, and what resource files it needs
■ Component implementation—TypeScript or JavaScript code that defines the functionality of the component and its user interface
■ Resources—A file containing the code needed to implement the component’s visualization, which can include JavaScript libraries, Cascading Style Sheets (CSS) code, images, and HTML
After the coding is completed, the developer must package the code components into a solution file using the CLI pac command, generate a zip file of the solution using the msbuild command, and then manually import the zip file into the Common Data Service.
To use PCF code components in apps, an administrator must first allow the feature for the environment in which the components are needed, using the Power Platform admin center, as shown in Figure 4-14.

FIGURE 4-14 The Environments page in the Power Platform admin center