Skip to content
pixi-silk
GitHub repository
Interface

SilkButtonOptions

import type { SilkButtonOptions } from 'pixi-silk/ui/button';

Options of SilkButton.

Properties#

PropertyTypeDescriptionDefined in
appearOffset?numberDistance it rises from when it appears, local units. Default 10.ui/SilkButton.ts:94
appearScale?numberScale the button grows from when it appears. Default 0.6.ui/SilkButton.ts:92
enabled?booleanInitial value of state.enabled. Default true.ui/SilkButton.ts:88
height?numberHeight in local units. Default 48. The button is centred on its origin.ui/SilkButton.ts:70
hitPadding?numberExtra hit margin around the shape in local units (a finger landing a little outside still counts). Default 6.ui/SilkButton.ts:96
holdMs?numberLong-press time in ms. A press held this long fires onHold instead of onPress. Off when left out.ui/SilkButton.ts:90
icon?IconSourceIcon shown before the label. See IconSource.ui/SilkButton.ts:78
iconSize?numberIcon size in local units. Default 22.ui/SilkButton.ts:80
label?stringText shown after the icon, about 15 px semibold system font unless textStyle says otherwise.ui/SilkButton.ts:76
onHold?(button: SilkButton) => voidCalled once when a press is held for holdMs.ui/SilkButton.ts:104
onPress?(button: SilkButton) => voidCalled on release over the button while state.active. Not called after a hold fired.ui/SilkButton.ts:102
profiles?Partial<Record<InputKind, Partial<InputProfile>>>Per pointer kind overrides. The slop sets how far a press may slide off and still count.ui/SilkButton.ts:98
radius?numberCorner radius of rect and squircle, local units. Default 14.ui/SilkButton.ts:74
shape?"rect" | "pill" | "circle" | "squircle"Default pill. squircle uses continuous corners.ui/SilkButton.ts:72
shown?booleanStart visible. Default true.ui/SilkButton.ts:86
textStyle?TextStyleOptionsPixi text style merged over the label’s default style.ui/SilkButton.ts:82
theme?Partial<ButtonTheme>Colours merged over BUTTON_THEME. Read once, at construction.ui/SilkButton.ts:84
ticker?Ticker | nullTicker that runs the animation. Default Ticker.shared. With null, call SilkButton.tick yourself.ui/SilkButton.ts:100
width?numberWidth in local units. Default 120. Circles ignore it and use height.ui/SilkButton.ts:68