Skip to content

Commit

Permalink
Passthrough all SVG props (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Mar 6, 2024
1 parent 2669b9f commit 1a99d3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-mugs-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"formidable-oss-badges": patch
---

Passthrough SVG props to badges
6 changes: 4 additions & 2 deletions src/FeaturedBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import clsx from "clsx"
import { CSSProperties } from "react"
import { CSSProperties, SVGProps } from "react"
import * as featuredLogos from "./assets/featuredLogos"
import styles from "./styles.module.css"

type Props = {
type Props = SVGProps<SVGElement> & {
name: keyof typeof featuredLogos.default
className?: string
isHoverable?: boolean
Expand All @@ -15,6 +15,7 @@ const FeaturedBadge = ({
className,
style,
isHoverable = true,
...rest
}: Props) => {
const Logo =
featuredLogos.default[
Expand All @@ -26,6 +27,7 @@ const FeaturedBadge = ({
<Logo
className={clsx(isHoverable && styles.hoverableLogo, className)}
style={style}
{...rest}
/>
)
}
Expand Down

0 comments on commit 1a99d3f

Please sign in to comment.