you simply define 1 custom field per attribute you want to show and return it’s value stored in the attributes
and you define it’s location on the card in the styles: section
the example makes use if 2 custom fields + mapping the friendly_name to the normal name field. You could add more custom_fields if you want to. Means you could freely create the card content. And not just with states/attributes but also with icons. You could even put another custom button_card being sort of a child card into the main one using custom_fields.
But you need to install the custom button-card using HACS first.