@solar-icons/react
Version:
Solar Icons for React
36 lines (35 loc) • 1.5 kB
TypeScript
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
import React from 'react';
import type { IconBaseProps } from './types';
interface SolarContextType {
value: IconBaseProps;
setValue: (props: Partial<IconBaseProps>) => void;
svgProps?: ComponentPropsWithoutRef<'svg'>;
setSvgProps: (props: Partial<ComponentPropsWithoutRef<'svg'>>) => void;
}
interface ProviderProps {
value?: IconBaseProps;
svgProps?: ComponentPropsWithoutRef<'svg'>;
}
/**
* SolarProvider component is a React functional component that supplies
* the SolarContext to its child components. It manages and provides
* default properties for icon components, allowing consistent icon
* styling across the application.
* @param props - The props object.
* @param [props.value] - The initial icon properties.
* @param [props.svgProps] - The initial SVG properties.
* @param props.children - The child components that will have access to the context.
* @returns The context provider that wraps children components, providing icon customization capabilities.
*/
export declare const SolarProvider: React.FC<ProviderProps & {
children: ReactNode;
}>;
/**
* useSolar hook allows access to the current icon context.
* This hook can be used in any component that needs to read or modify
* the default icon properties provided by the SolarProvider.
* @returns The current context value for the icon properties.
*/
export declare const useSolar: () => SolarContextType;
export {};