Search by

firstlightui / nativephp

wojt-janowski

Native controls for NativePHP, shaped for each platform.

Package info

github.com/firstlightui/nativephp

Homepage

Type:nativephp-ui-plugin

pkg:composer/firstlightui/nativephp

Statistics

Installs: 45

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.0-RC2 2026-10-22 20:52 UTC

README

Native controls for NativePHP, shaped for each platform. Firstlight exposes a shared EDGE API backed by genuine SwiftUI and Jetpack Compose controls, plus the Laravel contracts mobile screens need: validation, submission, authorization, pagination, and list deletion.

Documentation · Components · Source · Email

Pre-alpha. Firstlight is pending physical-device, soak/performance, and wider application qualification. It is not yet a production-readiness claim.

Requirements

Dependency Requirement
PHP ^8.4
NativePHP Mobile ^4.6
NativePHP Mobile UI ^0.8
iOS / Android targets iOS 18+ / API 29+

See Compatibility for the full table.

Installation

composer require firstlightui/nativephp
php artisan native:plugin:register
php artisan native:install --force

Run php artisan native:install --force again after every Firstlight update; renderer source is compiled into the host application.

Example

Screens extend FirstlightUI\NativeComponent:

use FirstlightUI\NativeComponent;

class ServerScreen extends NativeComponent
{
    public ?string $tab = 'overview';

    public array $tabs = [
        'overview' => 'Overview',
        'sites' => 'Sites',
        'deploys' => 'Deployments',
    ];
}
<firstlight:tabs native:model="tab" :tabs="$tabs" label="Server sections" />

@if ($tab === 'overview')
    …
@endif

Selection is server-authoritative: a tap proposes a stable value, and the value PHP publishes decides what is shown. The same markup renders a native segmented control on iOS and Material 3 tabs on Android.

Components

Group Components
Actions Button, Icon Button
Choices Checkbox, Choice Group, Pill Group, Segmented, Select, Slider, Stepper, Switch, Tabs
Text Text Field, Text Area, Search Field, Code Editor
Dates and media Date Picker, Time Picker, Media
Lists List, List Section, List Item
Overlays Alert Dialog, Confirmation Dialog, Modal, Bottom Sheet
Status and feedback Activity Indicator, Progress, Badge, Status Label, Callout, Transient Feedback

Layout and navigation chrome, such as stacks, top bars, and bottom tab bars, stay in NativePHP Mobile UI.

Laravel extensions

Concerns on NativeComponent connect Laravel to existing native controls:

  • ValidatesFields: validate(), validateOnly(), and Form Requests, with messages on native field error slots.
  • SubmitsForms: validate, run an action once, and publish success Feedback.
  • AuthorizesActions: hide, disable, or guard actions with Gates and Policies.
  • PaginatesLists: bind Laravel paginators to List @refresh and @endReached.
  • DestroysListItems: authorized, confirmed deletion of List rows by stable key.

Firstlight-owned labels use Laravel's lang files, and Date and Time pickers inherit the application locale and timezone. See Localize chrome.

Warnings use the theme's warning / on-warning pair, with amber defaults independent of brand accent. List Item supports semantic icon tones and nullable optional text. See Theming and List Item.

Use Feedback::fake() to assert application feedback without native presentation; see Feedback testing. For forms submitted by a separate button, use live text binding until cross-platform blur-before-press ordering is available; see Text Field.

Response contract

Firstlight stamps each complete screen response with a process-wide increasing revision, so an otherwise identical response still reaches the native renderers. Blade render paths are automatic. Hand-built Element roots must return $this->response($element). Streaming is disabled. See the response contract and limitations.

Documentation

Start with the documentation index or firstlightui.dev. Design rules live in the Firstlight constitution.

Licence

MIT