---
title: Span
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, PropsTable, TokensTable } from '../../src/components'
import { Span as WebDocs } from 'docs/@telus-uds/components-web'
import AvailableOnWebOnly from '../../partials/_platform-considerations-web-only.mdx'

# Span

<LibraryInfo
  packageType="Web Component"
  figmaLink="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2F4zJn2Qn6uXOqPP1GVDipy6%2F%25F0%259F%258D%2580-Allium-Components%3Fnode-id%3D7549%253A149618"
/>

```jsx live
<Span>Our commitment to service is demonstrated in everything we do.</Span>
```

## Introduction

`Span` renders text as a HTML `<span>` element, using styles based on Typography's theme tokens and variants.

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

## Guidance

`Span` should be used rarely, in cases where a theme-styled inline HTML `<span>` element is precisely needed. For example, Span may be used to integrate with third-party libraries that expect a particular child to be a HTML `span`.

For other cases:

- Body text on Web should use [`Paragraph`](paragraph).
- Other text should use [`Typography`](typography), which can render other inline text tags like `strong` or `dd` using its `tag` prop.

### Accessibility

No accessibility notes.

### Platform considerations

<AvailableOnWebOnly />

See [Typography](typography) for cross-platform themed text. This uses React Native's `<Text>`, which on web renders an inline `div`, or a `span` only if nested inside another `<Text>`.

## Props

<PropsTable web={WebDocs} />

### `flex`

Span renders with `<span>`'s default `inline` display. If Span is used with children that expect to be laid out using the flex model, `flex` may be passed to set the Span to `display: inline-flex;`.

## Tokens

As Span uses the Typography theme, it accepts the same [tokens as Typography](typography#tokens).

<TokensTable base={WebDocs} component="Typography" />

## Variants

Span has the exact same variants as Typography. See [Typography variant documentation](typography) for details.

## Feedback

<Feedback component="Span" />
