---
title: TextButton
---

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

# TextButton

<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%3D405%253A201" />

```jsx live
<TextButton onPress={() => alert('Hello world!')}>Click me</TextButton>
```

## Introduction

TextButton is a component with the visual appearance of a link, but the semantics/behaviour of a button.

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

## Guidance

Use TextButton for simple actions within the current page. The result of the action is clear from the label to avoid confusion with Links.

### Alternatives

**Do not** use TextButton for:

- Actions that represent a major part of a user's action flow: consider [Button](Button)
- Choices presented as calls to action: consider [ButtonLink](ButtonLink)
- One navigation action that represents the user's logical next step: consider [ChevronLink](ChevronLink)
- Links that navigate to another page: consider [Link](Link)

For TextButtons that show and hide a collapsible section of (web) content, consider [ExpandCollapseMini](ExpandCollapseMini)

### Accessibility

Insert [A11yText](a11y-text) any time an interactive element's label lacks context
that a sighted user would see in the content around it. Many users of assistive technology explore a page
by cycling through the interactive elements first.

```jsx live
<StackView space={3}>
  <Typography>Your account credit is $0.00.</Typography>
  <TextButton onPress={noop}>
    Refresh
    <A11yText text="account credit" />
  </TextButton>
</StackView>
```

TextButton accepts
React Native's accessibility props ([web docs](https://necolas.github.io/react-native-web/docs/accessibility/),
[native docs](https://reactnative.dev/docs/accessibility)).

### Platform considerations

<AvailableOnBoth />

## Props

<PropsTable base={BaseDocs} />

## Tokens

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

## Variants

TextButton's variants are the same as for [Link](Link#variants).

## Feedback

<Feedback component="TextButton" />
