5.0.7 • Published 7 years ago

@schibstedspain/sui-topbar v5.0.7

Weekly downloads
1
License
-
Repository
github
Last release
7 years ago

Description

A generic topbar component including:

  • A dynamic dropdown main menu with custom class wrapper.
  • A placeholder to dynamically pass components inside
  • A dynamic dropdown secondary menu.

Installation

Clone this repository to a local folder, cd into it and run:

$ npm install

Start working in development mode

$ npm run dev

Node dependencies

The component itself relies on the following node packages:

  • "react": "^0.13.3"
  • "@schibstedspain/theme-sui": "latest"

Usage

Render the component in your entry point app as follows:

React.render(<suiTopbar />,
  document.getElementById(target));

Data structure

This component has a main and secondary menu. Data is passed into the component using an array with the following structure:

const data = {
  mainmenu: [
    {item: 'main option 01', link: 'https://github.com/SUI-Components'},
    {item: 'main option 02', link: 'https://github.com/SUI-Components'},
    {...}
  ],
  secondarymenu: [
    {item: 'secondary option 01', link: 'https://github.com/SUI-Components'},
    {item: 'secondary option 02', link: 'https://github.com/SUI-Components'},
    {...}
  ]
};

## Passing children React Components inside SuiTopbar If you create a parent component you can use SuiTopbar as an scaffolding to create a customized Topbar. To fill SuiTopbar with customized content you need to pass children React components.

First of all you need to properly import SuiTopbar and your child from the node_modules folder in your parent component:

import * as SuiTopbar from '@schibstedspain/sui-topbar';
import YourCustomComponent from '../YourCustomComponent';

Then, your parent component has to include both elements, SuiTopbar gathering data as props and wrapping your custom component in the render method as follows:

render() {
    return (
        <SuiTopbar.Topbar data={this.props.data}>
          <YourCustomComponent />
        </SuiTopbar.Topbar>
    );
  }

Demo page

Check out the working demo at: http://sui-components.github.io/sui-topbar/

5.0.7

7 years ago

5.0.6

7 years ago

5.0.5

7 years ago

5.0.4

7 years ago

5.0.3

7 years ago

5.0.2

7 years ago

5.0.1

7 years ago

5.0.0

7 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.2.8

8 years ago

3.2.7

8 years ago

3.2.6

8 years ago

3.2.5

8 years ago

3.2.4

8 years ago

3.2.3

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.2

8 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.25

9 years ago

1.0.24

9 years ago

1.0.23

9 years ago

1.0.21

9 years ago

1.0.20

9 years ago

1.0.19

9 years ago

1.0.18

9 years ago

1.0.17

9 years ago

1.0.16

9 years ago

1.0.15

9 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago