Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: icon star

dev_wandryef07d87676c6
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsx
index 68211e0f..87ec1c1c 100644
--- a/components/docs/icons-gallery.tsx
+++ b/components/docs/icons-gallery.tsx
@@ -21,6 +21,7 @@ import { RefreshCwIconStatic } from "@/registry/remocn/icon-refresh-cw";
import { SearchIconStatic } from "@/registry/remocn/icon-search";
import { SendIconStatic } from "@/registry/remocn/icon-send";
import { SettingsIconStatic } from "@/registry/remocn/icon-settings";
+import { StarIconStatic } from "@/registry/remocn/icon-star";
import { TrashIconStatic } from "@/registry/remocn/icon-trash";
import { UploadIconStatic } from "@/registry/remocn/icon-upload";
import { XIconStatic } from "@/registry/remocn/icon-x";
@@ -145,6 +146,12 @@ export const ICONS: IconEntry[] = [
category: "Emotion & accents",
Static: HeartIconStatic,
},
+ {
+ name: "icon-star",
+ label: "Star",
+ category: "Emotion & accents",
+ Static: StarIconStatic,
+ },
];
const CATEGORY_ORDER: IconCategory[] = [
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index e1e766d3..a8268bfe 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -38,6 +38,7 @@ import { iconRefreshCwConfig } from "@/registry/remocn/icon-refresh-cw/config";
import { iconSearchConfig } from "@/registry/remocn/icon-search/config";
import { iconSendConfig } from "@/registry/remocn/icon-send/config";
import { iconSettingsConfig } from "@/registry/remocn/icon-settings/config";
+import { iconStarConfig } from "@/registry/remocn/icon-star/config";
import { iconTrashConfig } from "@/registry/remocn/icon-trash/config";
import { iconUploadConfig } from "@/registry/remocn/icon-upload/config";
import { iconXConfig } from "@/registry/remocn/icon-x/config";
@@ -665,6 +666,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: iconSettingsConfig,
},
+ "icon-star": {
+ load: () =>
+ import("@/registry/remocn/icon-star").then((m) => ({
+ default: m.StarIcon,
+ })),
+ config: iconStarConfig,
+ },
"icon-trash": {
load: () =>
import("@/registry/remocn/icon-trash").then((m) => ({
diff --git a/registry/remocn/icon-star/config.ts b/registry/remocn/icon-star/config.ts
new file mode 100644
index 00000000..75baa50a
--- /dev/null
+++ b/registry/remocn/icon-star/config.ts
@@ -0,0 +1,44 @@
+import { type ComponentConfig, FPS } from "@/lib/customizer-config";
+
+export const iconStarConfig: ComponentConfig = {
+ componentName: "StarIcon",
+ importPath: "@/components/remocn/icon-star",
+ controls: {
+ animation: {
+ type: "select",
+ default: "both",
+ options: ["draw", "action", "both"],
+ label: "Animation",
+ },
+ loop: {
+ type: "boolean",
+ default: false,
+ label: "Loop",
+ },
+ size: {
+ type: "number",
+ default: 48,
+ min: 24,
+ max: 200,
+ step: 4,
+ label: "Size",
+ },
+ color: {
+ type: "color",
+ default: "#171717",
+ label: "Color",
+ },
+ strokeWidth: {
+ type: "number",
+ default: 2,
+ min: 1,
+ max: 3,
+ step: 0.25,
+ label: "Stroke width",
+ },
+ },
+ durationInFrames: 70,
+ fps: FPS,
+ compositionWidth: 48,
+ compositionHeight: 48,
+};
diff --git a/registry/remocn/icon-star/index.tsx b/registry/remocn/icon-star/index.tsx
new file mode 100644
index 00000000..f621bc03
--- /dev/null
+++ b/registry/remocn/icon-star/index.tsx
@@ -0,0 +1,109 @@
+"use client";
+
+import { Easing, interpolate, spring, useVideoConfig } from "remotion";
+import {
+ drawnPathProps,
+ type IconAnimationProps,
+ useIconAnimation,
+} from "@/lib/remocn-icons";
+
+const STAR_PATH =
+ "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z";
+
+const TIMINGS = {
+ drawDurationInFrames: 14,
+ actionDelayInFrames: 2,
+ actionDurationInFrames: 18,
+ loop: false,
+} as const;
+
+export function StarIcon({
+ animation = "both",
+ loop,
+ speed,
+ size = 48,
+ color = "currentColor",
+ strokeWidth = 2,
+ className,
+}: IconAnimationProps) {
+ const { drawProgress, scaleIn, actionFrame, actionProgress } =
+ useIconAnimation({ animation, loop, speed }, TIMINGS);
+ const { fps } = useVideoConfig();
+
+ const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);
+
+ const starProgress = interpolate(linearDraw, [0, 1], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ });
+
+ const star = drawnPathProps(STAR_PATH, starProgress);
+
+ const settle = spring({
+ frame: actionFrame,
+ fps,
+ config: { damping: 12, stiffness: 140, mass: 0.8 },
+ durationInFrames: 18,
+ });
+ const rotate = -8 * (1 - settle);
+ const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ });
+ const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);
+
+ return (
+ <svg
+ className={className}
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke={color}
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ style={{
+ overflow: "visible",
+ transformOrigin: "center",
+ transform: `rotate(${rotate}deg) scale(${scale})`,
+ }}
+ >
+ <path
+ d={STAR_PATH}
+ strokeDasharray={star.strokeDasharray}
+ strokeDashoffset={star.strokeDashoffset}
+ />
+ </svg>
+ );
+}
+
+export function StarIconStatic({
+ size = 48,
+ color = "currentColor",
+ strokeWidth = 2,
+ className,
+}: {
+ size?: number;
+ color?: string;
+ strokeWidth?: number;
+ className?: string;
+}) {
+ return (
+ <svg
+ className={className}
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke={color}
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <path d={STAR_PATH} />
+ </svg>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index b3c9fca6..29a12aaa 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1593,6 +1593,21 @@
"target": "components/remocn/icon-heart.tsx"
}
]
+ },
+ {
+ "name": "icon-star",
+ "type": "registry:component",
+ "title": "Star",
+ "description": "Animated Lucide star icon — the outline draws on, then twinkles into place with a small rotate and scale pop for ratings, favorites, or star callouts.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/icons-core"],
+ "files": [
+ {
+ "path": "icon-star/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/icon-star.tsx"
+ }
+ ]
}
]
}