npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@axa-fr/react-toolkit-layout-header

v3.0.2

Published

1. [Header](#header) 1. [WithName](#withname) 2. [WithName&Infos](#withnameinfos) 2. [Infos](#infos) 1. [Default](#default) 3. [MenuTitleWrapper](#menutitlewrapper) 1. [Default](#default-1) 4. [NavBar](#navbar) 1. [NavBarBase with null](#na

Downloads

518

Readme

@axa-fr/react-toolkit-header

  1. Header
    1. WithName
    2. WithName&Infos
  2. Infos
    1. Default
  3. MenuTitleWrapper
    1. Default
  4. NavBar
    1. NavBarBase with null
    2. NavBarBase with init
  5. NavBarItem
    1. Actif
    2. Actif with Children
  6. Title
    1. Default
    2. Complex
  7. ToggleButton
    1. Default
  8. User
    1. Default
    2. No Link

Header

WithName

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { Header, Name } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/Header/af-header.css';
import '@axa-fr/react-toolkit-layout-header/dist/Name/af-name.css';
import '@axa-fr/react-toolkit-layout-header/dist/Logo/af-logo.css';
import logo from '@axa-fr/react-toolkit-core/dist/assets/logo-axa.svg';

Use

const withName = () => (
  <Header>
    <Name
      title="My new application"
      subtitle="Baseline"
      img={logo}
      alt="Logo React"
      onClick={(e) => {
        console.log(e);
      }}
    />
  </Header>
);
export default withName;

WithName&Infos

Import

import { Header, Infos, Name } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/Header/af-header.css';
import '@axa-fr/react-toolkit-layout-header/dist/Name/af-name.css';
import '@axa-fr/react-toolkit-layout-header/dist/Infos/af-infos.css';
import '@axa-fr/react-toolkit-layout-header/dist/Logo/af-logo.css';
import logo from '@axa-fr/react-toolkit-core/dist/assets/logo-axa.svg';

Use

const withNameInfos = () => (
  <Header>
    <Name
      title="My new application"
      subtitle="Baseline"
      img={logo}
      alt="Logo React"
      onClick={(e) => {
        console.log(e);
      }}
    />
    <Infos
      infos={[
        { word: 'Customer :', definition: '0123456789 - NOM' },
        { word: 'Wallet:', definition: '000123456789' },
        { word: 'Status :', definition: 'New business' },
      ]}
    />
  </Header>
);
export default withNameInfos;

Infos

Default

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { Header, Infos } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/Header/af-header.css';
import '@axa-fr/react-toolkit-layout-header/dist/Infos/af-infos.css';

Use

const infosLayout = () => (
  <Header>
    <Infos
      infos={[
        { word: 'Client :', definition: '0123456789 - NOM' },
        { word: 'Portefeuille :', definition: '000123456789' },
        { word: 'Status :', definition: 'Affaire nouvelle' },
      ]}
    />
  </Header>
);
export default infosLayout;

MenuTitleWrapper

Default

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBar, NavBarItem, Title } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';
import '@axa-fr/react-toolkit-layout-header/dist/Title/af-title-bar.css';

Use

const menuTitleWrapper = () => (
  <ul style={{ listStyle: 'none' }}>
    <NavBar isVisible={true} onClick={() => console.log('your function')}>
      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Home
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Form
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Fielupload
          </a>
        }
      />

      <NavBarItem
        className="af-nav__item--haschild af-nav__item"
        aria-haspopup="true"
        aria-expanded="false"
        ariaLabel="Table"
        actionElt={<span className="af-nav__link">Table</span>}>
        <NavBarItem
          key="table-1"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 1
            </a>
          }
        />
        <NavBarItem
          key="table-2"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 2
            </a>
          }
        />

        <NavBarItem
          key="table-3"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 3
            </a>
          }
        />
      </NavBarItem>

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Accordions
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Alert
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Validation
          </a>
        }
      />

      <NavBarItem
        className="af-nav__item--haschild af-nav__item"
        aria-haspopup="true"
        aria-expanded="false"
        ariaLabel="Table"
        actionElt={<span className="af-nav__link">Doc</span>}>
        <NavBarItem
          key="table-1"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 1
            </a>
          }
        />
        <NavBarItem
          key="table-2"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 2
            </a>
          }
        />

        <NavBarItem
          key="table-3"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 3
            </a>
          }
        />
      </NavBarItem>
    </NavBar>
    <Title
      title="Toolkit Axa"
      subtitle="Info complémentaire"
      toggleMenu={() => {
        console.log('your function');
      }}
    />
  </ul>
);
export default menuTitleWrapper;

