| title | Component Patterns | |||||
|---|---|---|---|---|---|---|
| description | Reusable canvas components and PCF code components for Power Apps | |||||
| category | ui-patterns | |||||
| subcategory | components | |||||
| tags |
|
|||||
| difficulty | intermediate | |||||
| products |
|
|||||
| author | PowerAppsDarren | |||||
| created | 2026-01-27 | |||||
| updated | 2026-01-27 |
- Overview
- Directory Structure
- Component Types
- Creating Canvas Components
- Best Practices
- Folder Contents
- [custom-components/](#custom-componentscustom-components)
- [code-components/](#code-componentscode-components)
- Related Resources
Reusable component patterns for Power Apps development.
This folder contains patterns for creating and using reusable components in Power Apps. Components allow you to build once and reuse across multiple screens and apps, improving consistency and reducing maintenance.
components/
├── custom-components/ # Canvas app components (Power Fx)
└── code-components/ # PCF components (TypeScript/React)
Built entirely with Power Fx within Power Apps Studio. Best for:
- UI patterns that need to be reused across screens
- Input controls with custom validation
- Display components with specific layouts
- Components that non-developers should be able to modify
Built with TypeScript and optionally React. Best for:
- Complex visualizations
- Integration with external libraries
- Performance-critical components
- Features not possible with standard controls
- Properties - Define input/output properties
- UI Layout - Design the component interface
- Behavior - Implement component logic
| Type | Use Case |
|---|---|
| Input | Pass data into the component |
| Output | Return data from the component |
| Event | Trigger actions in the parent |
| Data | Pass tables/records |
// Component Properties:
// - Text (Input, Text)
// - IsLoading (Input, Boolean)
// - OnSelect (Event)
// - Disabled (Input, Boolean)
// Button OnSelect:
If(
!IsLoading && !Disabled,
Select(Parent) // Triggers the component's OnSelect
)
// Button Text:
If(IsLoading, "Loading...", Text)
// Button DisplayMode:
If(IsLoading || Disabled, DisplayMode.Disabled, DisplayMode.Edit)
- Keep components focused on a single purpose
- Use clear, descriptive property names
- Provide sensible default values
- Document all properties and their expected values
- Minimize the number of controls inside components
- Avoid complex calculations in frequently-updated properties
- Use
With()for repeated calculations
- Design for flexibility with input properties
- Don't hardcode data sources or colors
- Make styling customizable through properties
Canvas app component implementations including:
- Input controls with validation
- Navigation components
- Display patterns
- Form components
PCF component patterns and implementations (advanced).
| Date | Author | Changes |
|---|---|---|
| 2026-01-27 | Claude | Created initial README |