  Context. The study of star formation is extremely challenging due to the lack
of complete and clean samples of young, nearby clusters, and star forming
regions. The recent Gaia DR2 catalogue complemented with the deep, ground based
COSMIC DANCe catalogue offers a new database of unprecedented accuracy to
revisit the membership of clusters and star forming regions. The 30 Myr open
cluster IC 4665 is one of the few well-known clusters of this age and it is an
excellent target where to test evolutionary models and study planetary
formation.
  Aims. We aim to provide a comprehensive membership analysis of IC 4665 and to
study the following properties: empirical isochrones, distance, magnitude
distribution, present-day system mass function, and spatial distribution.
  Methods. We use the Gaia DR2 catalogue together with the DANCe catalogue to
look for members using a probabilistic model of the distribution of the
observable quantities in both the cluster and background populations.
  Results. We obtain a final list of 819 candidate members which cover a 12.4
magnitude range (7 < J < 19.4). We find that 50% are new candidates, and we
estimate a conservative contamination rate of 20%. This unique sample of
members allows us to obtain a present-day system mass function in the range of
0.02-6 Msun, which reveals a number of details not seen in previous studies. In
addition, they favour a spherically symmetric spatial distribution for this
young open cluster.
  Conclusions. Our membership analysis represents a significant increase in the
quantity and quality (low-contamination) with respect to previous studies. As
such, it offers an excellent opportunity to revisit other fundamental
parameters such as the age.
