[**@wocart/theme v4.1.0**](../../README)

***

[@wocart/theme](../../README) / [index](../README) / instantiatePreset

# Function: instantiatePreset()

> **instantiatePreset**(`theme`, `type`, `presetKey`, `newId`): [`ComponentInstance`](../interfaces/ComponentInstance)

The instances a preset describes: the component with the preset's props
over its field defaults (`createInstance`), and every child component the
same way, each with an id from `newId`. Throws on what is a programming
error — an unknown component or preset, or props its fields refuse — as
`createInstance` does; `validateThemeDefinition` reports these at assembly.

## Parameters

### theme

[`ThemeDefinition`](../interfaces/ThemeDefinition)

### type

`string`

### presetKey

`string`

### newId

() => `string`

## Returns

[`ComponentInstance`](../interfaces/ComponentInstance)
