react-fa-picker
Version:
A reusable React Icon Picker component, bundled with its own Tailwind CSS build.
49 lines • 1.46 kB
TypeScript
import { ReactNode } from 'react';
import { IconStateType, IconType } from './types';
interface IconContextType extends IconStateType {
setSelectedIcon: (iconName: string | null) => void;
setSearchQuery: (query: string) => void;
setActiveCategory: (category: string | null) => void;
selectedIconObject: IconType | null;
/**
* The current color to apply to icons.
*/
color: string;
/**
* Updates the current icon color.
*/
setColor: (color: string) => void;
/**
* current icon size and setter.
*/
size: number;
setSize: (size: number) => void;
hideSizeAndColor: boolean;
}
interface IconPickerProviderProps {
children: ReactNode;
/**
* Initial selected icon name
*/
defaultValue?: string;
/**
* Initial icon color (default: "#000000")
*/
defaultColor?: string;
/**
* Initial icon size (default: "14px")
*/
defaultSize?: number;
/**
* Callback fired when selection changes
*/
onChange?: (icon: IconType & {
color: string;
size: number;
}) => void;
hideSizeAndColor: boolean;
}
export declare function IconPickerProvider({ children, defaultValue, defaultColor, defaultSize, onChange, hideSizeAndColor, }: IconPickerProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useIconPicker(): IconContextType;
export {};
//# sourceMappingURL=IconPickerContext.d.ts.map