Skip to content

🎥 Make videos programmatically with React

update docs

Jonny Burger791df89194eb
diff --git a/packages/docs/docs/shapes/make-rect.md b/packages/docs/docs/shapes/make-rect.md
index 1628c19279..5eb77e9d03 100644
--- a/packages/docs/docs/shapes/make-rect.md
+++ b/packages/docs/docs/shapes/make-rect.md
@@ -5,24 +5,12 @@ crumb: "@remotion/shapes"
_Part of the [` @remotion/shapes`](/docs/shapes) package._
-Generates an SVG path for a rectangle
+Generates an SVG path for a rectangle.
## Arguments
An object with the following entries:
-### `x`
-
-_`number`, optional_
-
-The x-axis coordinate to start drawing the rect. Defaults to `0`.
-
-### `y`
-
-_`number`, optional_
-
-The y-axis coordinate to start drawing the rect. Defaults to `0`.
-
### `width`
The width of the rectangle
@@ -31,11 +19,13 @@ The width of the rectangle
The height of the rectangle
+## Example
+
```tsx twoslash
import { makeRect } from "@remotion/shapes";
-const rect = makeRect({ x: 50, y: 50, width: 100, height: 100 });
+const rect = makeRect({ width: 100, height: 100 });
-console.log(rect); // M 50 50 l 100 0 l 0 100 l -100 0 Z
+console.log(rect); // M 0 0 l 100 0 l 0 100 l -100 0 Z
```
## See also
diff --git a/packages/docs/docs/shapes/make-triangle.md b/packages/docs/docs/shapes/make-triangle.md
index 74532037cf..12d46efeb5 100644
--- a/packages/docs/docs/shapes/make-triangle.md
+++ b/packages/docs/docs/shapes/make-triangle.md
@@ -5,7 +5,7 @@ crumb: "@remotion/shapes"
_Part of the [` @remotion/shapes`](/docs/shapes) package._
-Generates Triangle SVG path
+Generates a triangle SVG path.
## Arguments
@@ -15,19 +15,21 @@ An object with the following arguments:
- `width`: `number` - The width of the triangle
- `height`: `number` - The height of the triangle.
-- `direction`: `string` - The identifier what kind of rectangle, possible values `left`, `right`, `top` and `bottom`
+- `direction`: `string` - The identifier what kind of rectangle, possible values are `left`, `right`, `top` and `bottom`
Example Triangle path generation
-```tsx twoslash
+```tsx twoslash title="triangle.ts"
import { makeTriangle } from "@remotion/shapes";
-const rightTriangle = makeTriangle({
- width: 100,
- height: 100,
+
+const { path, width, height } = makeTriangle({
+ length: 100,
direction: "right",
});
-console.log(rightTriangle); // M 0,0 L 0,100 L 100,50 z
+console.log(path); // M 0 0 L 0 100 L 86.60254037844386 50 z
+console.log(width); // 86.60254037844386
+console.log(height); // 100
```
## Credits