Skip to content

Commit 19d103b

Browse files
docs: Drawer v7. (#1356)
* docs: Adeed videos for Drawer's options * docs: Adeed screenshots for Drawer's options * [autofix.ci] apply automated fixes * docs(Drawer): uploaded better photo --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 971d34f commit 19d103b

13 files changed

+75
-4
lines changed
Loading
Loading
67.5 KB
Loading
34.4 KB
Loading
Binary file not shown.
Binary file not shown.
83.6 KB
Loading
1.01 MB
Binary file not shown.
791 KB
Binary file not shown.
Binary file not shown.
1020 KB
Binary file not shown.
984 KB
Binary file not shown.

versioned_docs/version-7.x/drawer-navigator.md

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,28 @@ Function, that given `{ focused: boolean, color: string, size: number }` returns
332332

333333
Color for the icon and label in the active item in the drawer.
334334

335+
<img src="/assets/7.x/drawer/drawerActiveTintColor.png" width="500" alt="Drawer active tint color" />
336+
337+
```js
338+
drawerActiveTintColor: 'green',
339+
```
340+
335341
#### `drawerActiveBackgroundColor`
336342

337343
Background color for the active item in the drawer.
338344

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+
339357
#### `drawerInactiveTintColor`
340358

341359
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.
348366

349367
Style object for the single item, which can contain an icon and/or a label.
350368

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+
351382
#### `drawerLabelStyle`
352383

353384
Style object to apply to the `Text` style inside content section which renders a label.
354385

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+
355398
#### `drawerContentContainerStyle`
356399

357400
Style object for the content section inside the `ScrollView`.
@@ -364,7 +407,7 @@ Style object for the wrapper view.
364407

365408
Style object for the drawer component. You can pass a custom background color for a drawer or a custom width here.
366409

367-
<samp id="drawer-with-style" />
410+
<img src="/assets/7.x/drawer/drawerStyle.png" width="500" alt="Drawer style" />
368411

369412
```js
370413
<Drawer.Navigator
@@ -388,8 +431,20 @@ Options are `left` or `right`. Defaults to `left` for LTR languages and `right`
388431
Type of the drawer. It determines how the drawer looks and animates.
389432

390433
- `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+
391438
- `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+
392443
- `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+
393448
- `permanent`: A permanent drawer is shown as a sidebar. Useful for having always visible drawer on larger screens.
394449

395450
Defaults to `slide` on iOS and `front` on other platforms.
@@ -419,6 +474,10 @@ function MyDrawer() {
419474

420475
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:
421476

477+
<video playsInline autoPlay muted loop>
478+
<source src="/assets/7.x/drawer/drawerType-masterDetail.mp4" />
479+
</video>
480+
422481
```js
423482
import { useWindowDimensions } from 'react-native';
424483
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
451510

452511
#### `drawerStatusBarAnimation`
453512

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`.
455516

456517
Supported values:
457518

458519
- `slide`
520+
<video playsInline autoPlay muted loop>
521+
<source src="/assets/7.x/drawer/drawerStatusBarAnimation-slide.mp4" />
522+
</video>
523+
459524
- `fade`
460-
- `none`
525+
<video playsInline autoPlay muted loop>
526+
<source src="/assets/7.x/drawer/drawerStatusBarAnimation-fade.mp4" />
527+
</video>
461528

462-
This is only supported on iOS. Defaults to `slide`.
529+
- `none`
463530

464531
#### `overlayColor`
465532

466533
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.
467534

535+
<video playsInline autoPlay muted loop>
536+
<source src="/assets/7.x/drawer/overlayColor.mp4" />
537+
</video>
538+
468539
#### `sceneContainerStyle`
469540

470541
Style object for the component wrapping the screen content.

0 commit comments

Comments
 (0)