The colour swatch is used to demonstrate what colour variants of a product are available or to present the user with a choice of colours to choose from.
When using the colour swatch:
Use truncation when there are more colour swatches than the space can allow
Don't use truncation when a colour swatch is being used to select a colour
Always include a visible label to show the name of the selected colour
Use the disabled state when a colour variant is not available or sold out
Types of colour swatch
There are two sizes of colour swatches for different experiences.
Large Colour Swatch
The large colour swatch comes in the individual swatch size of 32px x 32px. It should be used where a colour needs to be selected from a group, for example on a product page. This swatch includes a label where the selected colour name is displayed.
Current active theme is Sainsbury's. You can see all developer documentation on our Fable Storybook site.
Small Colour Swatch
The small colour swatch comes in the individual swatch size of 24px x 24px. It should be used to demonstrate what colours are available, but not to select a colour from a group, for example on a product card on a listing page.
It includes optional truncation to show there are more colour variants available than the amount that can be displayed in the space.
Current active theme is Sainsbury's. You can see all developer documentation on our Fable Storybook site.