Skip to content

Expressive list segmented#483

Merged
alorma merged 11 commits intomainfrom
expressive_list_Segmented
Mar 4, 2026
Merged

Expressive list segmented#483
alorma merged 11 commits intomainfrom
expressive_list_Segmented

Conversation

@alorma
Copy link
Owner

@alorma alorma commented Feb 24, 2026

Description

This PR significantly expands the ui-tiles-expressive module so it mirrors the full standard tile set, but built on Material 3 Expressive's SegmentedListItem. This allows consumers to build a complete settings screen using expressive components that support the segmented list visual style — connected groups of items with shared borders and per-item corner rounding.

What changed

ui-tiles-expressive now contains expressive variants of all standard tiles:

  • SettingsMenuLink
  • SettingsCheckbox
  • SettingsTriStateCheckbox
  • SettingsRadioButton
  • SettingsSwitch
  • SettingsGroup
  • SettingsButtonGroup (expressive-only, unchanged)

These components use SegmentedListItem instead of ListItem, and expose a shapes: ListItemShapes parameter (instead of shape: Shape). This enables segmented list styling via ListItemDefaults.segmentedShapes(index, count).

ui-tiles-extended gains:

  • SettingsSegmented — single-choice selection using Material 3's SingleChoiceSegmentedButtonRow

Key API difference (expressive vs standard)

// Standard (ui-tiles)
SettingsSwitch(
  state = true,
  title = { Text("Wi-Fi") },
  shape = RoundedCornerShape(16.dp),
  onCheckedChange = { },
)

// Expressive (ui-tiles-expressive) — supports segmented list grouping
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
val colors = ListItemDefaults.segmentedColors(
  containerColor = MaterialTheme.colorScheme.surfaceContainer,
)

SettingsSwitch(
  state = true,
  title = { Text("Wi-Fi") },
  colors = colors,
  shapes = ListItemDefaults.segmentedShapes(index = 0, count = 3),
  onCheckedChange = { },
)

Pair items with Arrangement.spacedBy(ListItemDefaults.SegmentedGap) to get the connected look.

Related Issue

Fixes #481

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Changes Made

  • Added expressive variants of SettingsMenuLink, SettingsCheckbox, SettingsTriStateCheckbox, SettingsRadioButton, SettingsSwitch, SettingsGroup to ui-tiles-expressive
  • Added SettingsSegmented to ui-tiles-extended
  • Added SettingsScreenExpressive sample screen demonstrating segmented list usage
  • Updated README.md: split component docs into M3 and M3 Expressive sections, added SettingsSegmented, added segmented list usage example
  • Updated ARCHITECTURE.md: added ui-tiles-expressive module section, documented shapes vs shape API difference
  • Updated CLAUDE.md: reflected new module contents and dual design patterns

Platforms Tested

  • Android
  • iOS
  • Desktop (JVM)
  • JavaScript
  • WebAssembly

Breaking Changes

None. The expressive module previously only had SettingsButtonGroup. All new components are additions. The ui-tiles and ui-tiles-extended APIs are unchanged.

@alorma alorma force-pushed the expressive_list_Segmented branch from dce2aa7 to cc21d6f Compare March 4, 2026 17:31
@alorma alorma merged commit 0a6139b into main Mar 4, 2026
3 checks passed
@alorma alorma deleted the expressive_list_Segmented branch March 4, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add the new SegmentedList to expressive set

1 participant