You can use the {exp:assets:folders} tag pair to loop through folders managed by Assets.

            <a href="{path=assets/view/{folder_id}}">{folder_name}</a>
            {if total_subfolders > 0}

Tag Parameters

{exp:assets:folders} supports the following parameters:

The path of the parent folder whose subfolders you wish to output. Set this parameter in the format of either “{filedir_X}optional/subfolder/path” or “{source_X}optional/subfolder/path”.
The ID of the parent folder whose subfolders you wish to output. If this both this parameter and parent_folder parameter is omitted, Assets will loop through all of your EE upload directories and S3 buckets.
A pipe-delimited list of keywords to filter the folders by.
If this is set to “yes”, all nested folders will be returned as well. (Set to “no” by default.)
Skips the first X folders
Limits the number of folders to be returned
Sorts the results. Can be set to “desc” or “random”.

Variable Tags

{exp:assets:folders} supports the following variable tags:

The ID that Assets has assigned to the current folder.
The name of the current folder.
The depth of the current folder. Top-level sources’ depth are ‘0’, first-level subfolders’ depth are ‘1’, their subfolders’ depth are ‘2’, and so on.
The total number of subfolders the current folder has.
If this tag is present, it will get replaced with the entire {exp:assets:folders} tag pair’s template code, including the {subfolders} tag. This provides a way to recursively output your entire folder tree (see example below).
The ID of the current folder’s parent folder.