This funky tutorial from Scott Bedford on Craft is a fun one! It involves a bit of work to drill a hole through your shelf and cut a toy in half, embedding hardware inside to help it hold together. If you aren't looking for a process that's as involved as this one (even if the results are totally worth it), you could easily epoxy a toy to your shelf in less time.
For a modern twist, you could paint them all one color before installing for that oh so sleek look that's so popular these days. Check out the tutorial over at Craft and see if it doesn't start your wheels a spinning!