26 lines
625 B
TypeScript
26 lines
625 B
TypeScript
import type { Meta, StoryObj } from "@storybook/react";
|
|
import { Input, Label } from "../src/index.js";
|
|
|
|
const meta = {
|
|
title: "Basic/Label",
|
|
component: Label,
|
|
tags: ["autodocs"],
|
|
args: {
|
|
children: "字段名称",
|
|
},
|
|
} satisfies Meta<typeof Label>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Default: Story = {};
|
|
|
|
export const WithInput: Story = {
|
|
render: () => (
|
|
<div className="grid w-[280px] gap-2">
|
|
<Label htmlFor="email">邮箱</Label>
|
|
<Input id="email" type="email" placeholder="input@example.com" />
|
|
</div>
|
|
),
|
|
};
|