---
title: CPNowPlayingAddToLibraryButton
framework: carplay
role: symbol
role_heading: Class
path: carplay/cpnowplayingaddtolibrarybutton
---

# CPNowPlayingAddToLibraryButton

A button for adding the current playing item to a collection.

## Declaration

```swift
@MainActor class CPNowPlayingAddToLibraryButton
```

## Overview

Overview CPNowPlayingAddToLibraryButton is a concrete subclass of CPNowPlayingButton. Use this button to allow a user to add the current playing item to a collection, such as their library. You implement this functionality in the button’s handler, or use the handler to invoke existing code that performs this function.

## Relationships

### Inherits From

- [CPNowPlayingButton](carplay/cpnowplayingbutton.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Managing the Template’s Buttons

- [nowPlayingButtons](carplay/cpnowplayingtemplate/nowplayingbuttons.md)
- [updateNowPlayingButtons(_:)](carplay/cpnowplayingtemplate/updatenowplayingbuttons(_:).md)
- [CPNowPlayingButton](carplay/cpnowplayingbutton.md)
- [CPNowPlayingImageButton](carplay/cpnowplayingimagebutton.md)
- [CPNowPlayingMoreButton](carplay/cpnowplayingmorebutton.md)
- [CPNowPlayingPlaybackRateButton](carplay/cpnowplayingplaybackratebutton.md)
- [CPNowPlayingRepeatButton](carplay/cpnowplayingrepeatbutton.md)
- [CPNowPlayingShuffleButton](carplay/cpnowplayingshufflebutton.md)
