Don't make the mistake by insering the new ssd stright out of the box.
OS and disc formatting need to be done first.
I wanted to install a new OS into a mac mini and had no previous useable HD. The way I successfully did it was:
Connect ssd via sata cable to a Mac. (Ssd icon shows on desktop)
Disc Utilty/ Erase ssd then partition ssd and give it a name.
Inset flash drive with bootable OS ( icon appears on desktop)
Click on OS icon. Disc Utility/ Install OS then select Show all disks
Click on new SSD and install.
When cooked, remove ssd from Mac and insert into mac mini. Then boot up.
Phew!