ImportanceA composite score of flavonoid-rich foods (flavodiet) may provide a clear public health message regarding the range of foods with the potential to lower dementia risk.ObjectiveTo examine associations of flavodiet score and intakes of flavonoid subclasses with dementia risk according to genetic risk and presence of depression and hypertension.Design, Setting, and ParticipantsThis prospective, population-based cohort study included dietary data from adults aged 40 to 70 years in the UK Biobank, recruited between 2006 and 2010, with a mean (SD) follow-up of 9.2 (1.5) years. The data analyses were conducted from September 1 to 30, 2023.ExposureFlavodiet score adherence and intake of flavonoid subclasses derived from 24-hour computerized dietary assessments.Main Outcome and MeasuresThe main outcome was incident all-cause dementia and interactions with genetic risk, hypertension, and depressive symptoms using multivariable Cox proportional hazards regression models.ResultsThe sample included 121 986 participants (mean [SD] age, 56.1 [7.8] years; 55.6% female; 882 with incident dementia). Comparing the highest with lowest quintile of flavodiet score, consuming 6 additional servings per day of flavonoid-rich foods was associated with a lower risk of dementia among all participants (adjusted hazard ratio [AHR], 0.72; 95% CI, 0.57-0.89), those at high genetic risk (AHR, 0.57; 95% CI, 0.42-0.78), and those with depressive symptoms (AHR, 0.52; 95% CI, 0.33-0.81) after multivariable adjustment. The greatest risk reduction was observed in participants consuming at least 2 of the following per day: 5 servings of tea, 1 serving of red wine, and 0.5 servings of berries, compared with those who did not achieve any of these intakes (AHR, 0.62; 95% CI, 0.46-0.84). Higher intakes of flavonoid subclasses, including anthocyanins, flavan-3-ols, flavonols, and flavones, of which tea, red wine, and berries are the main contributors, supported these findings, showing inverse associations with dementia risk.Conclusions and RelevanceIn this cohort study, high adherence to a flavonoid-rich diet score was associated with a lower risk of dementia, with reductions more pronounced in individuals with a high genetic risk, hypertension, and depressive symptoms. These findings suggest that simple dietary changes of increasing intakes of commonly consumed flavonoid-rich foods and drinks may lower dementia risk.