Toggle theme

FavIcons🔗

@volvo-cars/favicons

@volvo-cars/favicons
@volvo-cars/favicons
@volvo-cars/favicons

This package exports functions and a React component that renders a set of favicons of different sizes associated with the Volvo Cars brand. The component renders link tags with rel, sizes and href attributes to notify browsers of the type, size and location of the favicon in the shared assets CDN.

Installation🔗

Usage🔗

💡 This package includes Typescript definitions

This package is meant to be rendered server-side in the head tag, along with other link elements. By only server-side rendering, none of the code will be included in the client-side bundle.

Next.js Example🔗

Custom http server Example🔗

The function and React component render the following HTML:

renderFavIcons🔗

returns a string of link HTML elements.

getFavIcons🔗

return an array of objects that has information about the sizes, rel, type and href to the favicon in the shared assets CDN,

Get Icon data without link tags🔗

It's also possible to get the available favicon sizes and links this package renders through the getFavIcons function exported from @volvo-cars/favicons.

Example

2022 © Volvo Car Corporation