  The NA62 experiment at CERN reports searches for $K^+\to\mu^+N$ and
$K^+\to\mu^+\nu X$ decays, where $N$ and $X$ are massive invisible particles,
using the 2016-2018 data set. The $N$ particle is assumed to be a heavy neutral
lepton, and the results are expressed as upper limits of ${\cal O}(10^{-8})$ of
the neutrino mixing parameter $|U_{\mu4}|^2$ for $N$ masses in the range
200-384 MeV/$c^2$ and lifetime exceeding 50 ns. The $X$ particle is considered
a scalar or vector hidden sector mediator decaying to an invisible final state,
and upper limits of the decay branching fraction for $X$ masses in the range
10-370 MeV/$c^2$ are reported for the first time, ranging from ${\cal
O}(10^{-5})$ to ${\cal O}(10^{-7})$. An improved upper limit of $1.0\times
10^{-6}$ is established at 90% CL on the $K^+\to\mu^+\nu\nu\bar\nu$ branching
fraction.
