Giter VIP home page Giter VIP logo

navigation's Introduction

@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/[email protected] react@^16.0.0

Components

  • AsideHeader
  • MobileHeader
  • FooterItem
  • MobileHeaderFooterItem
  • Drawer
  • DrawerItem
  • PageLayout
  • PageLayoutAside

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:

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

-    <AsideHeader renderContent={renderContent} {...restProps} />
+    <PageLayout reverse>
+        <PageLayout.Content>
+            <ContentExample />
+        </PageLayout.Content>
+
+        <Suspense fallback={null}>
+            <PageLayoutAside {...restProps} />
+        </Suspense>
+    </PageLayout>

Imports

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

CSS variables

Used for themization Navigation's components

AsideHeader vars

Name Description Default
--gn-aside-header-background-color Сolor of decorations and selected items --g-color-base-warning-light
--gn-aside-header-subheader-divider-line-color Divider line color for withDecoration and expanded AsideHeader Light theme: --g-color-line-generic, Dark theme: --g-color-line-generic-solid
--gn-aside-header-collapse-button-divider-line-color --gn-aside-header-subheader-divider-line-color
--gn-aside-header-footer-item-icon-color --g-color-text-primary
--gn-aside-header-subheader-item-icon-color --g-color-text-primary
--gn-aside-header-item-icon-background-size Background size used when AsideHeader is compact 38px
--gn-aside-header-divider-line-color Vertical color divider between AsideHeader and content Light theme: transparent, Dark theme: --g-color-line-generic-solid

navigation's People

Contributors

gravity-ui-bot avatar lunory avatar darkgenius avatar ldrv565 avatar sunduckcow avatar ma-efremoff avatar catakot avatar mournfulcoroner avatar bocembocem avatar ariser avatar n-parpibaeva avatar pavel-klimov avatar js2me avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.