Skip to content

Button

@Composable



fun Button(
    onClick: (UINode) -> Unit, 
    modifier: Modifier = Modifier, 
    enabled: Boolean = true, 
    texture: String = "button", 
    variant: String = ThemeVariants.DEFAULT, 
    ignoreMinSize: Boolean = false, 
    content: @Composable



 () -> Unit = {}
)

A standard themed, clickable button.

Renders the themed texture state (TextureStates.DEFAULT/TextureStates.FOCUSED/ TextureStates.CLICKED/TextureStates.DISABLED) behind content, animating a 1px press offset while held. For fully custom visuals, use ButtonCore directly instead.

Parameters

  • onClick: Invoked with the receiving UINode when the button is pressed.

  • modifier: Additional modifiers applied to the outer clickable container.

  • enabled: When false, the disabled state is drawn and pointer events are ignored.

  • texture: The themed texture key to look up via LocalTheme.

  • variant: The theme variant of texture to use. See ThemeVariants.

  • ignoreMinSize: Lets a modifier size this button below what its theme declares as a minimum - see intrinsicSizeModifier. Without it the theme's floor and the caller's size become a min > max constraint and the button does not lay out at all, which reads as it simply not drawing. The theme's own content padding is dropped along with the minimum: a theme sizes that padding for a button of its intended size, and four pixels either side of an eight-pixel one leaves the content none at all. A button this small is expected to hold a scaled glyph rather than a label, so it is the caller's business how tightly it sits.

  • content: The button's foreground content (e.g. a net.kernelpanicsoft.archie.gui.composables.basic.Text).