Skip to content

defaultIconCustomisations

This constant is part of Iconify Utils package.

Constant defaultIconCustomisations is used for default FullIconifyIconCustomisations values.

It is merged from 2 parts:

defaultIconSizeCustomisations

Constant defaultIconSizeCustomisations represents size customisations: width and height:

jsconst defaultIconSizeCustomisations = {
   width: null,
   height: null,
};

defaultIconTransformations

Constant defaultIconTransformations represents transformations:

jsconst defaultIconTransformations = {
   rotate: 0,
   vFlip: false,
   hFlip: false,
};

Default values for transformations are shared with IconifyIcon type.

Usage

example.ts
tsimport { defaultIconCustomisations, mergeCustomisations } from '@iconify/utils';

// Add horizontal flip and custom height
const fullCustomisations = {
   ...defaultIconCustomisations,
   hFlip: true,
   height: 24,
};

// Add horizontal flip again, but merge it properly using mergeCustomisations(), resulting in hFlip = false
const mergedCustomisations = mergeCustomisations(fullCustomisations, {
   hFlip: true,
});

Usually it is used with mergeCustomisations() function.

It is also used in functions that require only partial customisations, such as iconToSVG(), but internally actually uses full customisations.

Released under the Apache 2.0 License.