Skip to main content

dropDown

Decorator that creates a dropdown selection control for properties in the inspector.

TypeNameInterface Description
FunctionsdropDown(options: [string, string][]|[string, number][]): (target: any, key: string) => any

Function: Decorator that creates a dropdown selection control for properties in the inspector. Allows selection from a predefined list of options.

Parameters

options: - Array of option pairs, where each pair is [displayText, value]

Returns Property decorator function

Example

@component()
export class QualitySettings extends APJS.BasicScriptComponent {
@serializeProperty()
@dropDown([
["Low", 0],
["Medium", 1],
["High", 2],
["Ultra", 3]
])
public graphicsQuality: number = 2;

@serializeProperty()
@dropDown([
["Windowed", "windowed"],
["Fullscreen", "fullscreen"],
["Borderless", "borderless"]
])
public displayMode: string = "windowed";
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies