Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Modal

Modal is used to display the content that appears inside a form

banner-Modal
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Upcoming Upcoming

Modal components in Android are pop-up windows that appear on top of an application to grab the user’s attention.Modal components are designed to demand attention, preventing users from interacting with the underlying application until they have addressed the modal by either dismissing it or completing the required action.

Legion Modal Android Compose

Basic Example

Basic Modal

var showBottomSheet by remember { mutableStateOf(false) }
LgnButton(
onClick = {
showBottomSheet = !showBottomSheet
},
label = "Open Modal",
modifier = Modifier.fillMaxWidth()
)

Basic Modal Attributes

ParametersTypeDescription
visibleBooleancontrols visibility in this modal
titleStringtitle which should specify the purpose of the dialog. The title is not mandatory
messageStringtext which presents the details regarding the dialog’s purpose
onDismissRequestFunctionExecutes when the user tries to dismiss the dialog
propertiesDialogPropertiesDialogProperties for further customization of this dialog’s behavior
modifierModifierThe Modifier to be applied to the modal
shapeShapeThe shape of the bottom sheet
colorsLgnModalColorsLgnModalColors that will be used to resolve the colors used for this modal in different states. See [LgnModalDefaults.colors]
iconImageVectorThe icon to be displayed on the left side of header modal
showCloseIconBooleancontrols visibility of close icon in this modal
footerComposableThe footer to be displayed inside the modal

Decoration Example

By utilizing custom methods, you can dynamically modify icon, header, footer, and content.

var showBottomSheet by remember { mutableStateOf(false) }
LgnButton(
onClick = {
showBottomSheet = !showBottomSheet
},
label = "Open Modal",
modifier = Modifier.fillMaxWidth()
)

Decoration Modal Attributes

ParametersTypeDescription
visibleBooleancontrols visibility in this modal
onDismissRequestFunctionExecutes when the user tries to dismiss the dialog
propertiesDialogPropertiesDialogProperties for further customization of this dialog’s behavior
modifierModifierThe Modifier to be applied to the modal
shapeShapeThe shape of the bottom sheet
colorsLgnModalColorsLgnModalColors that will be used to resolve the colors used for this modal in different states. See [LgnModalDefaults.colors]
headerComposableThe header to be displayed inside the modal
footerComposableThe footer to be displayed inside the modal
contentComposableThe content to be displayed inside the modal