From e0aaaa2aa806d9ea4d786bd01ed074baddf8a176 Mon Sep 17 00:00:00 2001 From: Ed Horsford Date: Mon, 10 Jun 2024 15:53:38 +0100 Subject: [PATCH] Add an example of using a input as a page heading (#221) * Add an example of using a hint as a page heading by @edwardhorsford --- stories/Form Elements/TextInput.stories.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/stories/Form Elements/TextInput.stories.tsx b/stories/Form Elements/TextInput.stories.tsx index 620c92a5..7758511f 100644 --- a/stories/Form Elements/TextInput.stories.tsx +++ b/stories/Form Elements/TextInput.stories.tsx @@ -7,7 +7,7 @@ const meta: Meta = { args: { id: 'input-example', name: 'test-name', - label: 'National Insurance Number', + label: 'National Insurance number', }, argTypes: { inputRef: { table: { disable: true } }, @@ -24,6 +24,23 @@ export const WithHintText: Story = { }, }; +export const AsPageHeading: Story = { + args: { + labelProps: { + isPageHeading: true, + size: "l" + }, + hint: 'It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.', + }, + parameters: { + docs: { + description: { + story: 'To be used when the input label should also be a page heading - such as when it is the main question on a page.' + } + } + } +}; + export const WithErrorBoolean: Story = { args: { error: true,