Mediation analysis revealed that CD40 mediates the effects on IS subtypes (CES, AIS), VD, and the VD‐SC subtype by regulating AF. The gene discussed is CD40; the disease is atrial fibrillation.