<Navscroll> Component

<Navscroll> is a list of scrollable sections with automatically toggling-on the <ListItem>'s active state at corresponding scrolling position.

<Navscroll> supports of (virtually) unlimited depth of nested <Navscroll>s.

Here the demo:

Preview

First section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Second section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Third section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fifth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Last section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Installing <Navscroll> Component

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

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

Scrolling Properties

Determines how the <ListItem>s of <Navscroll> should be highlighted to reflect the corresponding visible section.

scrollingOf Property

Determines the scrollable container of corresponding sections where the <ListItem>s of <Navscroll> should be highlighted.

The structure of <ListItem>s should be match to the structure of the <scrollable_container>'s children (<section>s or <div>s or any <element>s).


Here the preview:

Preview

First section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Second section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Third section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fifth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Last section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

Nested Sub Sections

<Navscroll> supports mapping nested sub sections.

Place another <Navscroll scrollingOf={undefined}>...</Navscroll> in the corresponding <ListItem>, with the same structure of <ListItem>s match to the structure of the <nested_section>s.


Here the preview:

Preview

First section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Second section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Third section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth sub section 1

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth sub section 2

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth sub section 3

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth sub section 4

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fifth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Last section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Show code

scrollingSelector Property

Filters the desired <section>s or <whatever_element>s you wish to be the corresponding sections by providing a valid CSS selector expression.

The default is scrollingSelector='*', so any elements will be treated as the corresponding sections.

You can also set something like <Navscroll scrollingSelector='section, div, .section'> or whatever selector you want, depending on the project you're working on.

scrollingFilter Property

Filters the desired <section>s or <whatever_element>s you wish to be the corresponding sections by providing a JavaScript callback function.

The callback function will receive a HTMLElement object and then should return a boolean value indicating the selection was passed (true) or not (false).

scrollingInterpolation Property

Determines how the highlighting transition between corresponding sections is performed.

The possible values are:

  • undefined
  • false
  • true

Here the preview:

Preview

First section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Second section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Third section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fourth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Fifth section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Lorem ipsum dolor sit amet consectetur adipisicing elit.

Last section

Lorem ipsum dolor sit amet consectetur adipisicing elit.

scrollingInterpolation={false}
scrollingInterpolation={true}

Variant Properties

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

listStyle Property

Sets the alternative appearances of the <Navscroll>.

The possible values are:

  • undefined
  • 'regular'
  • 'flat'
  • 'flush'
  • 'joined'
  • 'content'
  • 'button'
  • 'tab'
  • 'breadcrumb'
  • 'bullet'
  • 'numbered'


Here the preview:

Preview

Show code

orientation Property

Sets the orientation of the <Navscroll>.

The possible values are:

  • undefined
  • 'inline'
  • 'block'

Here the preview:

Preview

Show code

size Property

Defines the alternative size of the <Navscroll>.

You can set the size individually for each <ListItem>.

The possible values are:

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

Here the preview:

Preview

Show code

theme Property

Defines the contextual theme of the <Navscroll>.

You can set the theme individually for each <ListItem>.

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 <Navscroll>.

You can set the gradient individually for each <ListItem>.

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 <Navscroll>.

You can set the outlined individually for each <ListItem>.

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 <Navscroll>.

You can set the mild individually for each <ListItem>.

The possible values are:

  • undefined
  • 'inherit'
  • true
  • false

Here the preview:

Preview

Show code

State Properties

The conditions of the <Navscroll> behavior or functionality.

enabled Property

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

You can set the enabled individually for each <ListItem>.

The possible values are:

  • undefined
  • true
  • false

Here the preview:

Preview

Show code

inheritEnabled Property

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

You can set the inheritEnabled individually for each <ListItem>.

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 <Navscroll> component.

navComponent Property

Overwrites the internal <Nav> component used as the composition of <Navscroll> component.

<Navscroll navComponent={
    <MyCustomNav />
} />

navscrollComponent Property

Overwrites the internal <Navscroll> component used as the detection of nested <Navscroll>.

export const MyCustomNavscroll = (props: NavscrollProps) => {
    
    /* ... */
    
    return (
        <Navscroll {...props} navscrollComponent={
            <MyCustomNavscroll />
        } />
    );
}