---
schema_version: "1"
id: b201b0bb84e8f0ab0df24b2beafbf17aef09a6b0a7d0643637ab0319ae168900
title: Custom Lightning Types Overview
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/lt_overview.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.lt_overview.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 312c639143de84be73d331b90fef6a4b35ac90b9b6d0e8da2e9fa34efc81023c
description: Learn about custom Lightning types, the benefits they provide, and how field mapping works.
products:
  - Salesforce Platform
release: "264"
---
# Custom Lightning Types Overview

Learn about custom Lightning types, the benefits they provide, and how field mapping works.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions.</td></tr></tbody></table>

## When to Use Custom Lightning Types

When a standard interface doesn’t meet your business needs, you can override the default UI by using your custom Lightning Web Component (LWC) to create a customized experience. Custom Lightning types are particularly effective for handling complex data structures and UI requirements.

## Key Parts of a Lightning Type

Each Lightning type consists of three main parts.

- **Schema**: defines the structure of your data and its validation rules, such as type, format, and maximum length
- **Editor**: controls the UI for entering or editing information
- **Renderer**: controls the UI for displaying information as output

![Lightning Type structure comprising a Schema, one or more Editors, and one or more Renderers](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/260_setup_ui.png)

## Categories of Custom Lightning Types

Custom Lightning types fall into two categories based on how you define their schema.

- **Apex-based custom Lightning types**. Use these types when you define the schema by referencing an Apex class. This method is for when you have a complex data structure already defined in an Apex class code. These types can be used for Agentforce Employee agents in Lightning Experience, Agentforce Service agents through Enhanced Chat v2, Agentforce Employee agents on Mobile, and Agentforce Service agents via Enhanced Chat v2 on Mobile.
- **Object-based custom Lightning types**. Use these types when you define a custom schema by specifying its fields directly. This method is for defining a custom JSON object structure without referencing an Apex class. These types can be used in Experience Builder and Prompt Builder.

## Benefits of Custom Lightning Types

Custom Lightning types provide two main benefits.

- **Enhanced UI Customization**: Gain full control over the UI by associating a custom Lightning Web Component (LWC) that matches your specific styling and behavior requirements.
- **Better Handling of Complex Data**: Manage and display complex data structures, such as deeply nested objects, complex arrays, and dynamic fields, that standard types aren’t designed to support.

## LWC Field Mapping

Configure field mappings to define how data moves from the schema fields to the corresponding LWC component fields. Field mapping can be automatic or manual, based on whether the names in the LWC component and the schema are the same.

Automatic Mapping

If a field in your LWC component has the exact same name as a field in the schema, the fields are automatically linked. No manual mapping is required for these fields.

Manual Mapping

If an LWC component field name is different from the corresponding schema field name, you must map them manually. Manual mapping ensures that data is passed to the correct LWC component field, even when the field names don’t match.

#### See Also

- [_Lightning Types Developer Guide_: Lightning Web Component Attribute Mapping](https://developer.salesforce.com/docs/platform/lightning-types/guide/lightning-types-ui-config.html)
- [_Lightning Types Developer Guide_: Core Concepts of Custom Lightning Types](https://developer.salesforce.com/docs/platform/lightning-types/guide/lightning-types-core.html)