KPWarningInfoStateComposable

fun KPWarningInfoStateComposable(modifier: Modifier = Modifier, warningInfoStateLayoutStyle: WarningInfoStateLayoutStyle)

A composable function that displays a warning or informational state using a combination of icons, text, and buttons. The layout and content are defined by the provided WarningInfoStateLayoutStyle.

This composable is useful for presenting user feedback such as warnings, errors, or general information with actionable buttons.

Parameters

modifier

Modifier to be applied to the root container of this composable. Default is Modifier.

warningInfoStateLayoutStyle

A WarningInfoStateLayoutStyle instance that specifies the layout style, including the icon, title, description, and button configurations.

Example Usage

KPWarningInfoStateComposable(
warningInfoStateLayoutStyle = KPWarningInfoStateLayoutStyle.SingleButtonFullVersion(
icon = KPIcons.Fill.StateWarningInfoDefault,
iconSize = StateLayoutIconSize.WarningInfoStateLayoutSmallIcon,
title = "Empty State Title",
description = "Description will be here. Description can be for example; 2",
primaryButtonText = "primaryButton",
primaryButtonClickListener = {}
)
)

Layout Description

  • The composable displays an icon, a title, a description, and up to two buttons.

  • The icon size, title style, and button styles are derived from the WarningInfoStateLayoutStyle.

  • Buttons are optional and are only displayed if text and click listeners are provided in the model.

See also