Skip to main content

spinBox

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

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

Function: Decorator that creates a spin box control for numeric properties in the inspector. Provides up/down arrows for adjusting numeric values with optional constraints.

Parameters

min: - The minimum allowed value

max: - The maximum allowed value

step: - Optional step size for increment/decrement

Returns Property decorator function

Example

@component()
export class GridSettings extends APJS.BasicScriptComponent {
@serializeProperty()
@spinBox(1, 100, 1)
public gridSize: number = 10;

@serializeProperty()
@spinBox(0, 360, 15)
public snapAngle: number = 45;

@serializeProperty()
@spinBox(0.01, 2, 0.01)
public timeScale: number = 1;
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies