Power Apps Component Framework (PCF) control development
How to build custom controls with the Power Apps Component Framework — the dev environment, lifecycle, manifest, packaging, and the common pitfalls for production PCFs.
When Power Apps's standard controls don't suffice — you need a specialised data visualisation, a custom interaction, a third-party widget integrated — the Power Apps Component Framework (PCF) lets developers build custom controls in TypeScript that integrate natively with model-driven and canvas apps. The capability is powerful; the development discipline is meaningful.
What PCF enables.
- Custom UI controls for fields, datasets, and sub-grids.
- Full TypeScript / JavaScript / HTML / CSS implementation.
- Native integration with Dataverse data binding.
- Reusable across apps and environments.
- Solution-aware deployment.
Development environment.
- Node.js + npm for tooling.
- Power Platform CLI (pac) for project scaffolding.
- Visual Studio Code as editor.
- TypeScript / React common stack.
Setup is non-trivial; budget a few hours for first-time setup.
Project structure.
ControlProject/
ControlManifest.Input.xml - control definition
index.ts - main entry
index.css - styling
components/ - sub-components
package.json
tsconfig.json
ControlManifest. The contract:
- Properties — fields the control consumes.
- DataSet — for dataset controls binding to views.
- Resources — referenced files.
- Required features — platform features needed.
Manifest defines what host app sees when configuring the control.
Control lifecycle.
init(context, notifyOutputChanged, state, container)— called once on initialisation.updateView(context)— called on context change (data update).getOutputs()— returns values to push back to the host.destroy()— cleanup.
These four methods are the contract; understanding their flow is essential.
The context object. Provides:
- Current property values.
- Data set (for dataset controls).
- Device info — screen size, orientation.
- User info.
- Mode — read-only, disabled.
- Resources — fetched files.
The control reads context and renders accordingly.
Two-way binding. For fields:
- Field value flows in via context.
- User interaction in control updates state.
- Call
notifyOutputChanged()to push updates. - Power Apps re-renders to reflect.
Building.
npm install
npm run build
Produces a built control ready for packaging.
Packaging as solution.
pac solution init --publisher-name MyPub --publisher-prefix my
pac solution add-reference --path /path/to/control
msbuild /p:Configuration=Release
The MSBuild output is a solution ZIP containing the control.
Deploying.
- Import solution to environment.
- Add control to model-driven form, view, or canvas app.
- Bind to appropriate field or dataset.
- Test.
React-based PCFs. Most modern PCFs use React:
- React rendered inside the PCF container.
- Hooks for state.
- React libraries (Fluent UI, Material UI) integrate.
Common PCF patterns.
- Custom field renderers — image picker, date range, address autocomplete.
- Dataset visualisations — grids with custom rendering, kanban boards, calendars.
- Composite forms — multi-field input as one control.
- External library integration — Chart.js, Mapbox, video players.
Theming.
- PCF can access host theme via context.
- Apply theme to match host app's branding.
- Important for visual consistency.
Accessibility.
- ARIA attributes mandatory.
- Keyboard navigation must work.
- Focus management.
- High contrast support.
Microsoft accessibility requirements apply; ship-blocking if missing.
Performance considerations.
- Initial load — keep bundle small; lazy load if possible.
- Re-renders — only update what changed.
- External resource loading — async; show loading state.
PCFs that block the form's render slow the whole experience.
Testing.
- Unit tests for logic.
- Manual testing in app.
- Test framework integration evolving.
Versioning.
- Manifest specifies version.
- Solution updates carry new version.
- Apps can lock to specific version or auto-update.
Common pitfalls.
- Bundle size huge. Include only what's needed; tree-shake.
- No accessibility. Fails accessibility audit.
- External library security. Vulnerable libraries shipped; security incident.
- Theme not respected. Looks out of place in host app.
- Two-way binding broken. Updates not propagating.
- No error handling. Errors propagate; form crashes.
- Hardcoded URLs / strings. Should be configuration.
ALM considerations.
- PCFs ship in solutions; same ALM as other components.
- Source control the PCF project.
- CI builds on commit.
- Deploy through standard pipeline.
Strategic positioning. PCFs are the answer for custom UI needs beyond standard controls. The developer commitment is real — TypeScript, React patterns, manifest discipline, accessibility, performance. For partners maintaining PCFs across customer deployments, treating them as products (versioned, tested, documented) is essential. For one-off needs, sometimes a Canvas Power Apps component is simpler. Use PCFs when the requirements clearly demand them and the team can invest in production-grade development.
Related guides
- PCF controls in Power AppsWhat Power Apps Component Framework (PCF) controls are, when to use them, and the developer toolchain to build, package, and deploy.
- Power Apps modern controlsHow the modern control set in canvas apps differs from classic controls — Fluent UI styling, accessibility defaults, theming, and migration considerations.
- Power Apps monitoring and Application InsightsHow to monitor Power Apps in production — App Monitor, Application Insights integration, and the operational patterns for performance and error tracking.
- Power Apps performance tuningHow to make Power Apps canvas and model-driven apps fast — startup time, screen render, data fetching, formula optimisation, and the patterns that matter.
- Power Apps Portals history and rebranding to Power PagesFrom ADXStudio to Dynamics 365 Portals to Power Apps Portals to Power Pages — the product genealogy and what the rebranding means for customers.