5.0.7 • Published 8 years ago

@schibstedspain/sui-topbar v5.0.7

Weekly downloads
1
License
-
Repository
github
Last release
8 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

8 years ago

5.0.6

8 years ago

5.0.5

8 years ago

5.0.4

8 years ago

5.0.3

8 years ago

5.0.2

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.2.8

9 years ago

3.2.7

9 years ago

3.2.6

9 years ago

3.2.5

9 years ago

3.2.4

9 years ago

3.2.3

9 years ago

3.2.2

9 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.1

9 years ago

3.1.0

9 years ago

3.0.4

10 years ago

3.0.3

10 years ago

3.0.2

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.25

10 years ago

1.0.24

10 years ago

1.0.23

10 years ago

1.0.21

10 years ago

1.0.20

10 years ago

1.0.19

10 years ago

1.0.18

10 years ago

1.0.17

10 years ago

1.0.16

10 years ago

1.0.15

10 years ago

1.0.14

10 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago