1.3.8 • Published 1 day ago

@frankhoodbs/scroll-x-navbar-cmp v1.3.8

Weekly downloads
-
License
ISC
Repository
-
Last release
1 day ago

Scroll X Navbar Component

A component that renders a horizontal navigation bar that supports scrolling both through dragging and through navigation buttons. The elements inside the navigation bar are injected via a slot, allowing for greater flexibility in the content that can be inserted.

Componente che visualizza una barra di navigazione orizzontale che supporta lo scorrimento sia tramite trascinamento che tramite pulsanti di navigazione. Gli elementi all'interno della barra di navigazione sono inniettati tramite uno slot, permettendo una maggiore flessibilità nel contenuto che può essere inserito.

Version License

API Reference

Slots

NameDescription
prev-iconSlot for the icon prev used if the prop data-navigation is passed with value true. If the slot is leaved empty a default icon is used instead.
next-iconSlot for the icon next used if the prop data-navigation is passed with value true. If the slot is leaved empty a default icon is used instead.
defaultRequired. Slot for contents. Pass a list of <li> inside here.

Props

NameTypeDescription
data-active-tab-idstringRequired Id of the active tab.
data-navigationbooleanEnable/disable navigation through prev and next buttons.
data-slot-readyanyNeeded only in case of async data slotted in the default slot; indicates that the content passed are fully loaded.
data-ul-rolestringPass a role to the <ul> for accessibility reasons.

CSS variables

NamedefaultDescription
--scroll-x-navbar-spacing-x24pxLateral padding of the navigation bar
--scroll-x-navbar-button-z-index1Navigation buttons z-index
--scroll-x-navbar-button-spacing-x24pxLateral distance of the navigation buttons
--scroll-x-navbar-button-width36pxWidth of the navigation buttons
--scroll-x-navbar-button-height36pxHeight of the navigation buttons
--scroll-x-navbar-button-border-width1pxBorder width of the navigation buttons
--scroll-x-navbar-button-border-stylesolidBorder style of the navigation buttons
--scroll-x-navbar-button-border-colorrgba(#000000, 0.75)Border color of the navigation buttons
--scroll-x-navbar-button-border-radius0Border radius of the navigation buttons
--scroll-x-navbar-button-bg-colorrgba(#ffffff, 0.75)Background-color of the navigation buttons
--scroll-x-navbar-button-box-shadownoneBox shadow of the navigation buttons
--scroll-x-navbar-button-colorrgba(#000000, 0.75)Color of the navigation buttons
--scroll-x-navbar-button-icon-widthautoWidth of the icon inside the navigation buttons
--scroll-x-navbar-button-icon-heightautoHeight of the icon inside the navigation buttons
--scroll-x-navbar-button-disabled-border-width1pxBorder width of the navigation buttons when is disabled
--scroll-x-navbar-button-disabled-border-stylesolidBorder style of the navigation buttons when is disabled
--scroll-x-navbar-button-disabled-border-colorrgba(#cbcbcb, 0.5)Border color of the navigation buttons when is disabled
--scroll-x-navbar-button-disabled-bg-colorrgba(#ffffff, 0.75)Background-color of the navigation buttons when is disabled
--scroll-x-navbar-button-disabled-box-shadownoneBox shadow of the navigation buttons when is disabled
--scroll-x-navbar-button-disabled-colorrgba(#cbcbcb, 0.5)Color of the navigation buttons when is disabled
--scroll-x-navbar-border-bottom-spacing-x24pxLateral distance of the navigation bar border bottom
--scroll-x-navbar-border-bottom-width1pxBorder width of the navigation bar border bottom
--scroll-x-navbar-border-bottom-stylesolidBorder style of the navigation bar border bottom
--scroll-x-navbar-border-bottom-colorrgba(#cbcbcb, 0.75)Border color of the navigation bar border bottom
--scroll-x-navbar-border-bottom-content''Border bottom is rendered, pass none instead of '' if you want to remove the border bottom
--scroll-x-navbar-tab-bg-color#ffffffBackground-color of the tab
--scroll-x-navbar-tab-color#cbcbcbColor of the tab
--scroll-x-navbar-tab-active-bg-color#ffffffBackground-color of the tab when is active
--scroll-x-navbar-tab-active-color#000000Color of the tab when is active
--scroll-x-navbar-tab-hover-bg-color#ffffffBackground-color of the tab when is in hover
--scroll-x-navbar-tab-hover-color#000000Color of the tab when is in hover
--scroll-x-navbar-tab-padding1.5rem 1remPadding of the tab

Usage/Examples

<scroll-x-navbar-cmp
  :data-active-tab-id="`ScrollXNavbarCmp-1-tab-${activeTabId}`"
  @navigation="activeTabId = +$event.replace('ScrollXNavbarCmp-1-tab-', '')"
>
  <li
    v-for="n in 5"
    :key="`tab-${n}`"
    :id="`ScrollXNavbarCmp-1-tab-${n}`"
    :class="['tab', { active: n.toString() === activeTabId }]"
    @click="activeTabId = n.toString()"
  >
    <span class="tab-label">Tab Navigation Item Number {{ n }}</span>
  </li>
</scroll-x-navbar-cmp>

const activeTabId = ref<string>('1');

Screenshots

Component Screenshot

1.3.7

1 day ago

1.3.4

2 days ago

1.3.8

1 day ago

1.3.3

6 days ago

1.3.2

19 days ago

1.3.1

22 days ago

1.3.0

23 days ago

1.2.17

23 days ago

1.2.16

2 months ago

1.2.14

2 months ago

1.2.15

2 months ago

1.2.13

2 months ago

1.2.12

3 months ago

1.2.11

3 months ago

1.2.10

4 months ago

1.2.9

4 months ago

1.2.8

4 months ago

1.2.7

4 months ago

1.2.6

4 months ago

1.2.3

4 months ago

1.2.2

4 months ago

1.2.1

4 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago