aboutsummaryrefslogtreecommitdiff
path: root/components/Box
diff options
context:
space:
mode:
Diffstat (limited to 'components/Box')
-rw-r--r--components/Box/index.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/components/Box/index.tsx b/components/Box/index.tsx
index 32866b2..f81fa5b 100644
--- a/components/Box/index.tsx
+++ b/components/Box/index.tsx
@@ -3,15 +3,23 @@ import { getSystemStyle, SystemProps } from '../utils/systemProps';
interface BoxProps extends SystemProps {
style?: React.CSSProperties;
children?: React.ReactNode;
+ el?: keyof React.ReactHTML;
};
-const Box: React.FC<BoxProps> = ({ style, children, ...props}) => {
+const Box: React.FC<BoxProps> = ({ el, style, children, ...props}) => {
const systemStyle = getSystemStyle(props, style);
+ let Tag = el;
+
+ if(!el) {
+ Tag = 'div' as keyof React.ReactHTML;
+ }
+
return (
- <div style={systemStyle}>
+ // @ts-ignore
+ <Tag style={systemStyle}>
{ children }
- </div>
+ </Tag>
);
};