@spectrum-web-components/tab
@spectrum-web-components/tab
npm i @spectrum-web-components/tab
@spectrum-web-components/tab

@spectrum-web-components/tab

Spectrum Web Components

by adobe

0.3.10 (see all)License:Apache-2.0TypeScript:Not Found
npm i @spectrum-web-components/tab
Readme

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"].

VersionTagPublished
0.3.10
latest
3yrs ago
0.3.8-alpha.1
canary
3yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate