> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beyondwords.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Call To Action

> Displays the player's call-to-action text, with a fallback when none is set.

> [tab] Preview

> [tab] Code
>
> ```jsx CallToAction.jsx theme={null}
> "use client";
>
> import { usePlayerSelector } from "@/registry/react/PlayerProvider";
>
> export function CallToAction() {
>   const callToAction = usePlayerSelector((p) => p.callToAction);
>   return <div>{callToAction ?? "Listen to this article"}</div>;
> }
> ```

## Installation

```bash npm theme={null}
npx @beyondwords/cli components add call-to-action
```

```bash pnpm theme={null}
pnpm dlx @beyondwords/cli components add call-to-action
```

```bash yarn theme={null}
yarn dlx @beyondwords/cli components add call-to-action
```

```bash bun theme={null}
bunx --bun @beyondwords/cli components add call-to-action
```

## Usage

```tsx theme={null}
import { PlayerProvider } from '@/registry/react/PlayerProvider';
import { CallToAction } from '@/registry/react/CallToAction';

export function Player() {
  return (
    <PlayerProvider args={{ projectId: 9504, contentId: "ba00ef51-03ac-4a85-8b98-e45c957e8ef8", showUserInterface: false }}>
      <CallToAction />
    </PlayerProvider>
  );
}
```

The component reads `callToAction` from the surrounding
[`PlayerProvider`](https://docs.beyondwords.io/components/react/player-provider) via `usePlayerSelector`, so it
re-renders only when that value changes. When the source has no call-to-action
configured, it falls back to `"Listen to this article"`. Edit the fallback or
the markup to match your UI.

## Reference

| | |
| - | - |
| **Props** | None |
| **Player state read** | `callToAction` |
| **Events emitted** | None (display only) |
| **Requires** | a [`PlayerProvider`](https://docs.beyondwords.io/components/react/player-provider) ancestor |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.