-
Notifications
You must be signed in to change notification settings - Fork 843
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
Skip links component #2356
Comments
The Kibana Core UI team has an issue to add a 'Skip to content' link which is a rather fundamental accessibility feature, so I'm considering tackling this issue. First, a few questions :)
This seems sufficient for addressing the immediate need and is likely all we would need for some time. Given that...
This makes sense to me given it should be used by Kibana, Cloud, Dream Machine, etc. Presuming others agree with the above, then my question would be how should we build this in EUI? Michail lists some alternatives above and I can see it either being a new type on What do you all think? |
I would propose a different solution as I think about how consumers might try to find, or consume this type of component. We already have In the docs, we can showcase an example for using it as a "skip links" button specifically and the EuiNavDrawer can offer a quick prop like |
If we repurpose |
Just remember that because of the wide usages of EUI and such a major component as That being said, for this particular component I do still think the current name is appropriate since only keyboard users can access focus only elements and, right or wrong, I think most consumers equate this functionality with those who use assistive technology such as screen readers. |
Can always do both. Can just be a prop on |
+1 the 'do both' approach. I've got something close to working on the Kibana side that I can convert over. |
To keep in in the same home, I can add an example to Utilities > Accessibility page as opposed to having it appear as a new component in the main list. Does that work? It may make sense on the nav/header examples, as Caroline noted, or we could use it on the EUI docs site itself :) |
I"m fine with a more component specific component that extends EuiScreenReaderOnly. But just to be clear in case someone take this up, I'd recommend something like |
Errr, I re-read that and the naming is still wrong lol, more like |
That makes sense. |
Caroline and I talked off GitHub just cuz back-and-forth can be tricky here. Anyway... It seemed like having So we're proposing to go instead with @cchaos chime in if I got anything wrong! |
Proposal
A skip link is an anchor with a target on the same page as the user to let them skip ahead over some content that's usually repeated across pages and particularly tab heavy. Most commonly, these will be used as the first tabbable element on a page to let users skip over the page navigation to go to the main content.
Future enhancements
To start off, I think a single element that's visually hidden that appears when receives focus is all we need and works both as first tab stop on a page to skip to main content but also anywhere on a page where a skip link might be helpful.
In the future, we might want to create a more elaborate skip link for a first tab stop on a page which a dedicated component leaves the door open for. However, I don't imagine this option being particularly urgent or high value for us right now.
Examples
Github has a basic, bare bones example:
Starbucks has a simple, well styled, and somewhat more advanced versions:
Facebook really stretches the meaning of a skip link which a whole skip link section which, I found, frankly hard to use:
Alternatives
I don't think this is a good option because I think EUI is a better place to control the design of skip links. Also, as all apps, not just Kibana, should use skip links, it'd probably lead to code duplication.
EuiLink
Though these render as an
<a>
tag, they're visually, often, similar to buttons which can lead to developer confusion on which component they need to reach for.EuiButton
Though these often are visually similar to buttons, they don't necessarily have to be and the have the semantics of an
<a>
tag which can lead to developer confusion on which component they should reach for.More words by others
The text was updated successfully, but these errors were encountered: