Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
91db92f
docs(mobile/4): custom fonts + leading-* line height
shanerbaner82 Jul 11, 2026
4b4554a
docs(mobile/v4): document --core-v4 plugin uninstall flag in the upgr…
shanerbaner82 Jul 11, 2026
8206c4c
docs(mobile/v4): Floating overlay section in SuperNative layouts
shanerbaner82 Jul 11, 2026
54868f9
docs(mobile/v4): text inputs — bare variant, keep-focus-on-submit, co…
shanerbaner82 Jul 11, 2026
de4f42f
docs(mobile/v4): selection controls — drop no-op slider size, sync pr…
shanerbaner82 Jul 11, 2026
7b1a01d
docs(mobile/v4): buttons & indicators — icon element API, per-platfor…
shanerbaner82 Jul 11, 2026
2368b0b
docs(mobile/v4): lists — plain prop, Element-only toggle callbacks, p…
shanerbaner82 Jul 11, 2026
5896e69
docs(mobile/v4): drawer & floating-overlay builder APIs and per-scree…
shanerbaner82 Jul 11, 2026
9c61acf
docs(mobile/v4): overlays & tabs — a11y-hint, carousel a11y + clip sh…
shanerbaner82 Jul 11, 2026
e2a5b56
docs(mobile/v4): gestures — document only the shipped animation surface
shanerbaner82 Jul 11, 2026
e6582b7
docs(mobile/v4): core element fixes — divider example, rect children,…
shanerbaner82 Jul 11, 2026
08a9d30
docs(mobile/v4): command reference — add the missing commands
shanerbaner82 Jul 11, 2026
ef70041
docs(mobile/v4): icons — point enum examples at native-ui:generate-icons
shanerbaner82 Jul 11, 2026
20b8d7f
docs(mobile/v4): routing — @navigate directive; pressable — @doubleTa…
shanerbaner82 Jul 11, 2026
7ae779a
docs(mobile/v4): typography — full text styling surface, complete cla…
shanerbaner82 Jul 11, 2026
74a7717
docs(mobile/v4): new pages for lazy-grid and refreshable
shanerbaner82 Jul 11, 2026
3cd0eef
docs(mobile/v4): per-screen chrome — TabBarOptions, full NavBarOption…
shanerbaner82 Jul 11, 2026
2796f5d
docs(mobile/v4): testing — assertDontSee, assertNotSet, assertTransition
shanerbaner82 Jul 11, 2026
06203da
docs(mobile/4): chrome fonts + single-file weight caveat
shanerbaner82 Jul 12, 2026
c187fd5
Mobile v4: document the color value grammar
shanerbaner82 Jul 12, 2026
b668ae3
docs(mobile/4): live-preview overhaul of every edge-component example
shanerbaner82 Jul 12, 2026
2a8f3d8
docs(mobile/4): fix badge anchor example — negative insets can't righ…
shanerbaner82 Jul 12, 2026
5fd6544
docs(mobile/4): list-item checkbox interactivity + honest pull-to-ref…
shanerbaner82 Jul 12, 2026
c73461e
docs(mobile/4): digging-deeper examples are all code-only (static)
shanerbaner82 Jul 12, 2026
8d12b76
Merge pull request #427 from NativePHP/docs/mobile-v4-live-examples
shanerbaner82 Jul 12, 2026
bf04524
docs(mobile/4): dark-mode legibility follow-ups — theme tokens on bar…
shanerbaner82 Jul 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions resources/views/docs/mobile/4/digging-deeper/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Every element accepts two attributes:
- `a11y-hint` - Supplementary usage guidance, announced after the label (e.g. "Double-tap to open settings").

@verbatim
```blade
```blade static
<native:button icon="gear" a11y-label="Settings" @press="openSettings" />
<native:slider :value="$volume" a11y-label="Volume" a11y-hint="Adjusts playback volume" />
```
Expand Down Expand Up @@ -48,7 +48,7 @@ isn't descriptive enough on its own.
mystery to screen reader users.

@verbatim
```blade
```blade static
{{-- Bad: VoiceOver has nothing meaningful to announce --}}
<native:button icon="trash" variant="destructive" @press="deleteItem" />

Expand All @@ -63,7 +63,7 @@ Standalone `<native:icon />` elements are **decorative by default** — they are
unless you give them an `a11y-label`. If an icon conveys meaning on its own (or is tappable), label it:

@verbatim
```blade
```blade static
<native:icon name="wifi_off" a11y-label="No internet connection" />
```
@endverbatim
Expand All @@ -72,7 +72,7 @@ Images take an `alt` attribute, mirroring the web. With `alt`, the image is anno
is treated as decorative and skipped:

@verbatim
```blade
```blade static
<native:image src="{{ $product->photo }}" alt="{{ $product->name }}" :height="200" />
```
@endverbatim
Expand All @@ -82,7 +82,7 @@ is treated as decorative and skipped:
The tappable trailing icon button on a [list item](../edge-components/list) takes its own label via `trailing-a11y-label`:

@verbatim
```blade
```blade static
<native:list-item
headline="Backups"
trailingIconButton="info"
Expand Down
6 changes: 3 additions & 3 deletions resources/views/docs/mobile/4/digging-deeper/data-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Livewire's `wire:model`. Type into a field, toggle a switch, drag a slider, and
PHP side; change the property in PHP and the control reflects it on the next render.

@verbatim
```blade
```blade static
<native:text-input native:model="name" placeholder="Your name" />
```
@endverbatim
Expand Down Expand Up @@ -52,7 +52,7 @@ useful for text inputs where syncing on every character is wasteful:
| `native:model.debounce.300ms` | After the user stops changing it for the given delay. |

@verbatim
```blade
```blade static
{{-- Sync only when the user leaves the field --}}
<native:text-input native:model.blur="email" />

Expand Down Expand Up @@ -87,7 +87,7 @@ properties, derive the rest with computed methods, and let the UI re-render itse
something other than a public property — set the value and change handler directly:

@verbatim
```blade
```blade static
<native:text-input :value="$name" @change="rename" />
```
@endverbatim
Expand Down
33 changes: 12 additions & 21 deletions resources/views/docs/mobile/4/digging-deeper/gestures.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ If you've used Reanimated in React Native, this is the same idea.
Create one in PHP with `SharedValue::make($initial)`, bind it to a gesture, and read it from any animatable prop:

@verbatim
```blade
```blade static
@php $drag = \Native\Mobile\Edge\SharedValue::make(); @endphp

<native:gesture-area :pan-y="$drag" @drag-end="onRelease">
<native:gesture-area :pan-y="$drag">
<native:column
:translate-y="$drag"
:opacity="$drag->interpolate([0, 200], [1, 0])"
Expand Down Expand Up @@ -49,26 +49,17 @@ derived value, so one gesture can drive many props differently:
$drag->interpolate([0, 200], [1, 0]); // 0→1, 200→0, fully faded past 200
```

Animatable props that accept a shared value: `translate-x`, `translate-y`, `scale`, `rotate`, and `opacity`.

## Reacting when the gesture ends

Per-frame values stay on the native side, but you often need PHP to make a decision when the user lets go — commit
or snap back. The [`<native:gesture-area>`](../edge-components/gesture-area) fires `@drag-end` with the final
value:
Formulas are chainable — each call returns a new derived value, so you can stack them:

```php
public function onRelease(float $value): void
{
if ($value > 150) {
$this->dismiss(); // dragged far enough — commit
}
// otherwise the view springs back to its resting position
}
$drag->clamp(0, 200)->multiply(0.5)->add(20);
```

Call `->value()` on a shared value inside such a handler to read its PHP-side snapshot (with any formula applied)
if you need the derived number rather than the raw translation.
Animatable props that accept a shared value: `translate-x`, `translate-y`, `scale`, `rotate`, and `opacity`.

Everything above runs natively on the UI thread — as the finger moves, the bound props update at the display's
refresh rate with no PHP involved. If you need the PHP-side number (for example, the current snapshot with its
formula applied), call `->value()` on the shared value.

## Property animations

Expand All @@ -77,7 +68,7 @@ change in `animate-duration` (milliseconds) and the element eases from its old v
render. The animatable props are `translate-x`, `translate-y`, `scale`, `rotate`, and `opacity`:

