Skip to main content

Components

Chips

Chips allow users to enter information, make selections, filter content, or trigger actions.

banner-Chips

Usage

Chips allow users to enter information, make choices, filter content, or trigger actions. While buttons are expected to appear consistently and with a familiar call to action, chips will appear dynamically as groups of multiple interactive elements.

Use Legion chips styles to modify chips with lots of attributes that make you easier.

import LegionUI

Variant

Default

Use this Function : LGNChips

This code sample demonstrates how to modify the variant of chips :

LGNChips(label: "Label", size: .medium)

Attribute

Legion Have 3 Attributes for Customize Chips :

Size

This size attribute for user to costumize size of chips

Small

LGNChips(label: "Label", size: .small

Medium

LGNChips(label: "Label", size: .medium)

Active

This size attribute for user to costumize active of chips

Small

LGNChips(label: "Label", isActive: true, size: .small)

Medium

LGNChips(label: "Label", isActive: true, size: .medium)

Disable

This size attribute for user to costumize disable of chips

Small

LGNChips(label: "Label", isDisabled: .constant(true), size: .small)

Medium

LGNChips(label: "Label", isDisabled: .constant(true), size: .medium)

Properties

PropertiesDescriptionDefault Value
labelThe label for the chip’s label, that describes the purpose of the chips’ action.'nil'
sizeThe size of the chips. Either .medium or .small'nil'
isDisabledA binding boolean to enable disable the chips component'.constant(false)'
isActiveThe boolean state to enable active state to the chips component.'false'
fontFamilyA string of font family name""
actionThe action to perform when the user triggers the chips.{}
isHiddenBorderThe boolean state to hide the border when the state is active'false'
activeTextColorA text color to be used for the foregroundColor/textlabel when the state is active'.white'
disabledTextColorA text color to be used for the foregroundColor/textlabel when the state is disabled'Color.LGNTheme.tertiary400'
defaultTextColorA text color to be used for the foregroundColor/textlabel when the state is default'Color.LGNTheme.tertiary900'
activeBackgroundColorA background color to be used for the chips background when the state is active'Color.LGNTheme.tertiary900'
notActiveBackgroundColorA background color to be used for the chips background when the state is not active'.clear'

Example Project

LGNChips(
label: "Label",
isDisabled: .constant(false),
isActive: true,
size: .medium,
fontFamily: "Verdana-Italic") {
//Action
}