input.stories.tsx (1312B)
1 import { Meta, StoryObj } from '@storybook/react'; 2 import Input from './input'; 3 4 const meta: Meta<typeof Input> = { 5 title: 'Fundamentals/Inputs/BasicInput', 6 component: Input, 7 argTypes: { 8 placeholder: { 9 required: true, 10 name: "Placeholder", 11 description: "The Placeholder for the input field. Shown if it is empty.", 12 }, 13 password: { 14 required: false, 15 name: "Password", 16 control: "boolean", 17 defaultValue: false, 18 description: "If the input field takes a password.", 19 }, 20 autoFocus: { 21 required: false, 22 name: "Auto Focus", 23 control: "boolean", 24 defaultValue: false, 25 description: "If the field should be focused automatically.", 26 }, 27 value: { 28 required: true, 29 name: "Value", 30 description: "The current value of the input.", 31 }, 32 onChange: { 33 description: "The onChange handler of the input field.", 34 required: true, 35 }, 36 } 37 }; 38 39 export default meta; 40 type Story = StoryObj<typeof Input>; 41 42 export const Default: Story = { 43 args: { 44 placeholder: "Placeholder", 45 password: false, 46 autoFocus: false, 47 } 48 };