StylishDialogSurface

fun StylishDialogSurface(onDismiss: () -> Unit, modifier: Modifier = Modifier, animate: Boolean = true, shape: Shape = RoundedCornerShape(StylishTheme.dimensions.connectedCornerRadius), containerColor: Color? = null, horizontalPadding: Dp = 16.dp, contentColor: Color? = null, properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = false), windowInsets: WindowInsets = WindowInsets.safeDrawing, content: @Composable ColumnScope.() -> Unit)

A modal dialog container that enters with a combined scale-and-fade animation. Wraps content in a full-width Card inside a platform Dialog whose properties default to DialogProperties(usePlatformDefaultWidth = false), so the surface stretches to the available width minus horizontalPadding.

The entrance animation scales from 92 % to 100 % over StylishTheme.animation.durationShort with a quadratic ease-in, while alpha fades from 0 to 1 over the same duration. Set animate to false to skip the animation entirely (e.g. during UI tests or when the caller manages its own transition).

Dismiss behaviour (back press, tap outside) is controlled through properties: pass DialogProperties(dismissOnBackPress = false) or DialogProperties(dismissOnClickOutside = false) to opt out of either dismissal path. onDismiss is invoked for whichever dismissals remain enabled.

The card is padded by windowInsets (defaults to WindowInsets.safeDrawing) so its content never collides with the system bars; pass WindowInsets(0) to disable this behaviour.

Parameters

onDismiss

Called when the user taps outside the dialog or presses the system back button (per properties).

modifier

Modifier applied to the root Card, before the built-in full-width, horizontal-padding, and entrance-animation modifiers.

animate

When true (default), the dialog plays the scale-and-fade entrance animation. When false, the dialog appears immediately with no transition.

shape

Shape of the card surface. Defaults to RoundedCornerShape with StylishTheme.dimensions.connectedCornerRadius (12 dp).

containerColor

Background color of the card. Defaults to MaterialTheme.colorScheme.surfaceContainerHigh.

horizontalPadding

Horizontal margin between the dialog edges and the screen edges. Defaults to 16 dp.

contentColor

Default content color inside the card. When null (default), the color scheme's default content color is used.

properties

The platform DialogProperties. Defaults to DialogProperties(usePlatformDefaultWidth = false) so the dialog spans the full available width. Use dismissOnBackPress and dismissOnClickOutside (constructor parameters of DialogProperties) to control dismissal.

windowInsets

Insets padded around the card so its content stays clear of system bars. Defaults to WindowInsets.safeDrawing. Pass WindowInsets(0) to disable.

content

Content rendered inside the card's ColumnScope. Callers are responsible for their own internal padding.