2.9.1 • Published 5 days ago

@gravity-ui/navigation v2.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

@gravity-ui/navigation · npm package CI storybook

Aside Header Navigation · Preview →

npm.io

Install

npm install @gravity-ui/navigation

Ensure that peer dependencies are installed in your project

npm install --dev @gravity-ui/uikit@^3.0.2 @bem-react/classname@1.6.0 react@^16.0.0

Components

  • AsideHeader
  • MobileHeader
  • FooterItem
  • MobileHeaderFooterItem
  • Drawer
  • DrawerItem
  • PageLayout
  • PageLayoutAside
  • AsideFallback
  • Logo
  • MobileLogo
  • Footer
  • MobileFooter

Optimization

If your app content needs to be rendered faster than by passing it throw AsideHeader props, you may need to switch usage of AsideHeader to advanced style with PageLayout like this:

--- Main.tsx
+++ Main.tsx
-import {AsideHeader} from './AsideHeader'
+import {PageLayout, AsideFallback} from '@gravity-ui/navigation';
+const Aside = React.lazy(() =>
+    import('./Aside').then(({Aside}) => ({ default: Aside }))
+);

-    <AsideHeader renderContent={renderContent} {...restProps} />
+    <PageLayout>
+        <Suspense fallback={<AsideFallback />}>
+           <Aside />
+        </Suspense>
+
+        <PageLayout.Content>
+            <ContentExample />
+        </PageLayout.Content>
+    </PageLayout>
--- Aside.tsx
+++ Aside.tsx
-import {AsideHeader} from '@gravity-ui/navigation';
+import {PageLayoutAside} from '@gravity-ui/navigation';

export const Aside: FC = () => {
    return (
-        <AsideHeader {...props}>
+        <PageLayoutAside {...props}/>
    );
};

Imports

import {AsideHeader} from '@gravity-ui/navigation';

CSS variables

Used for themization Navigation's components

AsideHeader vars

NameDescriptionDefault
--gn-aside-header-decoration-collapsed-background-colorDecoration color for collapsed navigation--g-color-base-warning-light
--gn-aside-header-decoration-expanded-background-colorDecoration color for expanded navigation--g-color-base-warning-light
--gn-aside-header-background-colorNavigation background color--g-color-base-background
--gn-aside-header-divider-horizontal-colorAll horizontal divider line color--g-color-line-generic
--gn-aside-header-divider-vertical-colorVertical divider line color between AsideHeader and content--g-color-line-generic
--gn-aside-top-panel-heightRead only.AsideHeader top alert height0px
Item
--gn-aside-header-general-item-icon-colorIcon color for Subheader and Footer items--g-color-text-primary
--gn-aside-header-item-icon-colorIcon color for CompositeBar items--g-color-text-misc
--gn-aside-header-item-text-color--g-color-text-primary
--gn-aside-header-item-background-color-hover--g-color-base-simple-hover
Current Item
--gn-aside-header-item-current-background-color--g-color-base-selection
--gn-aside-header-item-current-icon-color
--gn-aside-header-item-current-text-color--g-color-text-primary
--gn-aside-header-item-current-background-color-hover
2.9.1

5 days ago

2.9.0

14 days ago

2.8.1

17 days ago

2.8.0

21 days ago

2.7.1

22 days ago

2.7.0

1 month ago

2.6.0

1 month ago

2.4.2

1 month ago

2.5.0

1 month ago

2.4.1

2 months ago

2.4.0

2 months ago

1.10.3

2 months ago

1.10.2

2 months ago

2.3.1

2 months ago

2.3.0

2 months ago

2.2.0

3 months ago

2.1.2

3 months ago

1.10.1

3 months ago

1.10.0

3 months ago

2.1.1

3 months ago

2.1.0

3 months ago

2.0.0

3 months ago

2.0.0-beta.0

3 months ago

1.9.0

3 months ago

1.8.4

4 months ago

1.8.3

5 months ago

1.8.2

5 months ago

1.8.1

5 months ago

1.8.0

5 months ago

1.2.0

6 months ago

1.0.0

7 months ago

0.20.0

7 months ago

1.6.2

6 months ago

1.6.1

6 months ago

1.6.0

6 months ago

1.4.2

6 months ago

1.4.1

6 months ago

1.4.0

6 months ago

0.19.0

8 months ago

0.11.1

10 months ago

0.13.0

9 months ago

0.13.1

9 months ago

0.15.0

9 months ago

0.17.0

8 months ago

0.23.3

7 months ago

0.23.2

7 months ago

0.23.1

7 months ago

0.23.0

7 months ago

0.21.1

7 months ago

0.9.0

10 months ago

1.1.1

7 months ago

1.1.0

7 months ago

0.21.0

7 months ago

1.7.0

5 months ago

1.5.0

6 months ago

1.1.3

7 months ago

1.3.0

6 months ago

1.1.2

7 months ago

0.18.1

8 months ago

0.10.1

10 months ago

0.12.0

9 months ago

0.14.0

9 months ago

0.16.0

9 months ago

0.18.0

8 months ago

0.10.0

10 months ago

0.22.2

7 months ago

0.22.1

7 months ago

0.22.0

7 months ago

0.8.1

11 months ago

0.8.0

11 months ago

0.7.0

11 months ago

0.6.1

11 months ago

0.6.0

11 months ago

0.5.0

12 months ago

0.4.0

1 year ago

0.3.2

1 year ago

0.3.0

1 year ago

0.3.1

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago