Skip to content

Commit

Permalink
Add an example of a select with a hint (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhorsford authored Jun 11, 2024
1 parent 4cdd2f5 commit 8c56966
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions stories/Form Elements/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,21 @@ export const SelectWithErrorString: Story = {

name: 'Select With Error (String)',
};

export const SelectWithErrorAndHintString: Story = {
render: function SelectWithErrorAndHintStringRender() {
const [error, setError] = useState<string>('Error message goes here');
return (
<>
<Select error={error} label="Label text goes here" hint="Hint text goes here">
<Select.Option value="1">NHS.UK frontend option 1</Select.Option>
<Select.Option value="2">NHS.UK frontend option 2</Select.Option>
<Select.Option value="3">NHS.UK frontend option 3</Select.Option>
</Select>
<TextInput onChange={(e) => setError(e.currentTarget.value)} value={error} />
</>
);
},

name: 'Select With Error and Hint (String)',
};

0 comments on commit 8c56966

Please sign in to comment.