Installing <NavButton> Component

There are 2 ways to install <NavButton> component into your react app project:

  • Install the Specific Package of <NavButton> Component
  • Install the Whole Reusable-UI Component Pack, including the <NavButton> Component

Navigation Properties

Specifies how comparisons are made for the current URL with the href/to property inside <Link> component.

In order to the properties below to work, you should place a <Link> component inside the <NavButton>, with the href property (NextJS) or to property (ReactRouter).

// NextJs:
<NavButton caseSensitive={false} end={false}>
    <Link href='/products'>Products</Link>
</NavButton>

// ReactRouter:
<NavButton caseSensitive={false} end={false}>
    <Link to='/products'>Products</Link>
</NavButton>

caseSensitive Property

Defines the string sensivity comparison for the current URL with the href/to property inside <Link> component.

The possible values are:

  • undefined
  • true
  • false

end Property

Determines how nested URLs are treated against the href/to property inside <Link> component.

The possible values are:

  • undefined
  • true
  • false

Client Side Link

Navigates between pages using JavaScript way, without causing a whole page HTTP request.

<NavButton> designed to work with <Link> component of React Router and Next JS (Gatsby JS and React Remix are coming soon).

When there is a <Link> component inside the <NavButton>, at render phase, the hierarchy of <NavButton> and <Link> is automatically swapped for you. Here the illustration:

Show code

href Property

Navigates to another pages or to external websites using traditional link.

onClick Property

Executes a JavaScript's callback function when the <NavButton> is clicked.

Variant Properties

The alternative appearances of the <NavButton> layout without changing the <NavButton>'s functionality.

buttonStyle Property

Sets the alternative appearances of the <NavButton>.

The possible values are:

  • undefined
  • 'regular'
  • 'link'
  • 'ghost'

Here the preview:

Preview

Show code

orientation Property

Sets the orientation of the <NavButton>.

The possible values are:

  • undefined
  • 'inline'
  • 'block'

Here the preview:

Preview

Show code

size Property

Defines the alternative size of the <NavButton>.

The possible values are:

  • undefined
  • 'sm'
  • 'md'
  • 'lg'

Here the preview:

Preview

Show code

theme Property

Defines the contextual theme of the <NavButton>.

The possible values are:

  • undefined
  • 'primary'
  • 'secondary'
  • 'success'
  • 'info'
  • 'warning'
  • 'danger'
  • 'light'
  • 'dark'

Here the preview:

Preview

Show code

gradient Property

Activates a 3D mode of the <NavButton>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview

Show code

outlined Property

Activates an outlined mode (background-less, contrast foreground, and contrast border) of the <NavButton>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview

Show code

mild Property

Activates a mild mode (mild background, contrast foreground, and contrast border) of the <NavButton>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview

Show code

nude Property

Activates an nude mode (background-less, padding-less, and border-less) of the <NavButton>.

The possible values are:

  • undefined
  • true
  • false

Here the preview:

Preview

Show code

State Properties

The conditions of the <NavButton> behavior or functionality.

enabled Property

Defines the enabled/disabled state of the <NavButton>.

The possible values are:

  • undefined
  • true
  • false

Here the preview:

Preview

Show code

inheritEnabled Property

Influences the <NavButton>'s disabled state by <ancestor enabled={false}>.

The possible values are:

  • undefined
  • true
  • false

Here the preview:

Preview

Show code

Component Properties

Overwrites the internal (sub) components used as the composition of <NavButton> component.

buttonComponent Property

Overwrites the internal <Button> component used as the composition of <NavButton> component.

<NavButton buttonComponent={
    <MyCustomButton />
} />