Yes, diabetes mellitus has a genetic component, particularly in both Type 1 and Type 2 diabetes. Type 1 diabetes is more likely to occur in individuals with a family history of the condition, but it is usually triggered by environmental factors, while Type 2 diabetes tends to run in families and is often influenced by a combination of genetic predisposition and lifestyle factors such as diet and physical activity levels.