CoUI Chip #
Overview #
The Chip component displays tags, filters, and selection states. It supports deletion buttons, avatars, and selection functionality with two variants: filled and outlined.
Flutter (coui_flutter) #
Import #
import 'package:coui_flutter/coui_flutter.dart' ;
Basic Usage #
Parameters #
Parameter Type Default Description
labelStringrequired Display text
onDelete
VoidCallback?
null
Removal button handler
avatar
Widget?
null
Left-side avatar widget
variant
ChipVariant
filled
Style variation (filled, outlined)
selected
bool
false
Selection state
onSelected
void Function(bool)?
null
Selection change handler
disabled
bool
false
Enable/disable state
Removable Chip #
Chip (
label: 'Dart' ,
onDelete: handleDeleteDart,
)
With Avatar #
Chip (
label: 'í길ë' ,
avatar: CircleAvatar (
backgroundImage: NetworkImage ( 'https://example.com/avatar.jpg' ) ,
) ,
onDelete: handleDeleteUser,
)
Selectable Chip #
Chip (
label: 'ëěě¸' ,
variant: ChipVariant . outlined,
selected: isDesignSelected,
onSelected: handleSelectDesign,
)
Chip Group Pattern #
Wrap (
spacing: 8 ,
children: [
Chip ( label: 'Flutter' , onDelete: ( ) => handleDelete ( 'flutter' ) ) ,
Chip ( label: 'Dart' , onDelete: ( ) => handleDelete ( 'dart' ) ) ,
Chip ( label: 'UI' , onDelete: ( ) => handleDelete ( 'ui' ) ) ,
] ,
)
Web (coui_web) #
Import #
import 'package:coui_web/coui_web.dart' ;
Basic Usage #
With Avatar and Delete #
Chip (
label: 'í길ë' ,
avatar: Avatar ( src: 'https://example.com/avatar.jpg' ) ,
onDelete: handleDeleteUser,
)
Selectable Chip #
Chip (
label: 'ëěě¸' ,
variant: ChipVariant . outlined,
selected: isDesignSelected,
onSelected: handleSelectDesign,
)
Common Patterns #
Variants #
Variant Description Use Case
ChipVariant.filled
Solid background (default)
Standard tag display
ChipVariant.outlinedBorder-only Filter selection interfaces
Aspect Flutter Web
Widget name ChipChip
Avatar type WidgetAvatar component
Layout spacing
Wrap(spacing:)
CSS flex gap classes
When to Use #
Tag lists and category labels
Filter selection bars
User/contact selection chips
Removable search criteria