3.2 Building Reusable Canvas Component Libraries
Key Takeaways
- Canvas components package reusable UI into a single control; component libraries publish them for reuse across multiple apps, not just one.
- Input, output, and event custom properties define a component's public surface, mirroring parameters and return values in code.
- Consuming apps must explicitly accept and republish after a library update — changes never silently propagate.
- Component libraries are created via File > New > Component library and published separately from any consuming app.
- Renaming or removing a custom property is a breaking change for every app that already references the component.
Canvas Components as Reusable Building Blocks
A canvas component groups a set of controls into a single reusable unit with its own properties, formulas, and behaviors — a way to avoid rebuilding the same header bar, star-rating control, or validated input field on every screen. Components are created inside the Components pane of Power Apps Studio, and once defined, behave like any other control: they can be dragged onto a screen, resized, and have their custom properties set from the formula bar just like Fill or Text.
Component Libraries vs. In-App Components
A component created inside a single app only exists in that app (though it can be exported and imported manually). A component library solves the cross-app reuse problem: it is published as its own standalone artifact, distinct from any individual canvas app, and once published, any canvas app in the environment can add a reference to it and consume its components — the same way a code library is referenced by multiple applications.
- Component libraries live and are managed independently in the maker portal, separate from the apps that use them.
- A single library can hold many components (for example, a design-system library with a branded button, a card, and a modal).
- Multiple apps referencing the same library get update notifications — makers see an "Updates available" banner in Studio when the library owner republishes, and each consuming app chooses when to pull in the new version, so a library change doesn't silently ripple into production apps without maker action.
Custom Properties: Input, Output, and Event
A component's public surface is defined through custom properties, and PL-400 expects fluency in the three kinds:
| Property type | Direction | Example use |
|---|---|---|
| Input | Passed into the component from the consuming screen | BorderColor, LabelText — configure appearance/content per instance |
| Output | Read from the component by the consuming screen | SelectedValue from a custom picker, exposed like a control's built-in property |
| Event (behavior output) | Fires a formula in the consumer when something happens inside the component | An OnSelect-style behavior triggered from an internal control's OnSelect |
Input properties can be data-typed (Text, Number, Boolean, Color, Table, Record), can be marked required, and can carry a default value shown in Studio for anyone consuming the component. Output properties let a component return computed results or user selections back to the parent app — for example, a custom date-range picker component exposing StartDate and EndDate as outputs so the consuming screen's gallery can filter on them without knowing the picker's internal control names.
Publishing and Consuming a Library
The workflow a PL-400 candidate should know cold:
- Build components inside a dedicated app (often called a "component library app," created via File > New > Component library rather than a standard canvas app).
- Publish the library from that app — this makes it available to add as a reference in other apps.
- In a consuming app, add the library as a reference (Insert or Data pane); its components then appear alongside built-in controls.
- When the library owner updates a component and republishes, consuming apps display an update banner; a maker must explicitly accept the update, review the changelog, and republish the consuming app for the change to take effect for end users.
This decoupling is deliberate: it lets a platform team own a shared design system while individual app teams control their own release cadence.
Design Considerations for Reusable Components
Several patterns distinguish a well-built component library from a fragile one, on both the exam and in practice:
- Scope custom properties tightly. Expose only what a consumer genuinely needs to configure; over-exposing internal state defeats encapsulation and creates brittle dependencies.
- Avoid hard-coded data source references inside components where possible — pass data in via a Table-typed input property so the component stays reusable across apps with different underlying data sources.
- Theme consistently. Use input properties for color and theme tokens rather than embedding a fixed palette, so the same component can be restyled per consuming app's branding.
- Test components in isolation before publishing, since a bug in a widely-referenced library component propagates to every app that later accepts the update.
- Version deliberately. Because updates require explicit acceptance downstream, treat a library republish like a package release — document breaking changes to custom property names or types, since renaming a property is not backward compatible for existing consumers.
Component libraries are the PL-400 blueprint's explicit answer to "build reusable component libraries" (3b), and pair directly with the PCF code-component material later in the guide — canvas components solve reuse within the low-code surface, while PCF solves it for custom rendering and device or API access beyond what canvas controls provide.
A maker publishes a change to a component inside a shared component library. What happens to canvas apps that already reference that library?
Which custom property type should a developer use so a custom date-range picker component can hand its selected start and end dates back to the screen that placed it?