Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gravity-ui/navigation

Package Overview
Dependencies
Maintainers
3
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gravity-ui/navigation

Gravity UI Navigation components

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
increased by2.9%
Maintainers
3
Weekly downloads
 
Created
Source

@gravity-ui/navigation · npm package CI storybook

Aside Header Navigation · Preview →

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

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-header-item-background-color-hover--g-color-base-simple-hover
--gn-aside-header-item-current-background-color--g-color-base-selection
--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

FAQs

Package last updated on 16 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc