@ovok/native/breathing-exercise
Guided breathing exercise component, provider and hook.
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
Guided breathing exercise component, provider and hook.
Import from @ovok/native/breathing-exercise.
Components
BreathingExercise()
function BreathingExercise(__namedParameters): Element;Guided breathing exercise; compose it with the BreathingExercise.* sub-components.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | PropsWithChildren<BreathingExerciseProps> |
Returns
Element
BreathingExerciseProvider()
function BreathingExerciseProvider(__namedParameters): Element;Runs the breathing exercise animation for repeat rounds, calls onFinish at the end and provides its state to descendants.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | PropsWithChildren<BreathingExercise> |
Returns
Element
Hooks
useBreathingExercise()
function useBreathingExercise(): BreathingExercise & object;Returns the breathing exercise state; must be used within a BreathingExercise.
Returns
BreathingExercise & object
Type Aliases
BreathingExerciseContextType
type BreathingExerciseContextType = BreathingExercise & object;Breathing exercise definition plus the live animation state exposed by the exercise context.
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
BreathingExerciseContext
const BreathingExerciseContext: Context<BreathingExerciseContextType | null>;Context holding the breathing exercise state.
Last updated on