Components
Badge
Indicator of values such as labeling or notification
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.
Badge are small status descriptors for ui elements. A badge consists of a small circle, usually containing a number or other short character, that appears near other objects. Badges should always be applied to block level elements.
Usage
The following is the format for using Badge.
LgnBadge(iconLeft = {Icon(imageVector = Icons.Default.Warning, contentDescription = "")},iconRight = {Icon(imageVector = Icons.Default.Warning, contentDescription = "")}) {Text(text = "123")
Variants
Size
Badges has two sizes, Medium
and Small
.
//Badge MediumLgnBadge(size = LgnBadgeSize.Medium) {Text(text = "123")}//Badge SmallLgnBadge(
Appearance
There are 3 appearance that you can use for Badge.
Dot
Dot is basic usage of Badge .
LgnBadgeDot()
Label
You can give label to your Bagde by adding Text
parameter.
LgnBadge() {Text(text = "123")}
Rounded
You can give icon on center of the badge rounded.
LgnBadgeRounded() {Icon(imageVector = Icons.Default.AccountCircle, contentDescription = "")}
Attributes
LgnBadge
Parameter | Type | Description |
---|---|---|
modifier | Modifier | A modifier that can be used to adjust the layout or drawing content. |
iconLeft | @Composable (() -> Unit)? | A composable function that describes the icon on the left side of the badge. |
iconRight | @Composable (() -> Unit)? | A composable function that describes the icon on the right side of the badge. |
containerColor | Color | The color of the badge container. |
contentColor | Color | The color of the badge content. |
border | LgnBorderStroke | The border of the badge. |
size | LgnBadgeSize | The size of the badge. |
content | @Composable () -> Unit | A composable function that describes the content of the badge. |
LgnBadgeDot
Parameter | Type | Description |
---|---|---|
modifier | Modifier | A modifier that can be used to adjust the layout or drawing content. |
color | Color | The color of the badge. |
border | LgnBorderStroke | The border of the badge. |
size | LgnBadgeSize | The size of the badge. |
LgnBadgeRounded
Parameter | Type | Description |
---|---|---|
modifier | Modifier | A modifier that can be used to adjust the layout or drawing content. |
containerColor | Color | The color of the badge container. |
contentColor | Color | The color of the badge content. |
border | LgnBorderStroke | The border of the badge. |
size | LgnBadgeSizeRounded | The size of the badge. |
content | @Composable () -> Unit | A composable function that describes the content of the badge. |