---
title: Footnote
---

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

# Footnote

<LibraryInfo 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
function FootnoteExample() {
  const [isOpen, setIsOpen] = useState(false)
  const handleFootnoteLinkClick = () => setIsOpen(!isOpen)
  const handleClose = () => setIsOpen(false)

  return (
    <>
      <Footnote.Link number={1} onClick={handleFootnoteLinkClick} />
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={isOpen}
        onClose={handleClose}
      />
    </>
  )
}
```

## Introduction

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

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

## Guidance

- Use Footnote to display a single legal statement
- Display on top of all UI, including other sticky elements such as Cart Summary
- Dismiss by clicking on the close button, clicking anywhere outside of the Footnote, or by pressing the ESC key
- Responsive display based on breakpoints
- Use copy to set language, `'en'` for English or `'fr'` for French
- Follow the [TELUS brand recommendations on applying legal annotations](https://www.telus.com/en/brand-resources/guides/legal-annotations)
- Use Footnote.Link to activate the footnote:

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      Use Footnote.Link
      <Footnote.Link number={1} onClick={handleFootnoteLinkClick(1)} /> to activate the corresponding
      footnote.
      <Footnote.Link number={2} onClick={handleFootnoteLinkClick(2)} />
      <Footnote
        content="You can have multiple footnote links on the same page."
        copy="en"
        number={1}
        isOpen={openFootnote === 1}
        onClose={handleFootnoteClose}
      />
      <Footnote
        content="Each footnote link has to open the corresponding footnote."
        copy="en"
        number={2}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

### Custom JSX for `content` prop

The default behavior of `content` prop is to render a passed string value as a list. However, certain situations may require the passing of a custom JSX node as `content`.

```jsx live
function FootnoteExample() {
  const [isOpen, setIsOpen] = useState(false)
  const handleFootnoteLinkClick = () => setIsOpen(!isOpen)
  const handleClose = () => setIsOpen(false)

  return (
    <>
      <Footnote.Link number={1} onClick={handleFootnoteLinkClick} />
      <Footnote
        content={
          <div>
            <Typography>
              A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS
              team member to process your activation or renewal along with other exclusive TELUS
              services.
            </Typography>
          </div>
        }
        copy="en"
        number={1}
        isOpen={isOpen}
        onClose={handleClose}
      />
    </>
  )
}
```

### Custom `dictionary` values

`Footnote` has a default dictionary with the following schema and values:

```json
{
  "en": {
    "a11yLabel": "Read legal footnote",
    "close": "close",
    "heading": "Terms and conditions"
  },
  "fr": {
    "a11yLabel": "Lire la note de bas de page légale",
    "close": "fermer",
    "heading": "Modalités et conditions"
  }
}
```

However, `dictionary` prop can be passed to override the default values. Note that when you override the default `dictionary` by passing the prop value, it has to be a complete object fulfilling the schema defined above, both for `en` and `fr`.

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      Use Footnote.Link
      <Footnote.Link number={1} onClick={handleFootnoteLinkClick(1)} /> to activate the corresponding
      footnote.
      <Footnote.Link number={2} onClick={handleFootnoteLinkClick(2)} />
      <Footnote
        content="You can have multiple footnote links on the same page."
        copy="en"
        dictionary={{
          en: {
            a11yLabel: 'Access the legal footnote',
            close: 'Close this window',
            heading: 'Terms of Service'
          },
          fr: {
            a11yLabel: 'Accéder à la note de bas de page légale',
            close: 'Fermer cette fenêtre',
            heading: "Conditions d'utilisation"
          }
        }}
        number={1}
        isOpen={openFootnote === 1}
        onClose={handleFootnoteClose}
      />
      <Footnote
        content="Chaque lien de note de bas de page doit ouvrir la note correspondante."
        copy="fr"
        dictionary={{
          en: {
            a11yLabel: 'Access the legal footnote',
            close: 'Close this window',
            heading: 'Terms of Service'
          },
          fr: {
            a11yLabel: 'Accéder à la note de bas de page légale',
            close: 'Fermer cette fenêtre',
            heading: "Conditions d'utilisation"
          }
        }}
        number={2}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

### Accessibility

- Only one instance of Footnote should display at a time
- Place Footnote as the last element in the body or main
- When Footnote is open, the inert prop must be set on all children of body excluding the Footnote
- When Footnote is closed, focus must return to the initiating element

### Platform considerations

<AvailableOnBoth />

## Props

### Footnote

<PropsTable web={WebDocs} base={BaseDocs} />

### Footnote.Link

<PropsTable web={WebDocs.Link} base={BaseDocs.Link} />

## Tokens

<TokensTable web={WebDocs} base={BaseDocs} component="Footnote" />

## Variants

#### Display 1

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'display1' }}>
        FootnoteLink
        <Footnote.Link
          number={2}
          variant={{ size: 'display1' }}
          onClick={handleFootnoteLinkClick(2)}
        />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### Display 2

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'display2' }}>
        FootnoteLink
        <Footnote.Link
          number={2}
          variant={{ size: 'display2' }}
          onClick={handleFootnoteLinkClick(2)}
        />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### H1

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'h1' }}>
        FootnoteLink
        <Footnote.Link number={2} variant={{ size: 'h1' }} onClick={handleFootnoteLinkClick(2)} />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### H2

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'h2' }}>
        FootnoteLink
        <Footnote.Link number={2} variant={{ size: 'h2' }} onClick={handleFootnoteLinkClick(2)} />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### H3

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'h3' }}>
        FootnoteLink
        <Footnote.Link number={2} variant={{ size: 'h3' }} onClick={handleFootnoteLinkClick(2)} />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### H4

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'h4' }}>
        FootnoteLink
        <Footnote.Link number={2} variant={{ size: 'h4' }} onClick={handleFootnoteLinkClick(2)} />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### H5

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'h5' }}>
        FootnoteLink
        <Footnote.Link number={2} variant={{ size: 'h5' }} onClick={handleFootnoteLinkClick(2)} />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

#### H6

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      <Typography variant={{ size: 'h6' }}>
        FootnoteLink
        <Footnote.Link number={2} variant={{ size: 'h6' }} onClick={handleFootnoteLinkClick(2)} />
      </Typography>
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

### Body

#### Default Styles

```jsx live
function FootnoteLinkExample() {
  const [openFootnote, setOpenFootnote] = useState(null)
  const handleFootnoteLinkClick = (footnoteNumber) => () => setOpenFootnote(footnoteNumber)
  const handleFootnoteClose = () => setOpenFootnote(null)

  return (
    <>
      FootnoteLink
      <Footnote.Link number={2} variant={{ size: 'large' }} onClick={handleFootnoteLinkClick(2)} />
      <Box top={4} bottom={4}>
        <Divider variant={{ decorative: true }} />
      </Box>
      FootnoteLink
      <Footnote.Link number={2} variant={{ size: 'medium' }} onClick={handleFootnoteLinkClick(2)} />
      <Box top={4} bottom={4}>
        <Divider variant={{ decorative: true }} />
      </Box>
      FootnoteLink
      <Footnote.Link number={2} variant={{ size: 'small' }} onClick={handleFootnoteLinkClick(2)} />
      <Box top={4} bottom={4}>
        <Divider variant={{ decorative: true }} />
      </Box>
      FootnoteLink
      <Footnote.Link number={2} variant={{ size: 'micro' }} onClick={handleFootnoteLinkClick(2)} />
      <Footnote
        content="A $35 connection fee applies per line. Fee includes a SIM card and access to a TELUS team member to process your activation or renewal along with other exclusive TELUS services."
        copy="en"
        number={1}
        isOpen={openFootnote === 2}
        onClose={handleFootnoteClose}
      />
    </>
  )
}
```

## Feedback

<Feedback component="Footnote" />
