How can I display subcategories in such boxes if a main category is selected?

How can I display subcategories in such boxes if a main category is selected?

2 Likes