Skip to content

Commit 8c56966

Browse files
Add an example of a select with a hint (#232)
1 parent 4cdd2f5 commit 8c56966

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

stories/Form Elements/Select.stories.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,21 @@ export const SelectWithErrorString: Story = {
7777

7878
name: 'Select With Error (String)',
7979
};
80+
81+
export const SelectWithErrorAndHintString: Story = {
82+
render: function SelectWithErrorAndHintStringRender() {
83+
const [error, setError] = useState<string>('Error message goes here');
84+
return (
85+
<>
86+
<Select error={error} label="Label text goes here" hint="Hint text goes here">
87+
<Select.Option value="1">NHS.UK frontend option 1</Select.Option>
88+
<Select.Option value="2">NHS.UK frontend option 2</Select.Option>
89+
<Select.Option value="3">NHS.UK frontend option 3</Select.Option>
90+
</Select>
91+
<TextInput onChange={(e) => setError(e.currentTarget.value)} value={error} />
92+
</>
93+
);
94+
},
95+
96+
name: 'Select With Error and Hint (String)',
97+
};

0 commit comments

Comments
 (0)