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
DescriptionUse 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
DescriptionUse 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
DescriptionUse this method to get the UUID of the carousel play event.
Name
getElementDataSource(): string
DescriptionA 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[]
DescriptionUse this method to get all the slides in the carousel.
Name
getElementDataSource(): ElementDataSource
DescriptionUse this method to get the data source of the carousel.
Name
getVisibleSlideIndex(): number
DescriptionUse this method to get the index of the currently visible slide.
Name
moveToSlide(index: number): void;
DescriptionUse 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;
DescriptionUse 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;
DescriptionUse this method to register a callback that will be called when the carousel is rendered.
Name
pause(): void;
DescriptionUse this method to pause the carousel.
Name
previousSlide(): void
DescriptionUse 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
DescriptionUse 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
DescriptionUse this method to check if the carousel is rendered.
Name
resume(): void
DescriptionUse this method to resume the carousel.
Name
setPausedCarouselAfterSlideChange(paused: boolean): void
DescriptionUse this method to set whether the carousel should be paused after a slide change.
Name
setVisibleSlide(index: number): void;
DescriptionUse 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;
DescriptionUse 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;
DescriptionUse this method to register a callback that will be called when the slide changes.
Name
updated(): boolean;
DescriptionUse 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
DescriptionUse this method to update the text element. Any changes to the text element will be reflected in the DOM.
Name
updateContent(text: string): void
DescriptionUse this method to update the content of the textbox. The method takes a single argument, which is the content you want to update.
Last updated
Was this helpful?