2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-05 23:10:40 +00:00
iconify/packages/ember/src/props.ts
2021-07-20 16:50:05 +03:00

39 lines
1.0 KiB
TypeScript

import type { IconifyIcon } from '@iconify/types';
import type { IconifyIconCustomisations as RawIconCustomisations } from '@iconify/utils/lib/customisations';
export { RawIconCustomisations };
// Allow rotation to be string
/**
* Icon customisations
*/
export type IconifyIconCustomisations = RawIconCustomisations & {
rotate?: string | number;
};
/**
* Callback for when icon has been loaded (only triggered for icons loaded from API)
*/
export type IconifyIconOnLoad = (name: string) => void;
/**
* Icon properties
*/
export interface IconifyIconProps extends IconifyIconCustomisations {
// Icon object or icon name (must be added to storage using addIcon for offline package)
icon: IconifyIcon | string;
// Style
color?: string;
// Shorthand properties
flip?: string;
align?: string;
// Unique id, used as base for ids for shapes. Use it to get consistent ids for server side rendering
id?: string;
// Callback to call when icon data has been loaded. Used only for icons loaded from API
onLoad?: IconifyIconOnLoad;
}