2.4.1 • Published 6 years ago

codogo-nav v2.4.1

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

codogo-nav

npm version

A navigation bar component for React, than (hopefully) just works.


Example usage

Import component

    import { Nav, } from "codogo-nav";

A simple example:

    <Nav
        logo = { <Logo src = { akkrooLogo } /> }
        links = { [
            {
                as: "gatsby-link",
                to: "/",
                content: "Home",
            },
            {
                as: "a",
                to: "/form-stage-1/",
                content: "Stage 1",
            },
            {
                as: "router-link",
                to: "/form-stage-2/",
                content: "Stage 2",
            },
        ] }
    />

Links

codogo-nav links support the following components, selected via the "as" property via the following strings:

  • <a/> - "a"
  • "gatsby-link" - "gatsby-link"
  • <Link/> from "react-router-dom" - "link"
  • <NavLink/> from "react-router-dom" - "nav-link"
  • <div/> - "div"

Props

The follow props are used, defaults shown below:

const theme = {
    padding: {
        //
        xs: "0.75em",
        other: "1.5em",
    },
    color: {
        // Font color
        xs: "#fff",
        other: "#333",
    },
    highlightColor: {
        // Hover on links, burger menu
        xs: "#ddd",
        other: "#888",
    },
    backgroundColor: {
        xs: "#333",
        other: "#fff",
    },
    height: {
        xs: "50px",
        other: "70px",
    },
    font: "sans-serif",
    fontSize: {
        xs: "0.8em",
        other: "1.1em",
    },
    textTransform: {
        xs: "none",
        other: "none",
    },
    topOffset: {
        xs: "50px",
        other: "70px",
    },
    margin: {
        xs: "20px",
        other: "30px",
    },
    clear: false,
    fixed: false,
    shadow: false,
};

More complex examples

2.4.1

6 years ago

2.4.0

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago