Currently, "product swatches" are not available in the Magento extension out of the box. Implementing this will require customization of the extension.
Below is a general implementation strategy you could use.
- You would need to have the details of all the variants in a product
- You would then need to swap out the variant display, in a similar way as our documentation describes for case of colour here: https://www.algolia.com/doc/guides/managing-results/refine-results/grouping#handle-item-variations
In summary, you need to toggle which of the sets of product data to show.
This would require extensive customization of both your backend and frontend.
On your backend :
You need to index all the child data into the records of the parents (colour, stock and image) so that it is available to be used to power the swatch.
You can learn more about customizing the Magento extension backend here.
On your frontend :
You need to add logic that replaces the images and adds the strike through on the colors which are not in stock.
You can learn more about customizing the Magento extension frontend reviewing InstantSearch page Configuration and Frontend custom events.