  We analyze the electronic structure of twisted bilayer graphene (TBG)
nanoribbons close to the magic angle. We describe a transition from an
incomplete to a complete moir\'e structure. By considering zigzag and armchair
edge terminations, the low-energy bands are strongly modified, and thus, the
edge flat band localization is sensitive to the type of boundary. By means of a
scaled tight-binding model, we calculate the band structure and find that, for
an armchair configuration, an incomplete moir\'e edge suppresses the edge
localization, while for a zigzag configuration, we find a strong interference
of the edge states with the moir\'e bands. In particular, for the armchair
termination, we observe a competition between the ribbon periodicity and the
graphene monolayers, which we describe with a potential well toy model.
Furthermore, for ribbons with widths of multiple moir\'e cells, the flat bands
of the moir\'es in the bulk are unperturbed as we change the borders. These
results are explained in terms of the strong electronic localization, nearly
Gaussian, in the AA stacking regions, as confirmed by an inverse participation
ratio analysis. Our results demonstrate that the electronic structure of TBG
nanoribbons is sensitive to the edge termination, offering an explanation for
recent experimental results.
