pembuatan component storybook Title
This commit is contained in:
47
front_end_portserver/src/stories/loginPage/Title.stories.tsx
Normal file
47
front_end_portserver/src/stories/loginPage/Title.stories.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Meta, StoryObj } from "@storybook/react";
|
||||
import {Title} from "./Title";
|
||||
|
||||
const meta= {
|
||||
title: 'Title',
|
||||
component: Title,
|
||||
// tags: ['autodocs'],
|
||||
|
||||
argTypes: {
|
||||
value: { control: 'text' }, // Ini untuk mengubah prop value
|
||||
className: { control: 'text' }, // Ini untuk mengubah prop className
|
||||
fontSize: { control: 'text'},
|
||||
},
|
||||
|
||||
}satisfies Meta<typeof Title>
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const CustomTitle: Story = {
|
||||
args:{
|
||||
value : 'Custom Title',
|
||||
className : 'title-4xl',
|
||||
fontSize : "text-xl"
|
||||
},
|
||||
};
|
||||
|
||||
export const CustomTitles: Story = (args: { value: string; className: string | undefined; }) =>(
|
||||
<Title
|
||||
value={args.value}
|
||||
className={args.className}
|
||||
/>
|
||||
)
|
||||
|
||||
CustomTitles.args = {
|
||||
value: 'Port Server',
|
||||
className: 'text-primary-text text-2xl font-bold',
|
||||
}
|
||||
|
||||
|
||||
export const SubTitle: Story = {
|
||||
args:{
|
||||
value : 'Welcome back! Enter your account details',
|
||||
className : 'text-xl text-gray-900'
|
||||
},
|
||||
};
|
||||
28
front_end_portserver/src/stories/loginPage/Title.tsx
Normal file
28
front_end_portserver/src/stories/loginPage/Title.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Label } from "@/components/ui/label"
|
||||
import '../../../app/global.css';
|
||||
|
||||
interface TitleProps {
|
||||
|
||||
value : string;
|
||||
value2 ?: string;
|
||||
className ?: string;
|
||||
fontSize ?: string;
|
||||
}
|
||||
|
||||
export const Title = ({
|
||||
value,
|
||||
value2,
|
||||
className,
|
||||
fontSize,
|
||||
...props
|
||||
|
||||
}: TitleProps ) => {
|
||||
return (
|
||||
<div>
|
||||
<Label className={className} style={{fontSize}} {...props}>{value}</Label>
|
||||
<Label >{value2}</Label>
|
||||
<div className="text-4xl font-black text-gray-900 dark:text-white">Halo Apa kabar semuanya</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user