Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluent] Add SegmentedControl and SegmentedButton. #60

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Sanlorng
Copy link
Collaborator

@Sanlorng Sanlorng commented Jun 2, 2024

Components

  1. SegmentedControl
  2. SegmentedButton

Issue

we should align the design file? indicator always at center bottom of item text, even if item has icon.

Basic Usage

val checkedIndex = remember { mutableStateOf(0) }
SegmentedControl {
    repeat(count) { index ->
        SegmentedButton(
            checked = index == checkedIndex.value,
            onCheckedChanged = { checkedIndex.value = index },
            position = when (index) {
                0 -> SegmentedItemPosition.Start
                count - 1 -> SegmentedItemPosition.End
                else -> SegmentedItemPosition.Center
            },
            text = { Text("Text") }
        )
    }
}

Sreenshot

image

@Sanlorng Sanlorng requested a review from Konyaco June 2, 2024 13:55
@Sanlorng Sanlorng force-pushed the component/segmented-control branch from 12839d8 to e65017e Compare June 2, 2024 13:57
@Sanlorng Sanlorng force-pushed the component/segmented-control branch from e65017e to 51eedad Compare June 2, 2024 14:19
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.

None yet

1 participant