Button Showcase

Type

Is Text

Text

Text Align

Icon Position

Icon

Selected Type

Is Compressed

Is Pill

Is Uniform

Is Icon Background Tint

Is Icon Shimmyable

Is No Wrap

Is Word Break All

Is Success Animation

Is Disabled

Is Loading

Component Documentation

Component Name

Button

Builder Function Name

create_button_manager

Description

creates a fully customizable button with optional icon, interactive states, and configurable styling

Use like example

Config

PropertyTypeDefaultDescription
typestring

primary

visual style of the button (primary, outlined, soft, plain)

support_iconstring

icon identifier to display; if null, no icon is shown

is_icon_bg_tintboolean

false

applies a tinted background behind the icon

icon_degnumber

0

deg rotation for the icon

icon_swnumber

0

icon stroke width setting

icon_sizenumber

1.8

icon size in rem units

icon_mlnumber

0

icon's left margin in rem

icon_mrnumber

0

icon's right margin in rem

icon_posstring

right

icon position (left or right)

is_icon_shimmyableboolean

false

whether icon can shimmy on hover

icon_movement_stiffnessnumber

0.1

movement stiffness for shimmy effect

icon_movement_dampingnumber

0.1

movement damping for shimmy effect

aria_labelstring

aria-label for accessibility

popover_targetstring

css selector id for an associated popover

is_no_wrapboolean

false

prevents text from wrapping

is_word_break_allboolean

false

forces text to break at any character

is_success_animationboolean

false

if true, triggers a success animation/icon on click

mlnumber

0

margin-left (rem)

mrnumber

0

margin-right (rem)

mtnumber

0

margin-top (rem)

mbnumber

0

margin-bottom (rem)

plnumber

1.1

padding-left (rem)

prnumber

1.1

padding-right (rem)

ptnumber

0.3

padding-top (rem)

pbnumber

0.3

padding-bottom (rem)

border_radiusnumber

1

button border radius (rem)

tabindexnumber

0

tabindex for focus navigation

is_prevent_defaultboolean

false

prevents default on click event if true

is_stop_propagationboolean

false

stops event propagation on click if true

min_heightnumber

3.4

minimum height of the button (rem)

fixed_widthnumber

fixed width in rem

min_widthnumber

minimum width in rem

is_compressedboolean

false

if true, sets button width to auto

is_pillboolean

false

if true, button is fully rounded

is_uniformboolean

false

if true, forces button height == width

cursorstring

pointer

cursor style (pointer, move, etc.)

text_alignstring

center

how to align button text: left, center, or right

font_sizenumber

1.6

font size in rem

line_heightnumber

1.2

line-height for text

font_weightnumber

400

font weight (normal=400, bold=700, etc.)

textstring

text label for the button

is_loadingboolean

false

if true, a loading spinner replaces icon/text

is_disabledboolean

false

disables the button if true

selected_typestring

visual marker (selected or half_selected) appended to the style

hnumber

color hue index for advanced color customization

cnumber

color chroma index for advanced color customization

lnumber

color luminance index for advanced color customization

colorstring

button base color (if not using derived defaults)

gradient_to_colorstring

button gradient end color (if not using derived defaults)

gradient_turnnumber

0.3

turn value for the button's linear-gradient (0 to 1 is a full 360° turn)

contrast_colorstring

text/icon color used on top of button background

border_colorstring

border color when type is outlined or a border is forced

hover_shadow_colorstring

transparent

shadow color on hover

hover_shadow_sizenumber

1

shadow size on hover

on_clickfunction

callback triggered upon button click

on_hoverfunction

callback triggered on pointer enter/leave; receives true (enter) or false (leave)

is_simulated_activeboolean

false

if true, button is forced into an active state for visual effect

Methods

MethodDescriptionParametersReturns
success_trigger

triggers a success state, displaying success icon for ~1.4s

No Params

void
error_trigger

triggers an error state, displaying error icon for ~1.4s

No Params

void
icon_shimmy_trigger

manually triggers the icon's shimmy animation if is_icon_shimmyable

No Params

void
handle_click

internal click handler that runs callbacks, sets success animation, etc.

e: event

void
pointer_down

pointerdown event to set is_pointer_down to true

No Params

void
pointer_up

pointerup event to reset is_pointer_down to false

No Params

void
pointer_enter

pointerenter event to set is_hovered to true and invoke on_hover(true)

No Params

void
pointer_leave

pointerleave event to set is_hovered to false and invoke on_hover(false)

No Params

void
simulate_click

simulates a click, briefly showing the pressed state

No Params

void
focus

programmatically sets focus to the button element

No Params

void

Returned Properties

PropertyTypeDescription
idstring

unique identifier for this button instance

typestring

the derived style type (primary, outlined, etc.)

mlnumber

margin-left in rem

mrnumber

margin-right in rem

mtnumber

margin-top in rem

mbnumber

margin-bottom in rem

plnumber

padding-left in rem

prnumber

padding-right in rem

ptnumber

padding-top in rem

pbnumber

padding-bottom in rem

border_radiusnumber

button border radius in rem

is_loadingboolean

shows a loading spinner if true

is_pointer_downboolean

true while pointer is pressed

is_prevent_defaultboolean

if true, prevents default event in handle_click

is_stop_propagationboolean

if true, stops event propagation in handle_click

tabindexnumber

button tabindex for keyboard focus

is_disabledboolean

true if the button is disabled

selected_typestring

selected or half_selected style variant

is_hoveredboolean

true if pointer is hovering over the button

min_heightnumber

minimum height in rem

fixed_widthnumber

fixed button width in rem

min_widthnumber

minimum button width in rem

is_compressedboolean

if true, sets width to auto

is_pillboolean

true if button is pill shaped

is_uniformboolean

true if button forces a uniform square shape

cursorstring

current cursor style

text_alignstring

alignment for the text label

textstring

current text label of the button

is_success_animationboolean

triggers success animation on click

font_sizenumber

font size in rem

line_heightnumber

text line-height

font_weightnumber

text font-weight

colorstring

base color for the button background

gradient_to_colorstring

secondary color for a gradient background

gradient_turnnumber

turn fraction for the linear gradient angle

contrast_colorstring

color used for text or icons on top of background

border_colorstring

border color if outlined or forced border is used

hover_shadow_colorstring

shadow color on hover

hover_shadow_sizenumber

shadow size on hover

support_iconstring

the icon identifier the button is currently set to display

is_icon_bg_tintboolean

true if there's a tinted background behind the icon

icon_degnumber

rotation in degrees for the icon

icon_swnumber

stroke width for the icon if applicable

icon_sizenumber

icon size in rem

icon_mlnumber

icon left margin in rem

icon_mrnumber

icon right margin in rem

icon_posstring

icon position (left or right)

is_icon_shimmyableboolean

true if icon shakes when hovered

icon_movement_stiffnessnumber

shimmy stiffness

icon_movement_dampingnumber

shimmy damping

aria_labelstring

aria-label for accessibility

popover_targetstring

id for associated popover element

is_no_wrapboolean

true if text should not wrap

is_word_break_allboolean

true if text can break at any character

is_simulated_activeboolean

forces button into an active state visually

is_successboolean

true if button is showing success state

is_errorboolean

true if button is showing error state

icon_managerobject

the internally created icon manager for this button

icon
Sponsored byContibase