# GM - Record Layout (LWC)

## **Documentation**

**GM - Record Layout (LWC)** component is used to display a related object using a layout configuration same as [GM - Record Layout](/package-reference/components-library/gm-record-layout.md#documentation). It bypasses the limitation of Salesforce UI API. This component can be used to manipulate any Salesforce object especially **Event** and **Task**.

**Use case:** Display the event details when expanding a record from open activities related list.

## **Specification**

**GM - Record Layout (LWC)** component has the same properties as [**GM - Record Layout**](/package-reference/components-library/gm-record-layout.md#specification)**.** However, it provides more capabilities in terms of styling. Section header can be hidden and each field can be styled by setting the variant, the border, the label styling and the value styling. The styling capabilities are useful on a community website for instance. Below is a configuration to showcase the styling:

```coffeescript
{
    "density": "comfy",
    "sections": [
        {
            "name": "contactInformation",
            "label": "Contact Information",
            "variant": "header-hidden",
            "active": "always",
            "cols": 1,
            "rows": [
                [
                    {
                        "apiName": "Name",
                        "variant": "label-hidden",
                        "style": {
                            "label": "font-size:large;color:red",
                            "value": "font-size:large;text-align:center;color:green",
                            "border": "none"
                        }
                    }
                ],
                [
                    {
                        "apiName": "gmpkg__Image_Test__c",
                        "variant": "label-hidden",
                        "style": {
                            "value": "text-align:center",
                            "border": "none"
                        }
                    }
                ]
            ]
        }
    ]
}
```

## **API Reference**

{% tabs fullWidth="true" %}
{% tab title="RecordLayoutLWCComponent.design" %}

```xml
<design:component label="GM - Record Layout (LWC)">    
    <design:attribute name="recordId" label="recordId" 
                      description="recordId to use. Use it only for community"/>        
    <design:attribute name="targetObjName" label="Object Name" 
                      description="Object Name to load"/>    
    <design:attribute name="recordIdField" label="Record Id Field" 
                      description="Record Id Field to load" />
    <design:attribute name="recordLayout" label="Record Layout" 
                      description="JSON Record Layout"/>    
    <design:attribute name="showBorder" label="Show Border" 
                      description="Show record card border"/>    
</design:component>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gridmate.io/package-reference/components-library/gm-record-layout-lwc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
