Yeah they would definitely grow too big for that. If it's the bookshelf aquarium I am thinking of it's only around 6 gallons. I wouldn't recommend any danios for a tank that size. Even the standard size ones.
They like a lot of swimming room and may stress a betta out because they can be boisterous.