diff --git a/src/components/Icon/Icon.stories.tsx b/src/components/Icon/Icon.stories.tsx index 998dfba8..4a91a6da 100644 --- a/src/components/Icon/Icon.stories.tsx +++ b/src/components/Icon/Icon.stories.tsx @@ -48,3 +48,23 @@ IconList.args = { size: 16, strokeWidth: 2, } + +const SvgMessagesIcon = () => ( + + + +) + +export const IconWithSVG = (args: any) => ( + } /> +) + +IconWithSVG.args = { + size: 'xxxlarge', + strokeWidth: 4, +} diff --git a/src/components/Icon/Icon.tsx b/src/components/Icon/Icon.tsx index 67bd4a81..2d97b87d 100644 --- a/src/components/Icon/Icon.tsx +++ b/src/components/Icon/Icon.tsx @@ -29,6 +29,7 @@ interface Props { | 'indigo' | 'purple' | 'pink' + src?: React.ReactNode } interface StringMap { @@ -44,6 +45,7 @@ function Icon({ fill = undefined, stroke = undefined, background, + src, ...props }: Props) { return ( @@ -100,14 +102,33 @@ function Icon({ /> ) + const Icon = src ? ( + // custom SVG file + + {src} + + ) : ( + // feather icon + + ) + return background ? (
- + {Icon}
) : ( - + Icon ) }}