Skip to main content

<Star />

Part of the @remotion/shapes package.

Renders an SVG element containing a star.

Explorer

Example

src/Rect.tsx
tsx
import { Star } from "@remotion/shapes";
import { AbsoluteFill } from "remotion";
 
export const MyComposition = () => {
return (
<AbsoluteFill
style={{
backgroundColor: "white",
justifyContent: "center",
alignItems: "center",
}}
>
<Star points={5} innerRadius={150} outerRadius={200} fill="red" />
</AbsoluteFill>
);
};
src/Rect.tsx
tsx
import { Star } from "@remotion/shapes";
import { AbsoluteFill } from "remotion";
 
export const MyComposition = () => {
return (
<AbsoluteFill
style={{
backgroundColor: "white",
justifyContent: "center",
alignItems: "center",
}}
>
<Star points={5} innerRadius={150} outerRadius={200} fill="red" />
</AbsoluteFill>
);
};

Props

points

number

The amount of points of the star.

innerRadius

number

The inner radius of the star.

outerRadius

number

The outer radius of the star.

fill

string

The color of the shape.

stroke

string

The color of the stroke. Should be used together with strokeWidth.

strokeWidth

string

The width of the stroke. Should be used together with stroke.

style

string

CSS properties that will be applied to the <svg> tag. Default style: overflow: 'visible'

pathStyle

string

CSS properties that will be applied to the <path> tag. Default style: transform-box: 'fill-box' and a dynamically calculated transform-origin which is the center of the shape, so that the shape rotates around its center by default.

strokeDasharray

string

Allows to animate a path. See evolvePath() for an example.

strokeDashoffset

string

Allows to animate a path. See evolvePath() for an example.

Other props

All other props that can be passed to a <path> are accepted and will be forwarded.

See also