4.0.0 • Published 9 months ago

@hig/project-account-switcher v4.0.0

Weekly downloads
152
License
Apache-2.0
Repository
github
Last release
9 months ago

Project Account Switcher

The Project and Account Switcher is part of the Global Nav and allows customers to switch the context to different projects or accounts.

Getting started

Install the package

yarn add @hig/project-account-switcher

Import the component

import ProjectAccountSwitcher from '@hig/project-account-switcher';

Styling

Use the className prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component.

ProjectAccountSwitcher also has a stylesheet prop that accepts a function wherein you can modify its styles. For instance

import ProjectAccountSwitcher from '@hig/project-account-switcher';

function YourComponent() {
  // ...
  const customStylesheet = (styles, props, themeData) => ({
    ...styles,
    itemLabel: {
      ...styles.itemLabel,
    },
    imageWrapper: {
      ...styles.imageWrapper,
    },
    image: {
      ...styles.image,
    },
    panel: {
      ...styles.panel,
    },
    switcherList: {
      ...styles.switcherList,
    },
    switcherItem: {
      ...styles.switcherItem,
    },
    switcherAccountImageWrapper: {
      ...styles.switcherAccountImageWrapper,
    },
    target: {
      ...styles.target,
    },
    targetItem: {
      ...styles.targetItem,
    },
    targetCaret: {
      ...styles.targetCaret,
    }
  });

  return (
    <ProjectAccountSwitcher stylesheet={customStylesheet} />
  );
}
4.0.0

9 months ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.2

5 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.1.1-alpha

6 years ago

0.1.0-alpha

6 years ago