Skip to content

Commit

Permalink
Adds accessibility section to Banner regarding focus management (#2577)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseywild authored Feb 9, 2024
1 parent c195fc5 commit 6a3071d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-apes-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Adds documentation for the Rails Banner and focus management guidance
7 changes: 7 additions & 0 deletions app/components/primer/alpha/banner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
module Primer
module Alpha
# Use `Banner` to highlight important information.
#
# @accessibility
# Depending on the scenario, some Banners may need to receive focus when they appear. This helps to maximize discoverability of the message, especially in critical scenarios. Visit the [Banner's Accessibility section](https://primer.style/components/banner#accessibility) or defer to the accessibility team to determine if your scenario requires focusing the banner.
#
# To properly focus a banner, add a `tabindex="-1"` to the Banner container, and focus that container (one way is using the [`focus()` API](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus)).
#
# For more information about the focus management technique, visit the [Accessible Banner Prototype docs](https://github.com/github/accessibility/blob/main/docs/coaching-recommendations/toast-flash-banner/accessible-banner-prototype.md#consideration). This guidance is subject to change.
class Banner < Primer::Component
status :alpha

Expand Down

0 comments on commit 6a3071d

Please sign in to comment.