@verbatim
```blade
```blade static
{{-- A panel slides up from below when $shown flips to true --}}
<native:column
:translate-y="$shown ? 0 : 120"
Expand All @@ -104,7 +95,7 @@ Combine transforms freely under one duration — a card can slide, fade, and sca
Set `animate-loop` to repeat an animation continuously — a pulsing dot, a breathing highlight:

@verbatim
```blade
```blade static
<native:column :scale="$pulsing ? 1.15 : 1.0" :animate-duration="600" :animate-loop="true">
<native:icon name="heart.fill" />
</native:column>
Expand All @@ -122,7 +113,7 @@ back on release:
- `press-translate-y` — nudge down while pressed (e.g. `3`)

@verbatim
```blade
```blade static
<native:pressable :press-scale="0.92" :press-opacity="0.85" :press-translate-y="3" @press="open">
<native:text>Press me</native:text>
</native:pressable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Livewire's updated hooks. The hook name is `updated` + the studly-cased property
value.

@verbatim
```blade
```blade static
<native:text-input native:model="query" />
```
@endverbatim
Expand Down
4 changes: 2 additions & 2 deletions resources/views/docs/mobile/4/digging-deeper/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CartScreen extends NativeComponent
Access it as `$this->total` (no parentheses) in PHP, or `@{{ $this->total }}` in the view:

@verbatim
```blade
```blade static
<native:text>Total: {{ $this->total }}</native:text>
```
@endverbatim
Expand Down Expand Up @@ -82,7 +82,7 @@ You can also drive a re-render from the view with `native:poll` — useful for a
without wiring a method:

@verbatim
```blade
```blade static
<native:text native:poll="1s">{{ now()->format('g:i:s A') }}</native:text>
```
@endverbatim
Expand Down
32 changes: 31 additions & 1 deletion resources/views/docs/mobile/4/digging-deeper/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,42 @@ on that surface. Pairing them this way is what keeps contrast correct across lig
Plus non-color tokens: `radius-sm|md|lg|full`, `font-sm|md|lg|xl`, and `font-family` (`System` resolves to San
Francisco on iOS / Roboto on Android; set a family name to load a custom font).

Disabled controls draw from the `surface-variant` (fill) and `on-surface-variant` (label) pair on both
platforms — tune disabled contrast by adjusting those two tokens, not per-component.

## Color values

Anywhere you author a color — a theme token, an element color prop (`headline-color`, badge colors, swipe-action
tints), or an arbitrary-value class (`bg-[#…]`) — the same formats are accepted:

| Format | Examples |
| --- | --- |
| Hex | `#B91C1C`, `#F00` |
| Hex with alpha — CSS `#RRGGBBAA` order | `#8B5CF680` |
| Tailwind palette name | `red-300`, `orange-800` |
| Named | `white`, `black`, `transparent` |
| Opacity modifier on any of the above | `red-300/20`, `#8B5CF6/50` |

```php
'light' => [
'primary' => 'violet-600', // Tailwind palette name
'secondary' => 'fuchsia-500/70', // opacity modifier → tonal fill
'surface' => '#F8FAFC', // plain hex
'accent' => '#00AAA680', // hex with alpha (#RRGGBBAA)
],
```

Alpha hex is always authored in CSS `#RRGGBBAA` order — the framework converts to what each platform expects.
Components render color tokens **solid**; when you want a translucent or tonal fill, put the opacity on the token
(`'secondary' => 'fuchsia-500/70'`) rather than expecting the renderer to soften it. Dark-mode auto-derivation
preserves the alpha byte.

## Using tokens in a screen

Reference any token from Blade with the `theme-{token}` class suffix, on background, text, and border utilities:

@verbatim
```blade
```blade static
<native:column class="bg-theme-surface border border-theme-outline rounded-2xl p-4">
<native:text class="text-theme-on-surface text-lg font-bold">Balance</native:text>
<native:text class="text-theme-on-surface-variant">Updated just now</native:text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ All [shared layout and style attributes](layout) are supported, plus:
- `size` - `"sm"`, `"md"` (default), or `"lg"` (optional, string). Legacy ints `1`=large, `2`=small are also accepted
- `color` - Spinner color as hex string (optional). Leave unset to use `theme.primary`
- `a11y-label` - Accessibility label (optional)
- `a11y-hint` - Accessibility hint (optional)

<aside>

Expand All @@ -38,18 +39,21 @@ a non-theme-styled container (e.g. a light spinner over a dark image overlay).

@verbatim
```blade
<native:column fill center>
<native:column class="w-full h-[200] items-center justify-center">
<native:activity-indicator size="lg" />
<native:text class="text-base text-theme-on-surface-variant mt-4">Loading...</native:text>
</native:column>
```
@endverbatim

On a real loading screen, use `<native:column fill center>` at the page root instead — the fixed `h-[200]` here just
gives the example a bounded area to center in.

### Inline loading

@verbatim
```blade
<native:row :gap="8" :align-items="1">
<native:row class="gap-2 items-center">
<native:activity-indicator size="sm" />
<native:text class="text-sm text-theme-on-surface-variant">Refreshing</native:text>
</native:row>
Expand Down Expand Up @@ -79,3 +83,4 @@ ActivityIndicator::make()
- `size(string|int $size)` - `"sm" | "md" | "lg"`. Legacy: `1`=large, `2`=small
- `color(string $hex)` - Override the theme tint
- `a11yLabel(string $value)` - Accessibility label
- `a11yHint(string $value)` - Accessibility hint
32 changes: 28 additions & 4 deletions resources/views/docs/mobile/4/edge-components/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ order: 110
A small count or text marker, typically used as an overlay on nav items, list rows, or buttons. Renders as a capsule
pill.

Per Model 3, colors come from the theme via the semantic `variant` prop — there are no per-instance overrides.
Colors come from the theme via the semantic `variant` prop — `destructive` (the default), `primary`, or `accent`.
Prefer `variant` for badge colors: it keeps the label legible on both platforms and in both light and dark themes.

@verbatim
```blade
Expand All @@ -25,6 +26,7 @@ Per Model 3, colors come from the theme via the semantic `variant` prop — ther
- `primary` — `theme.primary` / `theme.onPrimary`
- `accent` — `theme.accent` / `theme.onAccent`
- `a11y-label` - Accessibility label (optional)
- `a11y-hint` - Accessibility hint (optional)

<aside>

Expand All @@ -39,7 +41,7 @@ icon, see the `badge` and `news` props on [`<native:bottom-nav-item>`](bottom-na

@verbatim
```blade
<native:row :gap="8" :align-items="1">
<native:row class="gap-2 items-center">
<native:icon name="notifications" :size="24" />
<native:badge :count="$unreadCount" />
</native:row>
Expand All @@ -56,19 +58,40 @@ icon, see the `badge` and `news` props on [`<native:bottom-nav-item>`](bottom-na

### Anchored to an icon

Use a [`<native:stack>`](stack) to layer the badge over its target:
Use a [`<native:stack>`](stack) to layer the badge over its target. Size the stack a little larger than the
icon so the badge has a corner to sit in, and position it with positive `top-*` / `right-*` insets — the
renderer anchors an absolute child to whichever edges you set (negative insets are not supported):

@verbatim
```blade
<native:stack :width="40" :height="40">
<native:icon name="cart" :size="32" />
<native:column class="absolute" :top="-2" :right="-2">
<native:column class="absolute top-px right-px">
<native:badge :count="$cartItems" />
</native:column>
</native:stack>
```
@endverbatim

### Custom background (iOS only)

On iOS you can override the capsule fill with a `bg-*` class and the radius with a `rounded-*` class:

@verbatim
```blade static
<native:badge label="Beta" class="bg-amber-600 rounded-md" />
```
@endverbatim

<aside>

Per-instance overrides are currently iOS-only: Android ignores `bg-*` and `rounded-*` on badges and always paints
the variant's colors. The label also keeps the variant's on-color (white for the default `destructive`) even over a
custom background, so pick a dark fill like `bg-amber-600` to keep the text legible. Prefer `variant` when you need
colors that work on both platforms.

</aside>

## Element

```php
Expand All @@ -88,3 +111,4 @@ Badge::make()
- `label(string $text)` - Short text label (wins over `count`)
- `variant(string $variant)` - `destructive | primary | accent`
- `a11yLabel(string $value)` - Accessibility label
- `a11yHint(string $value)` - Accessibility hint
Loading
Loading