Tabs [21]
I'm working on a project that will be delivered in 06 and it requires tabs.
The SLDS component can be found at https://latest-204.lightningdesignsystem.com/components/tabs.
@jamin-hall
Heya @kwilloughby in an effort to get exactly what you need created faster, I propose we put only exactly what you're after into place first, and iterate on that.
Which of these do you need first?
- [ ] Default
- [ ] Default - Overflowing items
- [ ] Default - With Nested Scoped Tabs
- [ ] Scoped
- [ ] Scrolling
- [ ] Scrolling - Scoped
Default

Default - Overflowing items

Default - With Nested Scoped Tabs

Scoped

Scrolling

Scrolling - Scoped

I agree. We need "Default" (the 1st one) for the specific project I'm working on.
On it.
@pixelprodotco, Chris Corwin is working on the tabs control. Just wanted to provide an update.
@chriscorwin
Scope of tabs
- Allow app dev to make array of tabsItems that can be be created by app and passed in as children.
<Tabs id="mom" {...props}>
<TabItem active label="One">Tab One panel contents</TabItem>
<TabItem label="Two">Tab Two panel contents</TabItem>
</Tabs>
- TabItem should accept an
hrefsince this is navigation, but it will bepreventedifonClickis present. - Allow active tab to be set by parent component
onClickshould pass out an event and an object with { href: props.href } or maybe all the props of the TabItem so devs could pass an id back to themselves?- component should be controlled/stateless (fat arrow, pure function)
- component should accept
className - each TabItem should accept
className - label should accept string or a node (to allow for tooltips)
- all props should have a test associated with them
if you have time:
- component should have a
scopedprop that is aboolean(we might want to have an example of scoped inside non-scoped in the storybook, if it's easy)
Future features:
- overflow (pass in length prop)
- scrolling ( we might introduce state for this, not sure yet)
Accessibility stuff:
- Tabs should have an application-like ARIA role or tablist and function like a
tablist. Details: https://www.w3.org/TR/wai-aria/roles#tablist This means id probably needs to be required to associate tabs and panels (feel free to suffix with__panelor something. - working example: http://accessibility.athena-ict.com/aria/examples/tabpanel2.shtml
- if this is a controlled component, then we'd need something like an
onChangecallback to tell the app which one is selected and then change focus.
@chriscorwin I think I've made a mistake in my scope above. With tree for instance you shouldn't be able to tab between the nodes. You probably shouldn't here either. It should be left/right or with the mouse. More like this example: http://a11y.nicolas-hoffmann.net/tabs/#robust_accessible
Tab - only the active tab is in the tab order
from https://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#tabpanel It looks like you are discovered this though, so no change needed to your PR for this mistake by me.
Although, even that link is a working draft I believe.