@@ -332,10 +332,28 @@ Function, that given `{ focused: boolean, color: string, size: number }` returns
332
332
333
333
Color for the icon and label in the active item in the drawer.
334
334
335
+ <img src =" /assets/7.x/drawer/drawerActiveTintColor.png " width =" 500 " alt =" Drawer active tint color " />
336
+
337
+ ``` js
338
+ drawerActiveTintColor: ' green' ,
339
+ ```
340
+
335
341
#### ` drawerActiveBackgroundColor `
336
342
337
343
Background color for the active item in the drawer.
338
344
345
+ <img src =" /assets/7.x/drawer/drawerActiveBackgroundColor.png " width =" 500 " alt =" Drawer active background color " />
346
+
347
+ ``` js
348
+ screenOptions= {{
349
+ drawerActiveTintColor: ' white' ,
350
+ drawerActiveBackgroundColor: ' #003CB3' ,
351
+ drawerLabelStyle: {
352
+ color: ' white' ,
353
+ },
354
+ }}
355
+ ```
356
+
339
357
#### ` drawerInactiveTintColor `
340
358
341
359
Color for the icon and label in the inactive items in the drawer.
@@ -348,10 +366,35 @@ Background color for the inactive items in the drawer.
348
366
349
367
Style object for the single item, which can contain an icon and/or a label.
350
368
369
+ <img src =" /assets/7.x/drawer/drawerItemStyle.png " width =" 500 " alt =" Drawer item style " />
370
+
371
+ Example:
372
+
373
+ ``` js
374
+ drawerItemStyle: {
375
+ backgroundColor: ' #9dd3c8' ,
376
+ borderColor: ' black' ,
377
+ orderWidth: 2 ,
378
+ opacity: 0.6 ,
379
+ },
380
+ ```
381
+
351
382
#### ` drawerLabelStyle `
352
383
353
384
Style object to apply to the ` Text ` style inside content section which renders a label.
354
385
386
+ <img src =" /assets/7.x/drawer/drawerLabelStyle.png " width =" 500 " alt =" Drawer label style " />
387
+
388
+ Example:
389
+
390
+ ``` js
391
+ drawerLabelStyle: {
392
+ color: ' black' ,
393
+ fontSize: 20 ,
394
+ fontFamily: ' Georgia' ,
395
+ },
396
+ ```
397
+
355
398
#### ` drawerContentContainerStyle `
356
399
357
400
Style object for the content section inside the ` ScrollView ` .
@@ -364,7 +407,7 @@ Style object for the wrapper view.
364
407
365
408
Style object for the drawer component. You can pass a custom background color for a drawer or a custom width here.
366
409
367
- <samp id = " drawer-with- style " />
410
+ <img src = " /assets/7.x/ drawer/drawerStyle.png " width = " 500 " alt = " Drawer style" />
368
411
369
412
``` js
370
413
< Drawer .Navigator
@@ -388,8 +431,20 @@ Options are `left` or `right`. Defaults to `left` for LTR languages and `right`
388
431
Type of the drawer. It determines how the drawer looks and animates.
389
432
390
433
- ` front ` : Traditional drawer which covers the screen with an overlay behind it.
434
+ <video playsInline autoPlay muted loop >
435
+ <source src =" /assets/7.x/drawer/drawerType-front.mp4 " />
436
+ </video >
437
+
391
438
- ` back ` : The drawer is revealed behind the screen on swipe.
439
+ <video playsInline autoPlay muted loop >
440
+ <source src =" /assets/7.x/drawer/drawerType-back.mp4 " />
441
+ </video >
442
+
392
443
- ` slide ` : Both the screen and the drawer slide on swipe to reveal the drawer.
444
+ <video playsInline autoPlay muted loop >
445
+ <source src =" /assets/7.x/drawer/drawerType-slide.mp4 " />
446
+ </video >
447
+
393
448
- ` permanent ` : A permanent drawer is shown as a sidebar. Useful for having always visible drawer on larger screens.
394
449
395
450
Defaults to ` slide ` on iOS and ` front ` on other platforms.
@@ -419,6 +474,10 @@ function MyDrawer() {
419
474
420
475
You can also specify other props such as ` drawerStyle ` based on screen size to customize the behavior. For example, you can combine it with ` defaultStatus="open" ` to achieve a master-detail layout:
421
476
477
+ <video playsInline autoPlay muted loop >
478
+ <source src =" /assets/7.x/drawer/drawerType-masterDetail.mp4 " />
479
+ </video >
480
+
422
481
``` js
423
482
import { useWindowDimensions } from ' react-native' ;
424
483
import { createDrawerNavigator } from ' @react-navigation/drawer' ;
@@ -451,20 +510,32 @@ When set to `true`, Drawer will hide the OS status bar whenever the drawer is pu
451
510
452
511
#### ` drawerStatusBarAnimation `
453
512
454
- Animation of the statusbar when hiding it. use in combination with ` hideStatusBar ` .
513
+ Animation of the statusbar when hiding it. use in combination with ` drawerHideStatusBarOnOpen ` .
514
+
515
+ This is only supported on iOS. Defaults to ` slide ` .
455
516
456
517
Supported values:
457
518
458
519
- ` slide `
520
+ <video playsInline autoPlay muted loop >
521
+ <source src =" /assets/7.x/drawer/drawerStatusBarAnimation-slide.mp4 " />
522
+ </video >
523
+
459
524
- ` fade `
460
- - ` none `
525
+ <video playsInline autoPlay muted loop >
526
+ <source src =" /assets/7.x/drawer/drawerStatusBarAnimation-fade.mp4 " />
527
+ </video >
461
528
462
- This is only supported on iOS. Defaults to ` slide ` .
529
+ - ` none `
463
530
464
531
#### ` overlayColor `
465
532
466
533
Color overlay to be displayed on top of the content view when drawer gets open. The opacity is animated from ` 0 ` to ` 1 ` when the drawer opens.
467
534
535
+ <video playsInline autoPlay muted loop >
536
+ <source src="/assets/7.x/drawer/overlayColor.mp4" />
537
+ </video >
538
+
468
539
#### ` sceneContainerStyle `
469
540
470
541
Style object for the component wrapping the screen content.
0 commit comments