Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "sheet",
"title": "UI Sheet",
"description": "A side panel whose opened/closed state is a pure function of the timeline; the backdrop dim and right-edge slide-in are keyframed presets, with a close button and a primary action. Self-contained — pair it with the Button as a trigger (see the example).",
"dependencies": ["remotion"],
"registryDependencies": ["@remocn/remocn-ui"],
"files": [
{
"path": "registry/remocn-ui/sheet/index.tsx",
"content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SheetState = \"opened\" | \"closed\";\n\nexport interface SheetProps {\n state?: SheetState;\n style?: SheetStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst SHEET_WIDTH = 400;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface SheetStyle {\n overlayOpacity: number;\n panelOpacity: number;\n panelTranslateX: number;\n}\n\nexport interface SheetStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function sheetStyleContext(theme: RemocnTheme): SheetStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function sheetStyle(\n state: SheetState,\n _ctx: SheetStyleContext,\n): SheetStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n panelOpacity: 1,\n panelTranslateX: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n panelOpacity: 0,\n panelTranslateX: SHEET_WIDTH,\n };\n }\n}\n\nexport function Sheet({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n className,\n}: SheetProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = sheetStyleContext(theme);\n const v = style ?? sheetStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n height: \"100%\",\n width: SHEET_WIDTH,\n transform: `translateX(${v.panelTranslateX}px)`,\n opacity: v.panelOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n borderLeft: `1px solid ${ctx.border}`,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"-24px 0 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n width: 28,\n height: 28,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n border: \"none\",\n borderRadius: ctx.radius,\n color: ctx.mutedFg,\n cursor: \"pointer\",\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M18 6 6 18 M6 6 18 18\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n paddingRight: 28,\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: \"auto\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/sheet.tsx"
},
{
"path": "registry/remocn-ui/sheet/use-sheet-transition.ts",
"content": "\"use client\";\n\nimport {\n type SheetState,\n type SheetStyle,\n sheetStyle,\n sheetStyleContext,\n} from \"@/components/remocn/sheet\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSheetStyle(\n a: SheetStyle,\n b: SheetStyle,\n t: number,\n): SheetStyle {\n return {\n overlayOpacity:\n a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelTranslateX:\n a.panelTranslateX + (b.panelTranslateX - a.panelTranslateX) * t,\n };\n}\n\nexport interface SheetTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSheetTransition(\n steps: Step<SheetState>[],\n opts: SheetTransitionOptions = {},\n): SheetStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = sheetStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSheetStyle(sheetStyle(from, ctx), sheetStyle(to, ctx), t);\n}\n",
"type": "registry:component",
"target": "components/remocn/use-sheet-transition.ts"
}
],
"type": "registry:component"
}