Skip to content

🎥 Make videos programmatically with React

by default overflow vislble

Jonny Burgerd5fd8cea3a9d
diff --git a/packages/docs/components/shapes/shapes-info.tsx b/packages/docs/components/shapes/shapes-info.tsx
index 73382c66d9..95ecef98cc 100644
--- a/packages/docs/components/shapes/shapes-info.tsx
+++ b/packages/docs/components/shapes/shapes-info.tsx
@@ -101,6 +101,15 @@ const globalParams: Param[] = [
</>
),
},
+ {
+ name: "style",
+ type: "string",
+ description: (
+ <>
+ CSS properties that will be applied to the <code>{"<svg>"}</code> tag.
+ </>
+ ),
+ },
{
name: "strokeWidth",
type: "string",
@@ -111,6 +120,26 @@ const globalParams: Param[] = [
</>
),
},
+ {
+ name: "strokeDasharray",
+ type: "string",
+ description: (
+ <>
+ Allows to animate a path. See{" "}
+ <a href="/docs/paths/evolve-path">evolvePath()</a> for an example.
+ </>
+ ),
+ },
+ {
+ name: "strokeDashoffset",
+ type: "string",
+ description: (
+ <>
+ Allows to animate a path. See{" "}
+ <a href="/docs/paths/evolve-path">evolvePath()</a> for an example.
+ </>
+ ),
+ },
];
export const ShapeOptions: React.FC<{
@@ -139,6 +168,15 @@ export const ShapeOptions: React.FC<{
</React.Fragment>
);
})}
+ {all ? (
+ <>
+ <h3>Other props</h3>{" "}
+ <p>
+ All other props that can be passed to a <code>{"<path>"}</code> are
+ accepted and will be forwarded.
+ </p>
+ </>
+ ) : null}
</React.Fragment>
);
};
diff --git a/packages/example/src/Shapes/CircleTest.tsx b/packages/example/src/Shapes/CircleTest.tsx
index 1921e3713d..5f9c3cc43c 100644
--- a/packages/example/src/Shapes/CircleTest.tsx
+++ b/packages/example/src/Shapes/CircleTest.tsx
@@ -12,13 +12,7 @@ const CircleTest: React.FC = () => {
alignItems: 'center',
}}
>
- <Circle
- width={100}
- height={100}
- fill="green"
- stroke="red"
- strokeWidth={1}
- />
+ <Circle radius={100} fill="green" stroke="red" strokeWidth={10} />
</AbsoluteFill>
);
};
diff --git a/packages/shapes/src/components/render-svg.tsx b/packages/shapes/src/components/render-svg.tsx
index a1de8c4679..245df884e7 100644
--- a/packages/shapes/src/components/render-svg.tsx
+++ b/packages/shapes/src/components/render-svg.tsx
@@ -1,11 +1,9 @@
import React, {useMemo} from 'react';
-export type AllShapesProps = {
- style?: React.CSSProperties;
- stroke?: string;
- strokeWidth?: number;
- fill?: string;
-};
+export type AllShapesProps = Omit<
+ React.SVGProps<SVGPathElement>,
+ 'width' | 'height' | 'd'
+>;
export const RenderSvg = ({
width,
@@ -22,8 +20,7 @@ export const RenderSvg = ({
} & AllShapesProps) => {
const actualStyle = useMemo(() => {
return {
- display: 'inline-block',
- verticalAlign: 'middle',
+ overflow: 'visible',
...(style ?? {}),
};
}, [style]);