Skip to content

Commit 61164ee

Browse files
Add text input with button examples
1 parent 81a9d4e commit 61164ee

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

stories/Form Elements/TextInput.stories.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type Meta, type StoryObj } from '@storybook/react-vite';
22

3+
import { Button } from '#components/form-elements/button/Button.js';
34
import { TextInput } from '#components/form-elements/text-input/index.js';
45

56
const meta: Meta<typeof TextInput> = {
@@ -111,3 +112,38 @@ export const WithPrefixAndSuffixAndError: Story = {
111112
width: 5,
112113
},
113114
};
115+
116+
export const WithButton: Story = {
117+
args: {
118+
label: 'What is your NHS number?',
119+
width: 10,
120+
code: true,
121+
inputMode: 'numeric',
122+
spellCheck: false,
123+
formGroupProps: {
124+
afterInput: () => (
125+
<Button secondary small>
126+
Search
127+
</Button>
128+
),
129+
},
130+
},
131+
};
132+
133+
export const WithButtonAndError: Story = {
134+
args: {
135+
label: 'What is your NHS number?',
136+
error: 'Enter NHS number',
137+
width: 10,
138+
code: true,
139+
inputMode: 'numeric',
140+
spellCheck: false,
141+
formGroupProps: {
142+
afterInput: () => (
143+
<Button secondary small>
144+
Search
145+
</Button>
146+
),
147+
},
148+
},
149+
};

0 commit comments

Comments
 (0)