Skip to content

Commit 61251f6

Browse files
docs: Native Stack - header options (#1353)
* chore(docs): Added screenshots to some header options * chore(docs): Added more screenshots to header options * [autofix.ci] apply automated fixes * chore(docs): Added screenshots to headerLeft and headerRight option * [autofix.ci] apply automated fixes * chore(docs): Added all headerBlurEffect screenshots * [autofix.ci] apply automated fixes * chore(docs): Added screenshots for headerTitleAlign and headerTitleStyle * [autofix.ci] apply automated fixes * docs: deleted unnecessary picture --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7b313e5 commit 61251f6

33 files changed

+124
-0
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Loading
25.8 KB
Loading
41.7 KB
Loading
Loading
Loading
975 KB
Binary file not shown.
Loading
Loading
Loading
Loading

versioned_docs/version-7.x/native-stack-navigator.md

+124
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,25 @@ Supported properties:
231231

232232
Only supported on iOS.
233233

234+
<video playsInline autoPlay muted loop style={{ width: "500px" }}>
235+
236+
<source src="/assets/7.x/native-stack/headerLargeStyle.mp4" />
237+
</video>
238+
234239
#### `headerLargeTitle`
235240

236241
Whether to enable header with large title which collapses to regular header on scroll.
242+
Defaults to `false`.
237243

238244
For large title to collapse on scroll, the content of the screen should be wrapped in a scrollable view such as `ScrollView` or `FlatList`. If the scrollable area doesn't fill the screen, the large title won't collapse on scroll. You also need to specify `contentInsetAdjustmentBehavior="automatic"` in your `ScrollView`, `FlatList` etc.
239245

240246
Only supported on iOS.
241247

248+
<video playsInline autoPlay muted loop style={{ width: "500px" }}>
249+
250+
<source src="/assets/7.x/native-stack/headerLargeTitle.mp4" />
251+
</video>
252+
242253
#### `headerLargeTitleShadowVisible`
243254

244255
Whether drop shadow of header is visible when a large title is shown.
@@ -254,6 +265,19 @@ Style object for large title in header. Supported properties:
254265

255266
Only supported on iOS.
256267

268+
<img src="/assets/7.x/native-stack/headerLargeTitleStyle.png" width="500" alt="Header large title style" />
269+
270+
Example:
271+
272+
```js
273+
headerLargeTitleStyle: {
274+
fontFamily: 'Georgia',
275+
fontSize: 22,
276+
fontWeight: '500',
277+
color: 'blue',
278+
},
279+
```
280+
257281
#### `headerShown`
258282

259283
Whether to show the header. The header is shown by default. Setting this to `false` hides the header.
@@ -264,10 +288,21 @@ Style object for header. Supported properties:
264288

265289
- `backgroundColor`
266290

291+
<video playsInline autoPlay muted loop style={{ width: "500px" }}>
292+
293+
<source src="/assets/7.x/native-stack/headerStyle.mp4" />
294+
</video>
295+
267296
#### `headerShadowVisible`
268297

269298
Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.
270299

300+
Android:
301+
<img src="/assets/7.x/native-stack/headerShadowVisible-Android.png" width="500" alt="Header shadow visible Android" />
302+
303+
iOS:
304+
<img src="/assets/7.x/native-stack/headerShadowVisible-iOS.png" width="500" alt="Header shadow visible iOS" />
305+
271306
#### `headerTransparent`
272307

273308
Boolean indicating whether the navigation bar is translucent.
@@ -287,44 +322,117 @@ Blur effect for the translucent header. The `headerTransparent` option needs to
287322
Supported values:
288323

289324
- `extraLight`
325+
290326
- `light`
327+
<img src="/assets/7.x/native-stack/headerBlurEffect-light.png" width="500" alt="Header blur effect light" />
328+
291329
- `dark`
330+
<img src="/assets/7.x/native-stack/headerBlurEffect-dark.png" width="500" alt="Header blur effect dark" />
331+
292332
- `regular`
333+
<img src="/assets/7.x/native-stack/headerBlurEffect-regular.png" width="500" alt="Header blur effect regular" />
334+
293335
- `prominent`
336+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemUltraThinMaterial.png" width="500" alt="Header blur effect systemUltraThinMaterial" />
337+
294338
- `systemUltraThinMaterial`
339+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemUltraThinMaterial.png" width="500" alt="Header blur effect systemUltraThinMaterial" />
340+
295341
- `systemThinMaterial`
342+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemThinMaterial.png" width="500" alt="Header blur effect systemThinMaterial" />
343+
296344
- `systemMaterial`
345+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemMaterial.png" width="500" alt="Header blur effect systemMaterial" />
346+
297347
- `systemThickMaterial`
348+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemThickMaterial.png" width="500" alt="Header blur effect systemThickMaterial" />
349+
298350
- `systemChromeMaterial`
351+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemChromeMaterial.png" width="500" alt="Header blur effect systemChromeMaterial" />
352+
299353
- `systemUltraThinMaterialLight`
354+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemUltraThinMaterialLight.png" width="500" alt="Header blur effect systemUltraThinMaterialLight" />
355+
300356
- `systemThinMaterialLight`
357+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemThinMaterialLight.png" width="500" alt="Header blur effect systemThinMaterialLight" />
358+
301359
- `systemMaterialLight`
360+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemMaterialLight.png" width="500" alt="Header blur effect systemMaterialLight" />
361+
302362
- `systemThickMaterialLight`
363+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemThickMaterialLight.png" width="500" alt="Header blur effect systemThickMaterialLight" />
364+
303365
- `systemChromeMaterialLight`
366+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemChromeMaterialLight.png" width="500" alt="Header blur effect systemChromeMaterialLight" />
367+
304368
- `systemUltraThinMaterialDark`
369+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemUltraThinMaterialDark.png" width="500" alt="Header blur effect systemUltraThinMaterialDark" />
305370
- `systemThinMaterialDark`
371+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemThinMaterialDark.png" width="500" alt="Header blur effect systemThinMaterialDark" />
372+
306373
- `systemMaterialDark`
374+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemMaterialDark.png" width="500" alt="Header blur effect systemMaterialDark" />
307375
- `systemThickMaterialDark`
376+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemThickMaterialDark.png" width="500" alt="Header blur effect systemThickMaterialDark" />
377+
308378
- `systemChromeMaterialDark`
379+
<img src="/assets/7.x/native-stack/headerBlurEffect-systemChromeMaterialDark.png" width="500" alt="Header blur effect systemChromeMaterialDark" />
309380

310381
Only supported on iOS.
311382

312383
#### `headerBackground`
313384

314385
Function which returns a React Element to render as the background of the header. This is useful for using backgrounds such as an image or a gradient.
315386

387+
<img src="/assets/7.x/native-stack/headerBackground.png" width="500" alt="Header background"/>
388+
389+
Example:
390+
391+
```js
392+
headerBackground: () => (
393+
<LinearGradient
394+
colors={['#c17388', '#90306f']}
395+
style={{ flex: 1 }}
396+
start={{ x: 0, y: 0 }}
397+
end={{ x: 1, y: 0 }}
398+
/>
399+
),
400+
```
401+
316402
#### `headerTintColor`
317403

318404
Tint color for the header. Changes the color of back button and title.
319405

406+
<img src="/assets/7.x/native-stack/headerTintColor.png" width="500" alt="Header tint color" />
407+
320408
#### `headerLeft`
321409

322410
Function which returns a React Element to display on the left side of the header. This replaces the back button. See `headerBackVisible` to show the back button along side left element.
323411

412+
<img src="/assets/7.x/native-stack/headerLeft.png" width="500" alt="Header right"/>
413+
414+
Example:
415+
416+
```js
417+
headerLeft: () => (
418+
<MaterialCommunityIcons name="map" color="gray" size={36} />
419+
),
420+
headerBackVisible: true,
421+
headerBackTitle: 'Back',
422+
```
423+
324424
#### `headerRight`
325425

326426
Function which returns a React Element to display on the right side of the header.
327427

428+
<img src="/assets/7.x/native-stack/headerRight.png" width="500" alt="Header right"/>
429+
430+
Example:
431+
432+
```js
433+
headerRight: () => <MaterialCommunityIcons name="map" color="blue" size={36} />;
434+
```
435+
328436
#### `headerTitle`
329437

330438
String or a function that returns a React Element to be used by the header. Defaults to `title` or name of the screen.
@@ -338,7 +446,10 @@ Note that if you render a custom element by passing a function, animations for t
338446
How to align the header title. Possible values:
339447

340448
- `left`
449+
<img src="/assets/7.x/native-stack/headerTitleAlign-left.png" width="500" alt="Header title align left"/>
450+
341451
- `center`
452+
<img src="/assets/7.x/native-stack/headerTitleAlign-center.png" width="500" alt="Header title align center"/>
342453

343454
Defaults to `left` on platforms other than iOS.
344455

@@ -353,6 +464,19 @@ Style object for header title. Supported properties:
353464
- `fontWeight`
354465
- `color`
355466

467+
<img src="/assets/7.x/native-stack/headerTitleStyle.png" width="500" alt="Header title style"/>
468+
469+
Example:
470+
471+
```js
472+
headerTitleStyle: {
473+
color: 'blue',
474+
fontSize: 22,
475+
fontFamily: 'Georgia',
476+
fontWeight: 300,
477+
},
478+
```
479+
356480
#### `headerSearchBarOptions`
357481

358482
Options to render a native search bar on iOS. Search bars are rarely static so normally it is controlled by passing an object to `headerSearchBarOptions` navigation option in the component's body. You also need to specify `contentInsetAdjustmentBehavior="automatic"` in your `ScrollView`, `FlatList` etc. If you don't have a `ScrollView`, specify `headerTransparent: false`.

0 commit comments

Comments
 (0)