@rgrmdesign/ds-components-html
v0.1.0
Published
HTML snippets for Design System components. No JavaScript—markup only.
Readme
@rgrmdesign/ds-components-html
HTML snippets for Design System components. No JavaScript—markup only.
- Use the same
.ds-*classes as the React components; styling comes from @rgrmdesign/ds-styles. - In your app: install
@rgrmdesign/ds-stylesand import its CSS (e.g.import '@rgrmdesign/ds-styles'or link the bundle), then copy-paste or generate these snippets.
A11y
- Label ↔ input: Always use a
<label>withformatching the inputid. - Help / error: Give help and error elements stable
ids and set the input’saria-describedbyto those ids (space-separated if both). - Invalid: Set
aria-invalid="true"on the input when there is a validation error; pair withrole="alert"on the error message.
Snippets
snippets/button.html– Button variants and statessnippets/input.html– Input with label and help/errorsnippets/form-field.html– FormField (label + input + help/error)
