Components
Modal
Modal is used to display the content that appears inside a form
Component Status Details
Status component contains a list of checks and completeness that has been tested and owned by each component
We don't use color as the only visual tool to convey information.
The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc. The title is the component name that uses the frame base component template. The base component name contains: .Base & "Component Name" if there is more than one. All component properties use the Legion foundation.
We can change all the parts that are connected to the component base. The inside of the base component remains connected to the master component. All variant options are not damaged when we change from one to another. Overriding changes to components will not reset other variants.
Component's already has component specs documentation.
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.
Basic Example
Basic Modal
var showBottomSheet by remember { mutableStateOf(false) }LgnButton(onClick = {showBottomSheet = !showBottomSheet},label = "Open Modal",modifier = Modifier.fillMaxWidth())
Basic Modal Attributes
Parameters | Type | Description |
---|---|---|
visible | Boolean | controls visibility in this modal |
title | String | title which should specify the purpose of the dialog. The title is not mandatory |
message | String | text which presents the details regarding the dialog’s purpose |
onDismissRequest | Function | Executes when the user tries to dismiss the dialog |
properties | DialogProperties | DialogProperties for further customization of this dialog’s behavior |
modifier | Modifier | The Modifier to be applied to the modal |
shape | Shape | The shape of the bottom sheet |
colors | LgnModalColors | LgnModalColors that will be used to resolve the colors used for this modal in different states. See [LgnModalDefaults.colors] |
icon | ImageVector | The icon to be displayed on the left side of header modal |
showCloseIcon | Boolean | controls visibility of close icon in this modal |
footer | Composable | The 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
Parameters | Type | Description |
---|---|---|
visible | Boolean | controls visibility in this modal |
onDismissRequest | Function | Executes when the user tries to dismiss the dialog |
properties | DialogProperties | DialogProperties for further customization of this dialog’s behavior |
modifier | Modifier | The Modifier to be applied to the modal |
shape | Shape | The shape of the bottom sheet |
colors | LgnModalColors | LgnModalColors that will be used to resolve the colors used for this modal in different states. See [LgnModalDefaults.colors] |
header | Composable | The header to be displayed inside the modal |
footer | Composable | The footer to be displayed inside the modal |
content | Composable | The content to be displayed inside the modal |