Skip to content

Commit

Permalink
docs(Textarea): update stories with label for attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikbacker committed Oct 9, 2024
1 parent 7251b18 commit eaaa617
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/react/src/components/form/Textarea/Textarea.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ export const Preview: Story = {
readOnly: false,
size: 'md',
cols: 40,
id: 'my-textarea',
},
render: (args) => (
<>
<Label>Label</Label>
<Label htmlFor={args.id}>Label</Label>
<Textarea {...args} />
</>
),
Expand All @@ -63,13 +64,14 @@ export const FullWidth: Story = {
args: {
rows: 10,
cols: 40,
id: 'my-textarea',
},
parameters: {
layout: 'padded',
},
render: (args) => (
<>
<Label>Label</Label>
<Label htmlFor={args.id}>Label</Label>
<Textarea {...args} />
</>
),
Expand All @@ -81,7 +83,7 @@ export const Controlled: StoryFn<typeof Textarea> = (args) => {
return (
<>
<Paragraph>Du har skrevet inn: {value}</Paragraph>
<Label>Kontroller meg!</Label>
<Label htmlFor={args.id}>Kontroller meg!</Label>
<Textarea
cols={40}
onChange={(e) => setValue(e.target.value)}
Expand All @@ -92,3 +94,7 @@ export const Controlled: StoryFn<typeof Textarea> = (args) => {
</>
);
};

Controlled.args = {
id: 'my-textarea',
};

0 comments on commit eaaa617

Please sign in to comment.