@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

ParameterType
__namedParametersPropsWithChildren<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

ParameterType
__namedParametersPropsWithChildren<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

NameTypeDescription
methodTypeBreathingExercise["methods"][number]["type"]Type of the breathing method currently active.
progressSharedValue<number>Animated overall progress through the exercise.
remainingTimenumberTime remaining in the whole exercise.
roundDataSharedValue<{ 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

On this page