---
title: ControlValueProvider
framework: widgetkit
role: symbol
role_heading: Protocol
path: widgetkit/controlvalueprovider
---

# ControlValueProvider

A type that provides a value to a control template.

## Declaration

```swift
protocol ControlValueProvider
```

## Overview

Overview The provider quickly and cheaply prepares a synchronous value to be shown while previewing the control in the add sheet. When the actual control needs to be rendered, the actual, current value will be fetched asynchronously. For instance, a control that opens and closes a garage door may show a preview of the door being closed. When the actual control is rendered, the control may fetch the door’s status from the cloud: struct GarageDoorValueProvider: ControlValueProvider {     var previewValue: Bool { false }

func currentValue() async -> Bool {         await GarageDoorManager.shared.doorStatus()     } }

## Topics

### Associated Types

- [Value](widgetkit/controlvalueprovider/value.md)

### Instance Properties

- [previewValue](widgetkit/controlvalueprovider/previewvalue.md)

### Instance Methods

- [currentValue()](widgetkit/controlvalueprovider/currentvalue().md)

## See Also

### Previews

- [AppIntentControlValueProvider](widgetkit/appintentcontrolvalueprovider.md)
