0.3.11 • Published 4 years ago

@spectrum-web-components/tab-list v0.3.11

Weekly downloads
116
License
Apache-2.0
Repository
github
Last release
4 years ago

Description

The <sp-tab-list> component contains set of tab-item elements. This is typically used as the interface for controlling a set of layered sections of content that display one panel of content at a time

Installation

See it on NPM! How big is this package in your project?

npm install @spectrum-web-components/tab-list

# or

yarn add @spectrum-web-components/tab-list

Example

<sp-tab-list selected="1">
    <sp-tab label="Tab 1" value="1" tabindex="1"></sp-tab>
    <sp-tab label="Tab 2" value="2" tabindex="2"></sp-tab>
    <sp-tab label="Tab 3" value="3" tabindex="3"></sp-tab>
    <sp-tab label="Tab 4" value="4" tabindex="4"></sp-tab>
</sp-tab-list>

Vertical

<sp-tab-list selected="1" direction="vertical">
    <sp-tab label="Tab 1" value="1" tabindex="1"></sp-tab>
    <sp-tab label="Tab 2" value="2" tabindex="2"></sp-tab>
    <sp-tab label="Tab 3" value="3" tabindex="3"></sp-tab>
    <sp-tab label="Tab 4" value="4" tabindex="4"></sp-tab>
</sp-tab-list>

Variants

Quiet

<sp-tab-list selected="1" quiet>
    <sp-tab label="Tab 1" value="1" tabindex="1"></sp-tab>
    <sp-tab label="Tab 2" value="2" tabindex="2"></sp-tab>
    <sp-tab label="Tab 3" value="3" tabindex="3"></sp-tab>
    <sp-tab label="Tab 4" value="4" tabindex="4"></sp-tab>
</sp-tab-list>

Compact

<sp-tab-list selected="1" compact>
    <sp-tab label="Tab 1" value="1" tabindex="1"></sp-tab>
    <sp-tab label="Tab 2" value="2" tabindex="2"></sp-tab>
    <sp-tab label="Tab 3" value="3" tabindex="3"></sp-tab>
    <sp-tab label="Tab 4" value="4" tabindex="4"></sp-tab>
</sp-tab-list>

With icons

<div>
    <sp-icons-medium></sp-icons-medium>
    <sp-tab-list selected="1" direction="horizontal">
        <sp-tab label="Tab 1" value="1" tabindex="1">
            <sp-icon slot="icon" size="s" name="ui:CheckmarkSmall"></sp-icon>
        </sp-tab>
        <sp-tab label="Tab 2" value="2" tabindex="2">
            <sp-icon slot="icon" size="s" name="ui:CrossSmall"></sp-icon>
        </sp-tab>
        <sp-tab label="Tab 3" value="3" tabindex="3">
            <sp-icon slot="icon" size="s" name="ui:ChevronDownSmall"></sp-icon>
        </sp-tab>
        <sp-tab label="Tab 4" value="4" tabindex="4">
            <sp-icon slot="icon" size="s" name="ui:HelpSmall"></sp-icon>
        </sp-tab>
    </sp-tab-list>
</div>

Accessibility

When an <sp-tab-list> has a selected value, the <sp-tab> child of that value will be given [tabindex="0"] and will receive initial focus when tabbing into the <sp-tab-list> element. When no selected value is present, the first <sp-tab> child will be treated in this way. When focus is currently within the <sp-tab-list> element, the left and right arrows will move that focus back and forth through the available <sp-tab> children.

0.3.11

4 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.8-alpha.1

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago