  Twisted bilayers of two-dimensional (2D) materials are proving a fertile
ground for investigating strongly correlated electron phases. This is because
the moir\'e pattern introduced by the relative twist between layers introduces
long-wavelength effective potentials which lead to electron localization. Here,
we develop a generalized continuum model for the electronic structure of
moir\'e patterns, based on first-principles calculations and tailored to
capture the physics of twisted bilayer 2D semiconductors. We apply this model
to a database of eighteen 2D crystals covering a range of atomic relaxation and
electronic structure features. Many of these materials host topologically
insulating (TI) moir\'e bands in a certain range of twist angles, which
originate from the competition between triangular and hexagonal moir\'e
patterns, tuned by the twist angle. The topological phases occur in the same
range as the maximally flat moir\'e bands.
