---
title: CarouselTabs
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, TokensTable, PropsTable } from '../../src/components'
import { CarouselTabs } from '@telus-uds/components-web'
import { CarouselTabs as BaseDocs } from 'docs/@telus-uds/components-base'
import AvailableOnBoth from '../../partials/_platform-considerations-both.mdx'
import NoStylisticVariants from '../../partials/_variants-none.mdx'

# CarouselTabs

<LibraryInfo figmaLink="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FTkOGIVaatADU8fDgNEA3GW%2FAllium-Community-Components-Work-in-Progress%3Fnode-id%3D2286%253A43925" />

:::warning

### Deprecated for Carousel with tabs prop

The CarouselTabs component is deprecated and should not be used. It may be removed in a future release.

The same UX pattern of a [Carousel with tabs](carousel#tabs-navigation) may now be achieved using the Carousel component's props `tabs` and `children`.

Responsive behaviour of whether to show the tabs panel or default step tracker is set automatically, using the theme's `showPanelTabs` token.
:::

```jsx live
<CarouselTabs
  itemLabel="offer"
  title="summer offers"
  items={[
    {
      title: 'Home bundle for $105/month',
      content: (
        <CarouselItem>
          <Box space={3} bottom={9}>
            <FlexGrid>
              <FlexGridCol>
                <FlexGridCol flex xs={12} lg={6}>
                  <StackView space={3}>
                    <Typography variant={{ size: 'h2' }}>
                      Get Internet, Optik TV+, SmartHome Security - starting at $105/month.
                    </Typography>
                    <Typography>
                      Whole Home Bundle helps keep your family connected, entertained, and secure.
                    </Typography>
                    <Button variant={{ priority: 'high' }}>Shop bundles</Button>
                  </StackView>
                </FlexGridCol>
                <FlexGridCol flex xs={12} lg={6}>
                  <img src="/universal-design-system/img/pigs-allium-lo.png" />
                </FlexGridCol>
              </FlexGridCol>
            </FlexGrid>
          </Box>
        </CarouselItem>
      )
    },
    {
      title: '$840 off TV & internet bundles',
      content: (
        <CarouselItem>
          <Box vertical={6}>
            <FlexGrid>
              <FlexGridCol>
                <FlexGridCol flex xs={12} lg={6}>
                  <img src="/universal-design-system/img/pigs-allium-lo.png" />
                </FlexGridCol>
                <FlexGridCol flex xs={12} lg={6}>
                  <StackView space={3}>
                    <Typography variant={{ size: 'h2' }}>
                      TV and Internet bundles - for up to $840 less!
                    </Typography>
                    <Typography>
                      Get the all the quality content you need for a fraction of the price.
                    </Typography>
                    <Button variant={{ priority: 'high' }}>Shop bundles</Button>
                  </StackView>
                </FlexGridCol>
              </FlexGridCol>
            </FlexGrid>
          </Box>
        </CarouselItem>
      )
    },
    {
      title: 'Save big with the TELUS Family Discount',
      content: (
        <CarouselItem>
          <StackView space={3} tokens={{ alignItems: 'center' }}>
            <img src="/universal-design-system/img/pigs-allium-lo.png" />
            <Typography variant={{ size: 'h2' }} tokens={{ alignSelf: 'center' }}>
              Are you eligible for family-sized savings?
            </Typography>
            <Typography>You could save BIG with the TELUS Family Discount.</Typography>
            <Box>
              <ChevronLink>Find out now</ChevronLink>
            </Box>
          </StackView>
        </CarouselItem>
      )
    }
  ]}
/>
```

## Introduction

```jsx
import { CarouselTabs } from '@telus-uds/components-web'
```

CarouselTabs is a preset for [Carousel](carousel) designed for content-rich slides.

[Follow the appropriate instructions](importing-components) to add this component in to your app.

## Guidance

:::caution
Though CarouselTabs has been built to mitigate some of the accessibility and usability concerns associated with Carousels, some remain:

- On small-screen devices, CarouselTabs includes content that is hidden from the customer’s view, and it is very likely they will not see that content
- On larger-screen devices, CarouselTabs items after the first have relatively low prominence on the page
- Carousel items have a low click-through rate
- Carousels are often skipped entirely by customers

:::

CarouselTabs control carousel slides with tabs that summarise the content and are always visible on larger screen devices.

This makes them more suitable for rich-content presentations, as relavant tabs can be more easily noticed.

However, general warnings and guidelines for carousels still apply:

- Use a carousel when other alternatives have been exhausted
  - Users often overlook and scroll past carousel
  - Users often miss content after the first slide
  - Key points or messages can be missed or misinterpreted if they span multiple slides
- Use a carousel for the following considerations
  - Location is a priority and there is limited space
  - Provide supplemental content without disrupting the main objective
- Display content in order of priority and relevance
- Must not display content integral to the main objective
- Avoid showing more than 3 panels
- Avoid showing more than 4 slides of full content
- Avoid automatically switching between slides without a user interaction

### Skip links

CarouselTabs contain more focusable elements than a regular carousel. They have built-in support for SkipLink so that users navigating by focus can more easily skip the carousel, or bail from it after selecting a slide.

Simply pass `skipLinkHref` with an anchor link to an ID after the carousel.

```jsx live
<StackView space={6}>
  <CarouselTabs
    skipLinkHref="#after-offers"
    itemLabel="offer"
    title="summer offers"
    items={[
      {
        title: 'Home bundle for $105/month',
        content: (
          <CarouselItem>
            <Box space={3} bottom={9}>
              <FlexGrid>
                <FlexGridCol>
                  <FlexGridCol flex xs={12} lg={6}>
                    <StackView space={3}>
                      <Typography variant={{ size: 'h2' }}>
                        Get Internet, Optik TV+, SmartHome Security - starting at $105/month.
                      </Typography>
                      <Typography>
                        Whole Home Bundle helps keep your family connected, entertained, and secure.
                      </Typography>
                      <Button variant={{ priority: 'high' }}>Shop bundles</Button>
                    </StackView>
                  </FlexGridCol>
                  <FlexGridCol flex xs={12} lg={6}>
                    <img src="/universal-design-system/img/pigs-allium-lo.png" />
                  </FlexGridCol>
                </FlexGridCol>
              </FlexGrid>
            </Box>
          </CarouselItem>
        )
      },
      {
        title: '$840 off TV & internet bundles',
        content: (
          <CarouselItem>
            <Box vertical={6}>
              <FlexGrid>
                <FlexGridCol>
                  <FlexGridCol flex xs={12} lg={6}>
                    <img src="/universal-design-system/img/pigs-allium-lo.png" />
                  </FlexGridCol>
                  <FlexGridCol flex xs={12} lg={6}>
                    <StackView space={3}>
                      <Typography variant={{ size: 'h2' }}>
                        TV and Internet bundles - for up to $840 less!
                      </Typography>
                      <Typography>
                        Get the all the quality content you need for a fraction of the price.
                      </Typography>
                      <Button variant={{ priority: 'high' }}>Shop bundles</Button>
                    </StackView>
                  </FlexGridCol>
                </FlexGridCol>
              </FlexGrid>
            </Box>
          </CarouselItem>
        )
      },
      {
        title: 'Save big with the TELUS Family Discount',
        content: (
          <CarouselItem>
            <StackView space={2} tokens={{ alignItems: 'center' }}>
              <img src="/universal-design-system/img/pigs-allium-lo.png" />
              <Typography variant={{ size: 'h2' }} tokens={{ alignSelf: 'center' }}>
                Are you eligible for family-sized savings?
              </Typography>
              <Typography>You could save BIG with the TELUS Family Discount.</Typography>
              <Box>
                <ChevronLink>Find out now</ChevronLink>
              </Box>
            </StackView>
          </CarouselItem>
        )
      }
    ]}
  />
  <Spacer />
  <Typography nativeID="after-offers" block tag="h2" variant={{ size: 'h2' }}>
    Next section heading
  </Typography>
  <Typography>Some content in the next section.</Typography>
  <Typography>A user might want to skip to this.</Typography>
</StackView>
```

### Accessibility

When implementing the carousel, take care to ensure the component is accessible.

- Supply `itemLabel` prop so screenreader users understand what each slide represents
- Supply `title` prop to explain what the whole block represents

Be aware that the tabs are not shown at all on smaller screen sizes. Never use carousels for vital content that users must notice.

### Platform considerations

<AvailableOnBoth />

## Props

<PropsTable base={BaseDocs} />

## Tokens

<TokensTable base={BaseDocs} component="Carousel" />

## Variants

<NoStylisticVariants />

## Feedback

<Feedback component="CarouselTabs" />
