I am a software developer working in a particular technology (say A) for the past 1 year and this is my first job out of college. Though my present work is good and pays me well, I want to move to another technology(say B) that I have liked working on. My question is not about if I want to change, but how do I show that I have an expertise in B to the companies? I can always do some projects in my spare time but my perception is that the companies do not value it much compared to actual job experience in B. How do I show my expertise in B to the companies? Any other ways to improve other than the "I have done spare time projects in B" ?
My question is not about if I want to change, but how do I show that I have an expertise in B to the companies?
You can't demonstrate expertise that you don't have. Thus, first, you need to gain the desired expertise.
If you take courses in this technology, you can list them on your resume, and discuss your knowledge of the technology in your cover letter and during interviews.
As you point out, projects involving this new technology performed in your spare time aren't as valuable as actual work in the technology. But, they still have value - particularly if the project has wide exposure. Some open source projects become widely known. Involvement with those can often lead to good bullet points on a resume, and good discussions in interviews.
Part-time jobs (such as moonlighting), which involve this technology are direct evidence of your knowledge. Perhaps you have friends working with this technology who might need some extra help and could bring you on for a few hours per week or weekend.
Having your own website/blog discussing your use of the technology gives you some online presence that can be useful, and that others can see and appreciate.
Often, particular technologies have developer communities associated with them. Those communities involve online forums, meetups, conferences, opportunities to speak in front of an audience, etc. Becoming actively involved with those communities is often a way to network, gain knowledge, and become known. My son did just this and was able to transition into a technology he loved.
In the end, you just have to convince a hiring manager that you have gained sufficient expertise in the desired technology for them to give you a chance. Some of the above could help.
One easy way to demonstrate peer-reviewed experience would be to gain lot of XP point answering questions on SO or other relevant forums (for technology B). If it is open source or has open-source parts, become expert in that. If you contributed code/documentation/whatever to a project B, it should be obvious to hiring manager that you know technology B.