oc · docs
docs / documentation

@orangecheck/design


@orangecheck/design / useOcMotion

Function: useOcMotion()

function useOcMotion(): {
  motion: OcMotion;
  setMotion: (value: OcMotion) => void;
};

Defined in: tokens/provider.tsx:278

Read the ambient-motion switch + setter. The WCAG 2.2.2 pause mechanism: 'off' sets data-oc-motion="off" on <html> (persisted family-wide in the oc_motion cookie), which pauses the aurora and any .oc-ambient element. Throws if used outside OcThemeProvider.

Returns

{
  motion: OcMotion;
  setMotion: (value: OcMotion) => void;
}
NameTypeDefined in
motionOcMotiontokens/provider.tsx:278
setMotion()(value: OcMotion) => voidtokens/provider.tsx:278