# LayoutChildComponentElement

Class · extends [`ComponentElement`](https://api.playcanvas.com/web-components/classes/ComponentElement.md)`<LayoutChildComponent>` · category: Components

Source: https://github.com/playcanvas/web-components/blob/252f001881302c266c8d727044408c32be2bb5e7/src/components/layout-child-component.ts#L21

The LayoutChildComponentElement interface provides properties and methods for manipulating
[`<pc-layout-child>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-layout-child/) elements.
The LayoutChildComponentElement interface also inherits the properties and methods of the
[HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) interface.

Engine component: [LayoutChildComponent](https://api.playcanvas.com/engine/classes/LayoutChildComponent.html) (`layoutchild`).

**elementSummary** The `<pc-layout-child>` element controls how its entity is sized by the
`<pc-layout-group>` above it, through minimum and maximum sizes and fit proportions. Must be a
child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.

## Accessors

### component

```ts
get component(): LayoutChildComponent | null
```

Gets the underlying PlayCanvas layout child component. `null` until the element is
ready — see [ComponentElement.component](https://api.playcanvas.com/web-components/classes/ComponentElement.md#component).

### excludeFromLayout

```ts
get excludeFromLayout(): boolean
set excludeFromLayout(value: boolean)
```

Gets whether the element is excluded from the layout.

### fitHeightProportion

```ts
get fitHeightProportion(): number
set fitHeightProportion(value: number)
```

Gets the proportion of the container's spare height this element should take.

### fitWidthProportion

```ts
get fitWidthProportion(): number
set fitWidthProportion(value: number)
```

Gets the proportion of the container's spare width this element should take.

### maxHeight

```ts
get maxHeight(): number | null
set maxHeight(value: number | null)
```

Gets the maximum height the element should be laid out with.

### maxWidth

```ts
get maxWidth(): number | null
set maxWidth(value: number | null)
```

Gets the maximum width the element should be laid out with.

### minHeight

```ts
get minHeight(): number
set minHeight(value: number)
```

Gets the minimum height the element should be laid out with.

### minWidth

```ts
get minWidth(): number
set minWidth(value: number)
```

Gets the minimum width the element should be laid out with.

## Methods

### getInitialComponentData

```ts
protected getInitialComponentData(): { excludeFromLayout: boolean; fitHeightProportion: number; fitWidthProportion: number; maxHeight: number | null; maxWidth: number | null; minHeight: number; minWidth: number }
```

Returns the data the component is created with. Overridden by subclasses to supply the
initial values of their cached properties. The element's `enabled` state is not among them:
the base class adds it when it creates the component.

**Returns** `{ excludeFromLayout: boolean; fitHeightProportion: number; fitWidthProportion: number; maxHeight: number | null; maxWidth: number | null; minHeight: number; minWidth: number }`: The initial component data.

## Inherited from [ComponentElement](https://api.playcanvas.com/web-components/classes/ComponentElement.md)

- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `protected _onReady(): void`
- `protected _resetReady(): void`
- `protected initComponent(): void`
- `ready(): Promise<LayoutChildComponentElement>`
