feat: add storybook for PageHeader component (#2906)

Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com>
This commit is contained in:
TUSHAR JINDAL
2024-07-31 13:43:45 +05:30
committed by GitHub
parent 6d6401d1da
commit c37ea3fbb6
2 changed files with 55 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import { cn } from "@formbricks/lib/cn";
interface PageHeaderProps {
export interface PageHeaderProps {
pageTitle: string;
cta?: React.ReactNode;
children?: React.ReactNode;
+54
View File
@@ -0,0 +1,54 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "../v2/Button";
import { PageHeader } from "./index";
const meta = {
title: "ui/PageHeader",
component: PageHeader,
tags: ["autodocs"],
parameters: {
docs: {
description: {
component: `
The **PageHeader** component is used to provide a styled header section for a page. It includes a title and optional call to action (CTA) button. Additional content can be included below the header.
`,
},
},
},
argTypes: {
cta: { control: "text" },
children: { control: "text" },
},
} satisfies Meta<typeof PageHeader>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
pageTitle: "Page Title",
cta: <Button>Call to Action</Button>,
children: <p className="text-slate-600">This is some additional content below the header.</p>,
},
};
export const TitleOnly: Story = {
args: {
pageTitle: "Page Title",
},
};
export const WithCTA: Story = {
args: {
pageTitle: "Page Title",
cta: <Button>Call to Action</Button>,
},
};
export const WithChildren: Story = {
args: {
pageTitle: "Page Title",
children: <p className="text-slate-600">This is some additional content below the header.</p>,
},
};