@south-paw/react-vector-maps
Version:
A React component for interactive vector maps of the world and 100+ countries
33 lines (30 loc) • 1.15 kB
TypeScript
import React from 'react';
interface VectorMapLayer {
/** Unique ID of each layer. */
id: string;
/** Name of the layer. */
name: string;
/** SVG path for the layer. */
d: string;
}
interface VectorMapProps extends React.SVGProps<SVGSVGElement> {
children?: React.ReactNode;
/** Unique ID of the SVG element. */
id: string;
/** Name of the map. */
name: string;
/** View box for the map. */
viewBox: string;
/** Layers that represent the regions of the map. */
layers: VectorMapLayer[];
/** Tab index for each layer. Set to '-1' to disable layer focusing. */
tabIndex?: number;
/** Props to spread onto each layer. */
layerProps?: React.SVGProps<SVGPathElement>;
/** Layer IDs to 'select' with the 'aria-checked' attribute. */
checkedLayers?: string[];
/** Layer IDs to 'select' with the 'aria-current' attribute. */
currentLayers?: string[];
}
declare function VectorMap({ id, name, layers, tabIndex, layerProps, checkedLayers, currentLayers, children, ...other }: VectorMapProps): JSX.Element | null;
export { VectorMap, VectorMapLayer, VectorMapProps };