- Getting Started
- The Basics
- Concepts
- SuperNative
-
EDGE Components
- Introduction
- Activity Indicator
- Badge
- Bottom Navigation
- Bottom Sheet
- Button
- Button Group
- Canvas
- Carousel
- Checkbox
- Chip
- Column
- Divider
- Gesture Area
- Icon
- Icons
- Image
- Layout & Styling
- List
- Menus
- Modal
- Pressable
- Progress Bar
- Radio Group
- Row
- Scroll View
- Select
- Shapes
- Side Navigation
- Slider
- Spacer
- Stack
- Tab Row
- Text
- Text Input
- Toggle
- Top Bar
- Virtual List
- Web View
- Plugins
- Testing
- Architecture
You're viewing pre-release documentation — version 4.x is in beta
Features, APIs and behaviour may change before the stable release. View the stable version (3.x)
Top Bar
Important
Prefer the Layout model. Declare your app's top bar with the NavBar
builder in a NativeLayout class rather than placing <native:top-bar> in a screen. This page documents the
inline element, which still works but is no longer the recommended approach.
Overview#


A top bar with title, subtitle, and action buttons. This renders at the top of the screen.
<native:top-bar title="Dashboard" subtitle="Welcome back"> <native:top-bar-action id="search" label="Search" icon="search" :url="route('search')" /> <native:top-bar-action id="settings" icon="settings" label="Settings" url="https://yourapp.com/my-account" /></native:top-bar>
Props#
title- The title text (required)subtitle- A small line under the title (optional)show-navigation-icon- Show the back chevron (optional, default:true)background-color- Background color. Hex string (optional)text-color- Title and icon color. Also flows to<native:top-bar-action>icons (optional)elevation- Hairline thickness at the bottom of the bar in dp (optional)
Children#
A <native:top-bar> can contain up to 10 <native:top-bar-action> elements. These are displayed on the trailing
edge of the bar.
On Android, the first 3 actions are shown as icon buttons; additional actions collapse into an overflow menu (⋮). On iOS, if more than 5 actions are provided, they collapse into an overflow menu.
<native:top-bar-action> Props#
Important
In the Layout model a top-bar action is a NavAction — use that
builder rather than placing <native:top-bar-action> inline.
id- Unique identifier (required)icon- A named icon (required)label- Text label for the action. Used for accessibility and displayed in overflow menus (optional but recommended)url- A URL to navigate to when tapped (optional)
Builder API#
When a <native:top-bar> is supplied by a layout, you build it fluently with the NavBar
and NavAction builders rather than writing it in Blade.
use Native\Mobile\Edge\Layouts\Builders\NavAction;use Native\Mobile\Edge\Layouts\Builders\NavBar; NavBar::make() ->title('SyncUp') ->subtitle('All caught up') ->back() ->backgroundColor('#0891b2') ->textColor('#FFFFFF') ->elevation(8) ->action(NavAction::make('search')->icon('search')->press('openSearch'));
NavBar methods#
make()- Create a new buildertitle(?string $title)- Title textsubtitle(?string $subtitle)- Small line under the titleback(bool $show = true)- Show the back chevronbackgroundColor(string $color)- Bar background colortextColor(string $color)- Title and icon tintelevation(int $px)- Hairline thickness at the bottom of the baraction(NavAction $action)- Append a trailing action
NavAction methods#
make(string $id)- Create an action with a unique idicon(string $icon)- A named iconlabel(string $label)- Accessibility / overflow-menu labelurl(string $url)- A URL to navigate to when tappedpress(string $method)- A Livewire-style method on the screen to invoke when tappedevent(string $event)- A native event name to dispatch (advanced)
Per-screen overrides#
Screens can contribute additional NavBar actions on top of what their layout supplies by overriding
navigationOptions():
use Native\Mobile\Edge\Layouts\Builders\NavAction;use Native\Mobile\Edge\Layouts\Builders\NavBarOptions;use Native\Mobile\Edge\NativeComponent; class ItemDetail extends NativeComponent{ public function navigationOptions(): ?NavBarOptions { return NavBarOptions::make() ->title("Item #{$this->param('id')}") ->action(NavAction::make('save')->icon('save')->press('save')); } public function save(): void { // ... }}
See Layouts for the full picture.
in no time