Skip to content

Improve Button Examples #10

@kaseybon

Description

@kaseybon

The Problem:
Currently the only button example in the pattern library demos an anchor tag. This is fine but doesn't represent the full capabilities of the button component.

The Fix:

  1. Update the button component (src/markup/patterns/component/buttons/btn.hbs) to be a button element instead of an anchor tag.
  2. Add a new button link component (src/markup/patterns/component/buttons/btn-link.hbs) that uses an anchor tag. This can be a duplicate of the btn.hbs file as we'll need all of the variants that are in the front matter, just be sure to update the name.
  3. The following documentation should be added to src/markup/patterns/component/buttons/collection.yaml:

    To ensure keyboard accessibility button and anchor elements should be used when appropriate. If clicking the element will take the user to a different location on the page or to a different page, then use an anchor tag. If clicking the element will trigger a Javascript event, then use a button element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions