Design system: Forms
See original GitHub issueLet’s create common components for all forms that aims for consistency and accessibility. There are already some components in /src/components/common/forms
.
- Create a single component for field groups (accepts a
label
,isRequired
, andfield
component prop). Required fields get a readable ‘required’ label
This should then render something like:
<div class...>
<label for={id}>{label} <span>Required</span></label>
{children}
</div>
- Create components for common input elements that use that field group. Something like:
const FormInput = ({type, name, label, isRequired, onChange}) => (
<FormGroup label={label} isRequired={isRequired} id={name}>
<input type={text} name={name} id={id} onChange={onChange}/>
</FormGroup>
)
Create one of these for:
-
Regular input field, with configurable
type
prop, i.e.<FormInput type="text">
would render an<input type="text">
in a field group. -
Textarea
-
Radio & checkbox (maybe we just pass an array of values?)
-
We also need to pass events to these as well, let’s do
onChange
for now. There is only one form that monitors inputs. -
Support for half-width form groups
Update forms:
- Volunteer form
- Contact form
- Get involved form
- Search page
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Form – Carbon Design System
A form is a group of related input controls that allows users to provide data or configure options. Overview; Live demo; Formatting; Form...
Read more >Forms - Patterns - Atlassian Design System
Forms are used to get information and guide people with minimal fuss. Designing forms well requires making decisions about structure, sequence, ...
Read more >Form - Goldman Sachs Design System
Form is a set of components that help to systematically layout and build forms. View GSUI Toolkit Documentation (Internal Only) · View in...
Read more >Form | U.S. Web Design System (USWDS) - Digital.gov
Customize accessibly. As you customize these templates, make sure they meet the accessibility guidelines in this introduction and as described for each control....
Read more >Forms - the W3C design system
¶Top tips · Every <input> needs a <label> . · Do not use the placeholder attribute on <input> fields. · Use fixed width...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tiagofsanchez cool! I’m assigning this issue to you and creating a branch preview for your branch.
@kevee, made same progress and should be finishing tonight… did you set up a branch preview? where can I see that? Thank you.