Sha256: 57dc299a481f575f96615f4001ee5fee4e15f45fc980260714631b6fabf1e6b0

Contents?: true

Size: 1.93 KB

Versions: 958

Compression:

Stored size: 1.93 KB

Contents

<%= pb_rails("nav", props: { orientation: "horizontal", tabbing: true, padding_bottom: "sm" }) do %>
  <%= pb_rails("nav/item", props: { text: "About", active: true, data: { pb_tab_target: "about" }, cursor: "pointer" }) %>
  <%= pb_rails("nav/item", props: { text: "Case Studies", data: { pb_tab_target: "case_studies" }, cursor: "pointer" }) %>
  <%= pb_rails("nav/item", props: { text: "Service", data: { pb_tab_target: "service" }, cursor: "pointer" }) %>
  <%= pb_rails("nav/item", props: { text: "Contacts", data: { pb_tab_target: "contacts" }, cursor: "pointer" }) %>
<% end %>

<div id="about">
  <%= pb_rails("body", props: { text: "This is about!" }) %>
</div>

<div id="case_studies">
  <%= pb_rails("body", props: { text: "This is case studies!" }) %>
</div>

<div id="service">
  <%= pb_rails("body", props: { text: "This is service!" }) %>
</div>

<div id="contacts">
  <%= pb_rails("body", props: { text: "This is contacts!" }) %>
</div>

<script>
  // The script in the code snippet below is for demonstrating the active state and NOT needed for the kit to function.
  // The active prop can be used to highlight this active state.
  const navItemClass = "pb_nav_list_kit_item"
  const navItemActiveClass = "pb_nav_list_kit_item_active"
  const dataNavItems = "[data-pb-tab-target]"

  const navItemTabs = document.querySelectorAll(dataNavItems)
  navItemTabs.forEach(navItemTab => {
    navItemTab.addEventListener("click", event => {
      const navItemTabs = document.querySelectorAll(dataNavItems)
      navItemTabs.forEach(navItemTab => {
        if (navItemTab === event.target.closest(dataNavItems)) {
          navItemTab.classList.add(navItemActiveClass)
          navItemTab.classList.remove(navItemClass)
        } else {
          if (navItemTab.classList.contains(navItemActiveClass)) {
            navItemTab.classList.remove(navItemActiveClass)
            navItemTab.classList.add(navItemClass)
          }
        }
      })
    })
  })
</script>

Version data entries

958 entries across 958 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb