0.3.10 • Published 4 years ago

@spectrum-web-components/tab v0.3.10

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

Description

The <sp-tab> component is intended to be the child of an <sp-tab-list> element and accepts both a label attribute and a [slot="icon"] child to define its contents. Those contents can be further customized with the vertical attribute which stacks them in the UI rather than listing them in a row.

Installation

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

npm install @spectrum-web-components/tab

# or

yarn add @spectrum-web-components/tab

Example

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

Variants

Icon

<sp-icons-medium></sp-icons-medium>
<sp-tab label="Tab 1" value="1">
    <sp-icon slot="icon" size="s" name="ui:CheckmarkSmall"></sp-icon>
</sp-tab>

Vertical w/ icon

<sp-tab label="Tab 1" value="1" vertical>
    <sp-icon slot="icon" size="s" name="ui:CheckmarkSmall"></sp-icon>
</sp-tab>

Accessibility

By default, an <sp-tab> element has [tabindex="-1"] so that it can be focused programmatically. When an <sp-tab> element is [selected] or isthe first <sp-tab> in an <sp-tab-list> element with no selected value, it will be given [tabindex="0"].

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.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.5

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