Buttons initiate app-specific actions, have customizable backgrounds, and can include a title, icon or both. Buttons can be styled with several attributes to look a specific way.



XelaButton(text = "Button", onClick = { /*TODO*/ })


Name Type Default Value Required Description
text String - YES Label text for button, should be empty for remove text
onClick () -> Unit - YES Action func for button
leftIcon Int? null NO Left Icon name from Drawable
rightIcon Int? null NO Right Icon name from Drawable
size XelaButtonSize XelaButtonSize.MEDIUM NO Size for button (LARGE, MEDIUM, SMALL)
state XelaButtonState XelaButtonState.DEFAULT NO State for button (DEFAULT, DISABLED)
type XelaButtonType XelaButtonType.PRIMARY NO Button type (PRIMARY, SECODARY)
background Color XelaColor.Blue NO Background color for button
foregroundColor Color Color.White NO Foreground color for icons and text in button
defaultBorderColor Color XelaColor.Gray11 NO Default color for border in SECONDARY type button
autoResize Boolean true NO Button autoresize, if false button width equals button container width, else width equals button content width
borderLineWidth Dp 1.dp NO Border Line width
removePaddings Boolean false NO Remove insets paddings from button
alignment Alignment.Horizontal Alignment.CenterHorizontally NO Horizontal Alignment for content of button