Skip to content
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

Implement radio group component #7

Closed
5 tasks
ezhangy opened this issue Sep 20, 2024 · 0 comments · Fixed by #9
Closed
5 tasks

Implement radio group component #7

ezhangy opened this issue Sep 20, 2024 · 0 comments · Fixed by #9
Assignees

Comments

@ezhangy
Copy link
Collaborator

ezhangy commented Sep 20, 2024

Implement the radio group component as a Stencil web component.

Link to component design in Figma.

Note: This issue only covers both the implementation of the individual button (i.e. a single <input> element) and the component (i.e. a <fieldset> element containing multiple <njwds-radio> elements).

Radio

Properties

Property Type Default Notes
inputId string null sets the internal <input> element's id attribute
value string null sets the internal <input> element's value attribute

Slots

Slot Description
default slot The label of the radio

Radio Group

Properties

Property Type Default Notes
name string null the name associated with the radio group
tile boolean false whether the radio group should display as the tile variant
defaultValue string null the default value that should be checked
required boolean false A value must be checked for the form to be submittable

Slots

Slot Description
default slot <njwds-radio> elements that should be part of the group
legend The legend for the radio group (rendered inside a <legend> element)

Questions

  • Are there any other properties, especially ARIA attributes, that we should include?
  • Are there any events that should be emitted by the component? (The Shoelace implementation emits an event for when the control gains/loses focus)
  • Should we provide the checked or required attribute? Or should this be handled by the radio group component instead?

Tasks

@ezhangy ezhangy self-assigned this Sep 20, 2024
@ezhangy ezhangy changed the title Implement radio button component Implement radio group component Sep 20, 2024
@ezhangy ezhangy linked a pull request Oct 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant