You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/native-stack-navigator.md
+59-7Lines changed: 59 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -450,7 +450,7 @@ Function which returns an array of items to display as on the left side of the h
450
450
Example:
451
451
452
452
```js
453
-
unstable_headerLeftItems: () => [
453
+
unstable_headerRightItems: () => [
454
454
{
455
455
type:'button',
456
456
title:'Edit',
@@ -1527,6 +1527,25 @@ Common properties:
1527
1527
-`fontWeight`
1528
1528
-`color`
1529
1529
-`icon`: Optional icon to show instead of the label.
1530
+
1531
+
The icon can be an image:
1532
+
1533
+
```js
1534
+
{
1535
+
type:'image',
1536
+
source:require('./path/to/image.png'),
1537
+
}
1538
+
```
1539
+
1540
+
Or a [SF Symbols](https://developer.apple.com/sf-symbols/) name:
1541
+
1542
+
```js
1543
+
{
1544
+
type:'sfsymbol',
1545
+
name:'heart',
1546
+
}
1547
+
```
1548
+
1530
1549
-`variant`: Visual variant of the button. Supported values:
1531
1550
-`plain` (default)
1532
1551
-`done`
@@ -1555,10 +1574,14 @@ Supported properties when `type` is `button`:
1555
1574
Example:
1556
1575
1557
1576
```js
1558
-
unstable_headerLeftItems: () => [
1577
+
unstable_headerRightItems: () => [
1559
1578
{
1560
1579
type:'button',
1561
1580
label:'Edit',
1581
+
icon: {
1582
+
type:'sfsymbol',
1583
+
name:'pencil',
1584
+
},
1562
1585
onPress: () => {
1563
1586
// Do something
1564
1587
},
@@ -1570,12 +1593,23 @@ Supported properties when `type` is `menu`:
1570
1593
1571
1594
-`changesSelectionAsPrimaryAction`: Whether the menu is a selection menu. Tapping an item in a selection menu will add a checkmark to the selected item. Defaults to `false`.
1572
1595
-`menu`: An object containing the menu items. It contains the following properties:
1596
+
1573
1597
-`title`: Optional title to show on top of the menu.
1574
1598
-`items`: An array of menu items. A menu item can be either an `action` or a `submenu`.
1599
+
1575
1600
-`action`: An object with the following properties:
1601
+
1576
1602
-`type`: Must be `action`.
1577
1603
-`label`: Label of the menu item.
1578
-
-`icon`: Optional icon to show alongside the label.
1604
+
-`icon`: Optional icon to show alongside the label. The icon can be a [SF Symbols](https://developer.apple.com/sf-symbols/) name:
1605
+
1606
+
```js
1607
+
{
1608
+
type:'sfsymbol',
1609
+
name:'trash',
1610
+
}
1611
+
```
1612
+
1579
1613
-`onPress`:Function to call when the menu item is pressed.
1580
1614
-`state`: Optional state of the menu item. Supported values:
1581
1615
-`on`
@@ -1586,25 +1620,43 @@ Supported properties when `type` is `menu`:
1586
1620
-`hidden`: Whether the menu item is hidden.
1587
1621
-`keepsMenuPresented`: Whether to keep the menu open after selecting thisitem. Defaults to `false`.
1588
1622
-`discoverabilityLabel`: An elaborated title that explains the purpose of the action.
1623
+
1589
1624
-`submenu`: An object with the following properties:
1625
+
1590
1626
-`type`: Must be `submenu`.
1591
1627
-`label`: Label of the submenu item.
1592
-
-`icon`: Optional icon to show alongside the label.
1628
+
-`icon`: Optional icon to show alongside the label. The icon can be a [SF Symbols](https://developer.apple.com/sf-symbols/) name:
1629
+
1630
+
```js
1631
+
{
1632
+
type: 'sfsymbol',
1633
+
name: 'pencil',
1634
+
}
1635
+
```
1636
+
1593
1637
-`items`: An array of menu items (can be either `action` or `submenu`).
0 commit comments