> For the complete documentation index, see [llms.txt](https://docs.responsiveads.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.responsiveads.com/developers/components.md).

# Components

In this guide, we will take a look at different components a creative can have and how Radical API can help you manage them.

You can add Custom JavaScript to your creatives if you want to access and control the elements added from the editor.

***

### Carousel

Carousels are a great way to display multiple images or videos in a single ad unit. You can use the Radical API to create and manage carousels in your creatives.

* Name`animateToSlide(index: number): void`Description

  Use this method to animate the carousel to a specific slide. The method takes a single argument, which is the index of the slide you want to animate to.
* Name`animateToSlideIndex(index: number): void`Description

  Use this method to animate the carousel to a specific slide. The method takes a single argument, which is the index of the slide you want to animate to.
* Name`getCarouselPlayUUID(): string`Description

  Use this method to get the UUID of the carousel play event.
* Name`getElementDataSource(): string`Description

  A Carousel component can have a data source. Users can add this data source from the editor. This method returns the data source of the carousel.
* Name`getSlides(): Carousel Slide[]`Description

  Use this method to get all the slides in the carousel.
* Name`getElementDataSource(): ElementDataSource`Description

  Use this method to get the data source of the carousel.
* Name`getVisibleSlideIndex(): number`Description

  Use this method to get the index of the currently visible slide.
* Name`moveToSlide(index: number): void;`Description

  Use this method to move the carousel to a specific slide. The method takes a single argument, which is the index of the slide you want to move to. This method does not animate the transition.
* Name`nextSlide(): void;`Description

  Use this method to move the carousel to the next slide. It will use the first slide if the current slide is the last one.
* Name`onRender(callback: (arg: any) => void): void;`Description

  Use this method to register a callback that will be called when the carousel is rendered.
* Name`pause(): void;`Description

  Use this method to pause the carousel.
* Name`previousSlide(): void`Description

  Use this method to move the carousel to the previous slide. It will use the last slide if the current slide is the first one.
* Name`removeSlide(index: number): void`Description

  Use this method to remove a slide from the carousel. The method takes a single argument, which is the index of the slide you want to remove.
* Name`rendered(): boolean`Description

  Use this method to check if the carousel is rendered.
* Name`resume(): void`Description

  Use this method to resume the carousel.
* Name`setPausedCarouselAfterSlideChange(paused: boolean): void`Description

  Use this method to set whether the carousel should be paused after a slide change.
* Name`setVisibleSlide(index: number): void;`Description

  Use this method to set the visible slide of the carousel. The method takes a single argument, which is the index of the slide you want to set as visible.
* Name`setVisibleSlideIndex(index: number): void;`Description

  Use this method to set the visible slide of the carousel. The method takes a single argument, which is the index of the slide you want to set as visible.
* Name`slideChangeCallback(callback: (arg: any) => void): void;`Description

  Use this method to register a callback that will be called when the slide changes.
* Name`updated(): boolean;`Description

  Use this method to check if the carousel is updated.

### TextBox

Textboxes are used to display text in your creatives. They are added from the editor but you can edit them using the API.

* Name`updateShrink(): string`Description

  Use this method to update the text element. Any changes to the text element will be reflected in the DOM.
* Name`updateContent(text: string): void`Description

  Use this method to update the content of the textbox. The method takes a single argument, which is the content you want to update.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.responsiveads.com/developers/components.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
