Great question — answering as the UphillTech team:
I don't think the option titles are available on the variant object - for those you would normally look on the parent product object. If you are printing the variant details from the context of a product page (or other situation where you already have a product object), you can use product.options or product.options_with_values to get the option category names. The option names will always be in the same order as the option values are listed on the variant, so the first value of the product.options array will be for the first item in the variant.options array. Once an item is added to the cart, the resulting line_item object gets its own style of an options_with_values object that has the...
Full answer by Dave B: https://stackoverflow.stackexchange.com/a/70037410 (CC BY-SA 4.0).
Need it done for your business? UphillTech.