# @ovok/native/breathing-exercise

Canonical page: https://docs.ovok.com/native-sdk/reference/breathing-exercise

Guided breathing exercise component, provider and hook.

Import from `@ovok/native/breathing-exercise`.

## Components [#components]

### BreathingExercise() [#breathingexercise]

```ts
function BreathingExercise(__namedParameters): Element;
```

Guided breathing exercise; compose it with the `BreathingExercise.*` sub-components.

#### Parameters [#parameters]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | `PropsWithChildren`\<`BreathingExerciseProps`\> |

#### Returns [#returns]

`Element`

***

### BreathingExerciseProvider() [#breathingexerciseprovider]

```ts
function BreathingExerciseProvider(__namedParameters): Element;
```

Runs the breathing exercise animation for `repeat` rounds, calls `onFinish` at the end and provides its state to descendants.

#### Parameters [#parameters-1]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | `PropsWithChildren`\<`BreathingExercise`\> |

#### Returns [#returns-1]

`Element`

## Hooks [#hooks]

### useBreathingExercise() [#usebreathingexercise]

```ts
function useBreathingExercise(): BreathingExercise & object;
```

Returns the breathing exercise state; must be used within a `BreathingExercise`.

#### Returns [#returns-2]

`BreathingExercise` & `object`

## Type Aliases [#type-aliases]

### BreathingExerciseContextType [#breathingexercisecontexttype]

```ts
type BreathingExerciseContextType = BreathingExercise & object;
```

Breathing exercise definition plus the live animation state exposed by the exercise context.

#### Type Declaration [#type-declaration]

| Name | Type | Description |
| ------ | ------ | ------ |
| `methodType` | `BreathingExercise`\[`"methods"`\]\[`number`\]\[`"type"`\] | Type of the breathing method currently active. |
| `progress` | `SharedValue`\<`number`\> | Animated overall progress through the exercise. |
| `remainingTime` | `number` | Time remaining in the whole exercise. |
| `roundData` | `SharedValue`\<\{ `animationProgress`: `number`; `method`: `BreathingExercise`\[`"methods"`\]\[`number`\]; `remainingTime`: `number`; \}\> | Animated state of the current breathing round. |

## Variables [#variables]

### BreathingExerciseContext [#breathingexercisecontext]

```ts
const BreathingExerciseContext: Context<BreathingExerciseContextType | null>;
```

Context holding the breathing exercise state.
