Skip to content

Filled Button

A filled button is a button with a background color of your choice. Use it when the presets of Button do not fit, e.g. to color-code actions. Prefer the presets for regular actions, because they follow the theme and support disabled and critical states.

Filled Button

HStack(
	FilledButton(SG0, func() {}).Title("Approve").TextColor(ColorWhite),
	FilledButton(SE0, func() {}).Title("Reject").TextColor(ColorWhite).PreIcon(icons.XMark),
).Gap(L16)

Constructors

ConstructorDescription
func FilledButton(fillColor Color, action func()) TFilledButtonCreates a filled button with the given background color and action.

Methods

MethodDescription
Frame(frame Frame) TFilledButtonFrame sets the layout frame of the button, including size and positioning.
PostIcon(svg core.SVG) TFilledButtonPostIcon sets the icon displayed after the text label.
PreIcon(svg core.SVG) TFilledButtonPreIcon sets the icon displayed before the text label.
TextColor(color Color) TFilledButtonTextColor sets the text color of the button label.
Title(text string) TFilledButtonTitle sets the text label displayed on the button.

TextColor only applies to the label, the icons keep their default color.

Related