Providing a card view and a list view

I am working on a prototype of a document repository using Algolia. I have built a card view, that shows each document in the repository with a description of the document and some tags. I would like to give users the option to select a slimmed down “list” view, akin to the option available on for example Reddit (new design).

I looked through Github, and saw that this has been requested before. The initial assumption was that Algolia might be able to create a widget for this, but I understand this approach has been abandoned.

See: https://github.com/algolia/instantsearch.js/issues/845
As well as: https://github.com/algolia/instantsearch.js/issues/1071

Can anyone point me to documentation or an implementation that shows how to achieve this?

Here’s an implementation with a “hits view switcher”: https://github.com/shipow/searchstone

Relevant code is here:

Does that help you?