diff --git a/.changeset/nice-lamps-peel.md b/.changeset/nice-lamps-peel.md
new file mode 100644
index 000000000..cda7fd482
--- /dev/null
+++ b/.changeset/nice-lamps-peel.md
@@ -0,0 +1,5 @@
+---
+'@primer/octicons': minor
+---
+
+Add support for SVG props to base icons
diff --git a/lib/octicons_react/__tests__/tree-shaking.test.js b/lib/octicons_react/__tests__/tree-shaking.test.js
index a490c44bf..5ce93e15e 100644
--- a/lib/octicons_react/__tests__/tree-shaking.test.js
+++ b/lib/octicons_react/__tests__/tree-shaking.test.js
@@ -50,5 +50,5 @@ test('tree shaking single export', async () => {
})
const bundleSize = Buffer.byteLength(output[0].code.trim()) / 1000
- expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"3.563kB"`)
+ expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"6.29kB"`)
})
diff --git a/lib/octicons_react/src/__tests__/octicon.js b/lib/octicons_react/src/__tests__/octicon.js
index c4a9493a7..d21263e84 100644
--- a/lib/octicons_react/src/__tests__/octicon.js
+++ b/lib/octicons_react/src/__tests__/octicon.js
@@ -67,6 +67,11 @@ describe('An icon component', () => {
expect(container.querySelector('svg')).toHaveStyle({verticalAlign: 'middle'})
})
+ it('supports additional props on the outermost element', () => {
+ const {container} = render()
+ expect(container.firstChild).toHaveAttribute('data-testid', 'icon')
+ })
+
describe('size props', () => {
it('respects size="small"', () => {
const {container} = render()
diff --git a/lib/octicons_react/src/createIconComponent.js b/lib/octicons_react/src/createIconComponent.js
index f895c43ec..f5469b5a5 100644
--- a/lib/octicons_react/src/createIconComponent.js
+++ b/lib/octicons_react/src/createIconComponent.js
@@ -21,7 +21,9 @@ export function createIconComponent(name, defaultClassName, getSVGData) {
size = 16,
verticalAlign = 'text-bottom',
id,
- title
+ title,
+ style,
+ ...rest
},
forwardedRef
) => {
@@ -36,6 +38,7 @@ export function createIconComponent(name, defaultClassName, getSVGData) {
return (