Skip to content

Commit d4062a4

Browse files
committed
Enhance PageRenderer with className and props support
PageRenderer now accepts an optional className and additional props, improving flexibility for custom styling and component extension.
1 parent b76f864 commit d4062a4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • packages/components/src/renderers/layout

packages/components/src/renderers/layout/page.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ import { SchemaRenderer } from '@object-ui/react';
44
import { ComponentRegistry } from '@object-ui/core';
55
import { cn } from '../../lib/utils'; // Keep internal import for utils
66

7-
export const PageRenderer: React.FC<{ schema: PageSchema }> = ({ schema }) => {
7+
export const PageRenderer: React.FC<{ schema: PageSchema; className?: string; [key: string]: any }> = ({
8+
schema,
9+
className,
10+
...props
11+
}) => {
812
// Support both body (legacy/playground) and children
913
const content = schema.body || schema.children;
1014
const nodes = Array.isArray(content) ? content : (content ? [content] : []);
1115

1216
return (
13-
<div className={cn("min-h-full w-full bg-background p-6 md:p-8", schema.className)}>
17+
<div
18+
className={cn("min-h-full w-full bg-background p-6 md:p-8", className)}
19+
{...props}
20+
>
1421
<div className="mx-auto max-w-7xl space-y-8">
1522
{(schema.title || schema.description) && (
1623
<div className="space-y-2">

0 commit comments

Comments
 (0)