Skip to content

Switch — PAM Native UI

PAM Native UI · Android evidence

p-switch rendered by the production retained-native pipeline. The specimen below is a real Physical Samsung SM-G973F Android 12 (API 31) capture at 420 dpi, not an HTML recreation.

Physical Samsung layout, route and native interaction verified
Family
Selection controls
Module
switch
PHP facade
PSwitch
Native targets
Android · UIKit

Selection controls component rendered through the retained-native Android and UIKit pipeline.

Android specimen

p-switch running in the PAM Native UI Android catalog

Interaction recording

The touch trace was captured from the Android application while exercising the native component.

p-switch native Android interaction

Showcase profiles

Every profile below is rendered by the Android catalog route shown above.

  • Default
  • Primary
  • Secondary
  • Success
  • Information
  • Warning
  • Error
  • X Small
  • Small
  • Large
  • X Large
  • Comfortable
  • Compact
  • Off
  • On
  • Disabled
  • Read Only
  • Error Color
  • Inline

PHP usage

use Pam\MobileUi\Material\PSwitch;
use Pam\Native\UI\Text;

PSwitch::make(
    [
        'accessibilityLabel' => "PSwitch preview",
        'checked' => true,
        'color' => "primary",
    ],
    Text::make('Switch'),
);

The equivalent PAM template entry point is <p-switch>…</p-switch>.

See the PAM Native UI guide for event, state and styling conventions, and the quality contractfor native behavior requirements.

Component properties

PropertyObserved typeShowcase values
accessibilityLabelstring"PSwitch preview"
checkedbooltrue, false
colorstring"primary", "secondary", "success", "info", "warning", "error"
densitystring"comfortable", "compact"
disabledbooltrue
errorbooltrue
errorMessagestring"Invalid choice"
inlinebooltrue
labelstring"Enabled"
readonlybooltrue
sizestring"x-small", "small", "large", "x-large"