Skip to content

🎥 Make videos programmatically with React

makeEllipse

Jonny Burger38d29a001f92
diff --git a/packages/docs/docs/shapes/ellipse.md b/packages/docs/docs/shapes/ellipse.md
new file mode 100644
index 0000000000..982c075a96
--- /dev/null
+++ b/packages/docs/docs/shapes/ellipse.md
@@ -0,0 +1,46 @@
+---
+title: <Ellipse />
+crumb: "@remotion/shapes"
+---
+
+_Part of the [` @remotion/shapes`](/docs/shapes) package._
+
+Renders an SVG element drawing an ellipse
+
+## Arguments
+
+### `options`
+
+An object with the following arguments:
+
+- `rx`: `number` - The x-axis radius of the ellipse
+- `ry`: `number` - The y-axis radius of the ellipse
+- `fill`: `string` `optional` - The color of the fill
+- `stroke`: `string` - The color of the stroke
+- `strokeWidth`: `number` - The width of the stroke
+- `style`: `React.CSSProperties` - The css styles applied to `svg` component
+
+```tsx twoslash
+import { Ellipse } from "@remotion/shapes";
+import { AbsoluteFill } from "remotion";
+
+export const MyComposition = () => {
+ return (
+ <AbsoluteFill
+ style={{
+ backgroundColor: "white",
+ justifyContent: "center",
+ alignItems: "center",
+ }}
+ >
+ <Ellipse rx={100} ry={50} fill="green" stroke="red" strokeWidth={1} />
+ </AbsoluteFill>
+ );
+};
+```
+
+## See also
+
+- [makeEllipse()](/docs/shapes/make-ellipse)
+- [`@remotion/shapes`](/docs/shapes)
+- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/shapes/src/ellipse.tsx)
diff --git a/packages/docs/docs/shapes/make-ellipse.md b/packages/docs/docs/shapes/make-ellipse.md
new file mode 100644
index 0000000000..6f667417e2
--- /dev/null
+++ b/packages/docs/docs/shapes/make-ellipse.md
@@ -0,0 +1,41 @@
+---
+title: makeEllipse()
+crumb: "@remotion/shapes"
+---
+
+_Part of the [`@remotion/shapes`](/docs/shapes) package._
+
+Renders an SVG element with an ellipse inside.
+
+## Arguments
+
+### `options`
+
+An object with the following arguments:
+
+- `rx`: `number` - The width of the triangle
+- `ry`: `number` - The height of the triangle.
+
+Example Triangle path generation
+
+```tsx twoslash
+import { makeEllipse } from "@remotion/shapes";
+
+const ellipse = makeEllipse({
+ rx: 100,
+ ry: 50,
+});
+
+console.log(ellipse); // M 100 0 a 100 100 0 1 0 1 0
+```
+
+## Credits
+
+Source code stems mostly from [triangle](https://stackblitz.com/edit/react-triangle-svg?file=index.js).
+
+## See also
+
+- [`<Ellipse>`](/docs/shapes/ellipse)
+- [makeRect()](/docs/shapes/make-rect)
+- [`@remotion/shapes`](/docs/shapes)
+- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/shapes/src/make-triangle.ts)