Skip to content

fix(ios): button group is the system segmented control - #123

Open
SRWieZ wants to merge 2 commits into
NativePHP:mainfrom
SRWieZ:fix/ios-button-group-segmented
Open

SRWieZ wants to merge 2 commits into
NativePHP:mainfrom
SRWieZ:fix/ios-button-group-segmented

Conversation

@SRWieZ

@SRWieZ SRWieZ commented Oct 3, 2026

Copy link
Copy Markdown
Member

On iOS, native:button-group draws its own row of buttons, while Android uses Material's segmented button row. So the same Blade looks like a native control on Android and like a custom widget on iOS, and iOS users lose what the system control gives: sliding across segments, the system animation, and VoiceOver reading "Medium, button, 2 of 3, selected".

This PR renders it as a UISegmentedControl. Nothing changes on the PHP side (options, value, @change, disabled, a11y-label), and the same tab-change event is sent. The selected segment uses primary with onPrimary text, like Android, and labels keep the theme font at fontSm, scaled with Dynamic Type. A server value we just sent doesn't move the selection back, as before.

Apps that use the group on iOS will see the system look instead of the bordered row.

To reproduce:

<native:column class="w-full px-4 pt-6 gap-6">
    <native:button-group class="w-full" :options="['Small', 'Medium', 'Large']" :value="$size" @change="pickSize" />
    <native:button-group class="w-full" :options="['List', 'Grid']" :value="$view" @change="pickView" />
    <native:button-group class="w-full" :options="['Day', 'Week', 'Month']" :value="0" disabled />
</native:column>
public int $size = 1;

public int $view = 0;

public function pickSize(int $index): void
{
    $this->size = $index;
}

public function pickView(int $index): void
{
    $this->view = $index;
}

iOS before and after (iPhone 17 Pro simulator, iOS 26), with Android for comparison:

button group before and after

SRWieZ added 2 commits October 3, 2026 22:28
iOS drew the group as a row of plain buttons while Android uses Material's
segmented button row. It is now a UISegmentedControl (Liquid Glass on iOS
26), with the selected segment in theme.primary like Android.
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.

2 participants