NavBar

##NavBarBase

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBar, NavBarItem } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';
import '@axa-fr/react-toolkit-layout-header/dist/Title/af-title-bar.css';

Use

const NavBarBase = () => (
  <ul style={{ listStyle: 'none' }}>
    <NavBar isVisible={true} onClick={() => console.log('your function')}>
      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Home
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Form
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Fielupload
          </a>
        }
      />

      <NavBarItem
        className="af-nav__item--haschild af-nav__item"
        aria-haspopup="true"
        aria-expanded="false"
        ariaLabel="Table"
        actionElt={<span className="af-nav__link">Table</span>}>
        <NavBarItem
          key="table-1"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 1
            </a>
          }
        />
        <NavBarItem
          key="table-2"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 2
            </a>
          }
        />

        <NavBarItem
          key="table-3"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 3
            </a>
          }
        />
      </NavBarItem>

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Accordions
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Alert
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Validation
          </a>
        }
      />

      <NavBarItem
        className="af-nav__item--haschild af-nav__item"
        aria-haspopup="true"
        aria-expanded="false"
        ariaLabel="Table"
        actionElt={<span className="af-nav__link">Doc</span>}>
        <NavBarItem
          key="table-1"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 1
            </a>
          }
        />
        <NavBarItem
          key="table-2"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 2
            </a>
          }
        />

        <NavBarItem
          key="table-3"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 3
            </a>
          }
        />
      </NavBarItem>
    </NavBar>
  </ul>
);
export default NavBarBase;

NavBarBase with null

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBar, NavBarItem } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';
import '@axa-fr/react-toolkit-layout-header/dist/Title/af-title-bar.css';

Use

const NavBarWithNoValue = () => (
  <ul style={{ listStyle: 'none' }}>
    <NavBar isVisible={true} onClick={() => console.log('your function')}>
      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Home
          </a>
        }
      />
      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Fielupload
          </a>
        }
      />
    </NavBar>
  </ul>
);
export default NavBarWithNoValue;

NavBarBase with init

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBar, NavBarItem } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';
import '@axa-fr/react-toolkit-layout-header/dist/Title/af-title-bar.css';

Use

const NavBarWithInitPosition = () => (
  <ul style={{ listStyle: 'none' }}>
    <NavBar
      isVisible={true}
      positionInit={3}
      onClick={() => console.log('your function')}>
      <NavBarItem
        aria-expanded="false"
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Home
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Form
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Fielupload
          </a>
        }
      />

      <NavBarItem
        className="af-nav__item--haschild af-nav__item"
        aria-haspopup="true"
        classModifier="active"
        aria-expanded="false"
        ariaLabel="Table"
        actionElt={<span className="af-nav__link">Table</span>}>
        <NavBarItem
          key="table-1"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 1
            </a>
          }
        />
        <NavBarItem
          key="table-2"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 2
            </a>
          }
        />

        <NavBarItem
          key="table-3"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 3
            </a>
          }
        />
      </NavBarItem>

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Accordions
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Alert
          </a>
        }
      />

      <NavBarItem
        actionElt={
          <a
            className="af-nav__link"
            href="https://axa.fr"
            onClick={(e) => console.log(e)}>
            Validation
          </a>
        }
      />

      <NavBarItem
        className="af-nav__item--haschild af-nav__item"
        aria-haspopup="true"
        aria-expanded="false"
        ariaLabel="Table"
        actionElt={<span className="af-nav__link">Doc</span>}>
        <NavBarItem
          key="table-1"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 1
            </a>
          }
        />
        <NavBarItem
          key="table-2"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 2
            </a>
          }
        />

        <NavBarItem
          key="table-3"
          actionElt={
            <a
              className="af-nav__link"
              href="https://axa.fr"
              onClick={(e) => console.log(e)}>
              Sous lien 3
            </a>
          }
        />
      </NavBarItem>
    </NavBar>
  </ul>
);
export default NavBarWithInitPosition;

NavBarItem

##Default

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBarItem } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';

Use

const styleNavBarItem = {
  width: '100px',
};

const NavBarItemDefault = () => (
  <ul style={{ listStyle: 'none' }}>
    <NavBarItem
      style={styleNavBarItem}
      actionElt={
        <a
          className="af-nav__link"
          href="https://axa.fr"
          onClick={(e) => console.log(e)}>
          HomeLINK
        </a>
      }
    />
  </ul>
);
export default NavBarItemDefault;

Actif

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBarItem } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';

Use

const styleNavBarItem = {
  width: '100px',
};

