Creating a custom Lightning Type means authoring a LightningTypeBundle and deploying it as metadata. You build the JSON files locally, map any custom editor or renderer Lightning Web Components, then deploy through Salesforce CLI or Metadata API. These are the core pieces every bundle needs.
- Create the bundle folder
Under your project's force-app metadata, add a lightningTypes folder, then a subfolder named after your type. This subfolder is the bundle for that one Lightning Type.
- Author schema.json
Write a schema.json that describes the data shape and its validation rules using JSON Schema. This file is required. Reference custom labels with {!$Label.c.LabelName} so titles and messages stay translatable.
- Add channel folders with editor and renderer
Inside the type folder, add channel folders such as experienceBuilder or lightningDesktopGenAi. Place an editor.json to map your input LWC and, where supported, a renderer.json to map your output LWC.
- Deploy and wire it up
Deploy the bundle with Salesforce CLI or Metadata API. Then reference the type from the consuming surface, such as the js-meta.xml of a component or the display setting of an Agentforce action.
The top-level container folder that holds every custom Lightning Type bundle in your project.
A folder named after the type. Its name is how components and actions reference the type.
Required. Defines the data structure and validation rules in JSON Schema. A bundle is not valid without it.
Optional. Maps a custom Lightning Web Component as the input editor for a given channel folder.
Optional. Maps a custom Lightning Web Component as the output renderer. Not supported in the Experience Builder channel.
- Renderer overrides do not work in the Experience Builder channel, so plan for custom input but default output there.
- LightningTypeBundle needs API version 64.0 or later. Confirm your org and project source API version support it.
- Check the Lightning Types Reference for a standard type before building a custom one. You may not need a bundle at all.
- Channel folder names are specific (for example lightningDesktopGenAi, enhancedWebChat). A typo means the override is silently ignored.