How would one achieve these type of buttons?

Can selector and shapes achieve this (the buttons clickable area should have the shape of the button) or are there any libraries and custom widgets for this?
How would one achieve these type of buttons?

Can selector and shapes achieve this (the buttons clickable area should have the shape of the button) or are there any libraries and custom widgets for this?