Flavonoids possess the latent ability to protect against sleep disorders. We examined the correlation between daily flavonoid intake and sleep duration, and sleep disorders. We enrolled 8216 participants aged ≥ 20 from the National Health and Nutrition Examination Survey (NHANES, 2007–2010), carrying out a cross-sectional study. Flavonoid intake was collected by dietary intake interview recalls. Logistic regression was utilized to evaluate the association between flavonoid intake sleep duration, and sleep disorders. We used subgroup and interaction analysis to explore differences between subgroups. When adjusting covariates in model 2, anthocyanidins, flavan-3-ols, flavones, flavonols, and the sum of flavonoids were considerably related to insufficient sleep duration (odds ratio (OR) (95% confidence interval (CI)); 0.83 (0.72, 0.95); 0.91 (0.83, 0.98); 0.63 (0.41, 0.98); 0.78 (0.64, 0.94); 0.85 (0.76, 0.95), respectively); the converse association was observed between flavanones, and flavones and the risk of sleep disorders (OR (95% CI); 0.85 (0.77, 0.95); 0.61 (0.41, 0.90), respectively). In relation to insufficient sleep, there were statistically significant interactions between flavonoid consumption and race/ethnicity, and education level. In relation to insufficient sleep, there were statistically significant interactions between flavonoid consumption and working status. In this study, we found that certain flavonoids were linked to increased sleep duration and a lower risk of sleep problems. Our research indicated that flavonoids might be a preventive factor for sleep disorders.