Skip to main content

slider

Decorator that creates a slider control for numeric properties in the inspector.

TypeNameInterface Description
Functionsslider(min: number, max: number, step?: number): (target: any, key: string) => any

Function: Decorator that creates a slider control for numeric properties in the inspector. Provides a visual slider for adjusting values within a specified range.

Parameters

min: - The minimum value of the slider

max: - The maximum value of the slider

step: - Optional step size for discrete values

Returns Property decorator function

Example

@component()
export class CameraSettings extends APJS.BasicScriptComponent {
@serializeProperty()
@slider(0, 180, 1)
public fov: number = 60;

@serializeProperty()
@slider(0.1, 10, 0.1)
public exposure: number = 1;

@serializeProperty()
@slider(0, 1, 0.01)
public bloomIntensity: number = 0.5;
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies