Adding groups/collections to a UI List

Does anyone knows if there’s some template for adding group / collections to a UI List?
Or is something that I would need to program by myself?