# getPreset()

> Predefined caption appearance presets and their strong typings.

Predefined caption appearance presets and their strong typings.

## Call Signature

```ts
function getPreset(name): StylePreset;
```

Looks up a built-in preset by name.

### Parameters

| Parameter | Type |
| ------ | ------ |
| `name` | [`StylePresetName`](/docs/api/type-aliases/StylePresetName) |

### Returns

[`StylePreset`](/docs/api/interfaces/StylePreset)

### Remarks

Matching is case-insensitive and treats spaces, `-` and `_` the same, so
`"focus-box"` resolves to `"Focus Box"` (handy for CLI flags).

### Example

```ts
const preset = getPreset("Karaoke");
```

### Throws

Error listing the available names when nothing matches.

## Call Signature

```ts
function getPreset(name): StylePreset;
```

Looks up a built-in preset by name.

### Parameters

| Parameter | Type |
| ------ | ------ |
| `name` | `string` |

### Returns

[`StylePreset`](/docs/api/interfaces/StylePreset)

### Remarks

Matching is case-insensitive and treats spaces, `-` and `_` the same, so
`"focus-box"` resolves to `"Focus Box"` (handy for CLI flags).

### Example

```ts
const preset = getPreset("Karaoke");
```

### Throws

Error listing the available names when nothing matches.

Source: https://captionsjs.dev/docs/api/functions/getPreset
