Skip to content

Commit f63cbe5

Browse files
WesSouzaarturbien
authored andcommitted
chore(types): add helper type CommonStyledProps
1 parent fc7c8a9 commit f63cbe5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/types.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import React from 'react';
2+
13
export type Color = string;
24

35
export type Sizes = 'sm' | 'md' | 'lg';
@@ -8,6 +10,14 @@ export type Direction = 'up' | 'down' | 'left' | 'right';
810

911
export type DimensionValue = undefined | number | string;
1012

13+
export type CommonStyledProps = {
14+
/**
15+
* "as" polymorphic prop allows to render a different HTML element or React component
16+
* @see {@link https://styled-components.com/docs/api#as-polymorphic-prop}
17+
*/
18+
as?: string | React.ComponentType<any>; // eslint-disable-line @typescript-eslint/no-explicit-any
19+
};
20+
1121
export type CommonThemeProps = {
1222
// TODO: Rename to base `disabled`
1323
isDisabled?: boolean;

0 commit comments

Comments
 (0)