-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
website: Update input documentation & demos #1180
Conversation
FlyersPh9
commented
Mar 31, 2023
- Add input demos for the different options.
- Update documentation, include adding hyperlinks to other mentioned components.
<AllExamples.InputInputExample client:load /> | ||
</LiveExample> | ||
|
||
Use `<Input>` when all that is needed is a text field with no label, hint text, or status. In most scenarios we strongly recommend an input being paired with a label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In most scenarios" is not right. Really we want it to be all scenarios. It's an accessibility requirement.
The use case for <Input>
(over <LabeledInput>
) is when using a separate <Label>
or a hidden label (either using <VisuallyHidden>
or aria-label
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing that logic, I'm not sure it makes sense to separate these two components as "variants". Instead, we could assume <LabeledInput>
throughout the page, and then have a section (under Usage) for a "Standalone input".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the "In most scenarios" and explicitly stated that a label is an accessibility requirement. I've also removed variants and added a standalone section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most search inputs don't have a label, does search somehow get an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the input has other contextual hints to help the user enter the right text (e.g. a search icon in the case of a search input, then a visible label can be omitted, but there still needs to be a hidden label. This hidden label could be associated using aria-labelledlby
or <label>
+ VisuallyHidden
for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know, I'll try using <label>
+ VisuallyHidden
on the search boxes in the demo pages of #1073.
Co-authored-by: Mayank <[email protected]>
Co-authored-by: Mayank <[email protected]>
There are some merge conflicts. |