Skip to content

Icon Label Button ​

A button combining an icon and a text label.

a-sxr-icon-label-button Component ​

Properties ​

PropertyDescriptionDefault Value
onEvent that triggers onclick actionclick
iconSenangStart icon slug, e.g. check, sparklescheck
icon-activeIcon slug for the active state''
icon-fontLegacy option retained for compatibility''
icon-font-sizeIcon size for button0.35
icon-occlusionLet scene geometry occlude the icon (opt-in depth test)false
keyTextual shortcut key that activates the widget (e.g. 'e')
key-codeLegacy numeric shortcut key (e.g. 32 for Space)-1
font-colorText color for button label#F1F5F9
valueText of button label''
font-familyFont family for buttonOutfit-Regular.ttf
font-sizeFont size for button0.2
border-colorBorder color of button#1B1B1F
background-colorBackground color of button#202127
hover-colorBackground color when button is in hover state#0EA5E9
active-colorBackground color when button is pressed down#2563EB
toggleToggle statusfalse
toggle-stateSetting the toggle button on/off statefalse
heightHeight of button1
widthWidth of button1
marginMargin around button0 0 0 0
html
<a-sxr-icon-label-button
	width="2.5" height="0.75"
	onclick="buttonActionFunction"
	icon="sparkles"
	value="icon label"
	font-family="Outfit-Regular.woff2"
	font-size="0.16"
	margin="0 0 0.05 0"
>
</a-sxr-icon-label-button>

Notes ​

  • value holds the text label; icon holds the icon slug. Both are live-updatable.
  • icon-active swaps the icon in the pressed state.
  • icon-font is a legacy option retained for compatibility.
  • Set icon-occlusion="true" to let scene geometry occlude the icon — see Occlusion.