Study FAQ
How do I define the manifest for a reusable PCF component?
Also asked as 2
- What should a field or dataset PCF manifest declare before I write the component?
- How do I choose PCF manifest properties and generate their TypeScript types?
Answer
Start with the intended app host and data shape. Choose a field component for an individual value or a dataset component for a configured collection with loading, selection and paging. Declare the component's inputs, outputs, resources and required capabilities in ControlManifest.Input.xml.
For a model-driven quantity field, a Whole.None property named requestedUnits can be bound, so the host supplies a value and receives edits under that name. A SingleLine.Text caption property can use input for maker configuration. Even with required binding configuration, handle a missing runtime value. Preserve declared code, CSS and localization paths.
With Node.js LTS and Microsoft Power Platform CLI, create a new component project in an empty directory:
pac pcf init --namespace Contoso.Controls --name QuantityEditor --template field --run-npm-install
npm run refreshTypes
npm run build
Run the last two commands after editing the scaffold's manifest. Verify the generated IInputs and IOutputs use the expected names and types, then configure the component on a compatible test column. Treat a renamed property or newly required capability as a change to existing consumer bindings.
Full explanation
AB-400: Building Reusable PCF Code Components
Study guide · AB-400
Read the full explanation