lightning/stateManagerLayout

This state manager gets layout information, metadata, and data you can use to build a user interface for one or more records.

Syntax 

Record layout details depend on the object, record type, and layout type.

1import { LightningElement } from 'lwc';
2import smLayout from "lightning/stateManagerLayout";
3
4export default class Example extends LightningElement {
5
6  const myLayout = smLayout({
7    objectApiName: string,
8    layoutType: string,
9    mode: string,
10    recordTypeId?: string });
11}

Configuration Functions 

setConfig()

Provide the entire configuration as an object. This function is equivalent to the factory function when you create the state manager.

setObjectApiName()

Set the object API (developer) name.

setLayoutType()

Set the layout type: "Compact" or "Full".

setMode()

Set the layout mode: "Create", "Edit", or "View".

setRecordTypeId()

Set the record type for the object, in the form of a record type ID. When omitted, the default record type is used.

State Manager Properties 

status

The current status of the state manager. See status for details.

data

When status is "loaded", a RecordLayout.

error

When status is "error", this property contains details. See error for details.

See Also

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.