---
title: "init(family:)"
framework: widgetkit
role: symbol
role_heading: Initializer
path: "widgetkit/widgetpreviewcontext/init(family:)"
---

# init(family:)

Creates a context for previewing a widget or a widget’s view.

## Declaration

```swift
init(family: WidgetFamily)
```

## Parameters

- `family`: The template the widget preview uses: small, medium, or large.