const NavBarItemActif = () => (
  <ul style={{ listStyle: 'none' }}>
    <NavBarItem
      classModifier="active"
      style={styleNavBarItem}
      actionElt={
        <a
          className="af-nav__link"
          href="https://axa.fr"
          onClick={(e) => console.log(e)}>
          Home
        </a>
      }
    />
  </ul>
);
export default NavBarItemActif;

Actif with Children

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { NavBarItem } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/NavBar/af-nav.css';

Use

const styleNavBarItem = {
  width: '100px',
};

const styleWithChildren = {
  height: '300px',
};

const NavBarItemActifWithChildren = () => (
  <div style={styleWithChildren}>
    <NavBarItem
      style={styleNavBarItem}
      aria-haspopup="true"
      aria-expanded="false"
      ariaLabel="Table"
      className="af-nav__item--haschild af-nav__item af-nav__item--open"
      classModifier="active"
      actionElt={
        <a className="af-nav__link" href="/doc">
          Doc
        </a>
      }>
      <NavBarItem
        key="doc-1"
        actionElt={
          <a className="af-nav__link" href="/doc/sous-lien">
            Sous lien
          </a>
        }
      />
      <NavBarItem
        key="doc-2"
        actionElt={
          <a className="af-nav__link" href="/doc/sous-lien2">
            Sous lien2
          </a>
        }
      />
      <NavBarItem
        key="doc-3"
        actionElt={
          <a className="af-nav__link" href="/doc/sous-lien3">
            Sous lien3
          </a>
        }
      />
      <NavBarItem
        key="doc-4"
        actionElt={
          <a className="af-nav__link" href="/doc/sous-lien4">
            Sous lien4
          </a>
        }
      />
    </NavBarItem>
  </div>
);
export default NavBarItemActifWithChildren;

Title

Default

By default, the title bar is sticky on the top when you scroll down the page. If you want to disable that behavior you can set to false the isSticky property of the component.

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { Title } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/Title/af-title-bar.css';

Use

const TitleDefault = () => (
  <Title
    title="Toolkit Axa"
    subtitle="Info complémentaire"
    toggleMenu={() => {
      console.log('your function');
    }}
  />
);
export default TitleDefault;

Complex

Installation

npm i @axa-fr/react-toolkit-layout-header
npm i @axa-fr/react-toolkit-action

Import

import { Title } from '@axa-fr/react-toolkit-layout-header';
import Action from '@axa-fr/react-toolkit-action';
import '@axa-fr/react-toolkit-layout-header/dist/Title/af-title-bar.css';
import '@axa-fr/react-toolkit-action/dist/af-button.css';

Use

const actions = [
  {
    id: '001',
    href: '#enregistrer',
    icon: 'floppy-disk',
    title: 'Enregistrer',
  },
  {
    id: '002',
    href: '#imprimer',
    icon: 'print',
    title: 'Imprimer',
  },
];

const TitleComplex = () => (
  <Title
    title="Toolkit Axa"
    subtitle="Info complémentaire"
    toggleMenu={() => {
      console.log('your function');
    }}>
    <div className="af-title-bar__actions">
      <a className="af-title-bar__link" href="#lien" title="lien titlebar">
        lien titlebar
      </a>
      {actions.map(({ icon, href, title, id }) => (
        <Action
          key={id}
          icon={icon}
          href={href}
          title={title}
          onClick={(e) => {
            console.log(e);
          }}
        />
      ))}
    </div>
  </Title>
);
export default TitleComplex;

ToggleButton

Default

Installation

npm i @axa-fr/react-toolkit-layout-header
npm i @axa-fr/react-toolkit-action

Import

import { ToggleButton } from '@axa-fr/react-toolkit-layout-header';
import Action from '@axa-fr/react-toolkit-action';
import '@axa-fr/react-toolkit-action/dist/af-button.css';

Use

const actionToggle = {
  icon: 'menu-hamburger',
  title: 'Toggle',
};

const ToggleButtonLayout = () => (
  <ToggleButton idControl="mainmenu">
    <Action
      id="togglemenu"
      icon={actionToggle.icon}
      title={actionToggle.title}
    />
  </ToggleButton>
);
export default ToggleButtonLayout;

User

Default

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { User } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/User/af-user.css';

Use

const UserDefault = () => (
  <User name="Pierre Martin" profile="profile" href="/profile" />
);
export default UserDefault;

No Link

Installation

npm i @axa-fr/react-toolkit-layout-header

Import

import { User } from '@axa-fr/react-toolkit-layout-header';
import '@axa-fr/react-toolkit-layout-header/dist/User/af-user.css';

Use

const NoLink = () => <User name="Pierre Martin" profile="profile" />;
export default NoLink;