Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/components/src/components/frame/frame.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export const Basic: Story = {
},
};

export const WithCaption: Story = {
export const WithDescription: Story = {
args: {
style: { width: "400px", height: "200px" },
className: "w-full",
description: "This is a frame caption",
children: <div className="p-4">Frame with caption</div>,
description: "This is a frame description",
children: <div className="p-4">Frame with description</div>,
},
};

Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/components/frame/frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ type FrameProps = {
children: ReactNode;
title?: string;
description?: string;
renderDescription?: (description: string) => ReactNode;
};

const Frame = ({
as: Component = "div",
title,
description,
renderDescription = (text) => <p>{text}</p>,
style,
className,
children,
Expand Down Expand Up @@ -68,7 +70,7 @@ const Frame = ({
contentEditable={false}
data-component-part="frame-description"
>
<p>{description}</p>
{renderDescription(description)}
</div>
)}
<div
Expand Down