Overview
To make a component available in Lightning App Builder, you need to:- Mark the component as exposed in the metadata file
- Specify target contexts (App Page, Home Page, Record Page, etc.)
- Define configurable properties using
@api - Configure property types and options in the metadata
Basic Configuration
Component with @api Properties
compositionWithAppBuilder.jsMetadata Configuration
compositionWithAppBuilder.js-meta.xmlMetadata Elements
Required Elements
1
Set isExposed to true
This makes the component visible in App Builder’s component palette
2
Define targets
Specify where the component can be used
3
Configure properties
Define which properties are configurable and their input types
Available Targets
Property Types
App Builder supports various property types for configuration:String
Simple text input:String with Picklist
Dropdown selection usingdatasource:
Integer
Numeric input with optional min/max constraints:Boolean
Checkbox input:Additional Types
Property Attributes
Common Attributes
Type-Specific Attributes
String with datasource:Using Component Properties
Once configured in App Builder, the property values are automatically passed to your component:Best Practices
1
Provide sensible defaults
Always set default values so the component works out-of-the-box
2
Use clear labels and descriptions
Help administrators understand what each property does
3
Validate property values
Don’t assume properties will always be valid
4
Group related properties
Use consistent naming and organize properties logically
Testing in App Builder
1
Deploy your component
Push the component and metadata to your org
2
Open Lightning App Builder
Navigate to Setup > Lightning App Builder
3
Create or edit a page
Choose the appropriate page type matching your target configuration
4
Find your component
Look for your component in the Custom components section
5
Drag and configure
Drag the component onto the page and test the property inputs
6
Save and activate
Save your page and activate it for users
Advanced: Object and Record Context
For Record Pages, you can access the current record’s context:When using
lightning__RecordPage, the recordId and objectApiName properties are automatically provided by the framework.Next Steps
Composition Overview
Review component composition fundamentals
Wire Service
Learn how to fetch and display Salesforce data
