---
title: PriceLockup
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, TokensTable, PropsTable } from '../../src/components'
import { PriceLockup } from '@telus-uds/components-web'
import { PriceLockup 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'

# PriceLockup

<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%3D3339%253A34772" />

```jsx live
<PriceLockup price="19.45" />
```

## Introduction

A component presenting TELUS product pricing information.

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

## Guidance

- small for pricing in product catalogue pages
- medium for pricing in product comparison cards
- large for pricing in banners and promo cards
- topText prop shows additional info above the price
- price prop show monetary value (including decimals separated by ".")
- rateText prop shows month/year unit
- bottomText prop shows additional info below the price with a Divider
- signDirection displays which side the currency should apperar (left, right)
- footnoteLinks shows additional link for context
- Use strikethrough to show price savings comparison
- a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")

### Using with footnotes

```jsx live
function PriceLockupWithFootnotes() {
  const [isOpen, setIsOpen] = useState([false, false, false])
  const handleFootnoteLinkClick = (number) =>
    setIsOpen(Object.assign([...isOpen], { [number - 1]: !isOpen[number - 1] }))
  const handleClose = () => setIsOpen([false, false, false])

  return (
    <>
      <PriceLockup
        strikeThrough
        price="19.45"
        rateText="/month"
        topText="Starting from"
        bottomText="$24.99 after 3 months"
        footnoteLinks={[1, 2, 3]}
        onClickFootnote={handleFootnoteLinkClick}
      />
      <Footnote
        content="Price can change eventually"
        copy="en"
        number={1}
        isOpen={isOpen[0]}
        onClose={handleClose}
      />
      <Footnote
        content="But we will let you know about it"
        copy="en"
        number={2}
        isOpen={isOpen[1]}
        onClose={handleClose}
      />
      <Footnote
        content="In any case, be sure to check our site from time to time"
        copy="en"
        number={3}
        isOpen={isOpen[2]}
        onClose={handleClose}
      />
    </>
  )
}
```

### Custom Currency Symbol

```jsx live
<PriceLockup price="19.45" currencySymbol="Є" signDirection="right" />
```

### Alignment

### Aligned to the `Right`

```jsx live
<PriceLockup
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1]}
  tokens={{ alignItemsText: 'flex-end' }}
/>
```

### Aligned to the `Center`

```jsx live
<PriceLockup
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1]}
  tokens={{ alignItemsText: 'center' }}
/>
```

### Accessibility

When passing "strikethrough" the "a11yText" prop is required, it will override strikethrough price

### Platform considerations

<AvailableOnBoth />

## Props

<PropsTable web={WebDocs} />

## Tokens

<TokensTable web={WebDocs} component="PriceLockup" />

### Custom `dictionary` prop

While `PriceLockup` has a default dictionary for various labels for both `en` and `fr` copy, these messages can be overridden by passing a custom `dictionary` prop as shown in the example below.

:::caution
Should you choose to pass a custom `dictionary` prop, you have to provide all the properties in the dictionary for both `en` and `fr`, otherwise the component will not render as expected as it completely overrides the default dictionary instead of merging.
Keep in mind that in the case of `PriceLockup`, the dictionary options are used to build the aria tag, not to display visible changes on the component.
:::

```jsx live
<PriceLockup
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1]}
  dictionary={{
    en: {
      price: '%{amount} %{currency}',
      priceWithCents: '%{amount} %{currency} and %{cents} cents',
      rate: 'per %{rateText}'
    },
    fr: {
      price: '%{amount} %{currency}',
      priceWithCents: '%{amount} %{currency} et %{cents} centimes',
      rate: 'par %{rateText}'
    }
  }}
  tokens={{ alignItemsText: 'flex-end' }}
/>
```

## Variants

### Strikethrough

```jsx live
<PriceLockup
  strikeThrough
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="$24.99 after 3 months"
  footnoteLinks={[1, 2, 3]}
/>
```

### Micro

```jsx live
<PriceLockup
  size="micro"
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1, 2, 3]}
/>
```

### Small

```jsx live
<PriceLockup
  size="small"
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1, 2, 3]}
/>
```

### Medium

```jsx live
<PriceLockup
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1, 2, 3]}
/>
```

### Large

```jsx live
<PriceLockup
  size="large"
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1, 2, 3]}
/>
```

### RateText Position

```jsx live
<PriceLockup
  price="19.45"
  rateText="/month"
  ratePosition="bottom"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1, 2, 3]}
/>
```

### Price baseline

The baseline variant aligns the price text to the baseline of the container, providing consistent vertical alignment when used alongside other text elements or components. This is particularly useful when displaying pricing information in layouts where text baseline alignment is important for visual consistency.

#### Default

```jsx live
<PriceLockup
  price="19.45"
  rateText="/month"
  topText="Starting from"
  bottomText="BottomText"
  footnoteLinks={[1, 2, 3]}
/>
```

#### Baseline

```jsx live
<PriceLockup
  price="1.5"
  rateText="Gbps"
  topText="Unlimited Data Plan"
  bottomText="Includes 5G access + mobile hotspot"
  footnoteLinks={[1]}
  variant={{ price: 'baseline' }}
  currencySymbol=""
/>
```

## Feedback

<Feedback component="ComponentName" />
