@vtex/shoreline-next
TypeScript icon, indicating that this package has built-in type declarations

1.0.76 • Public • Published

Shoreline Next

NextJS-Aware Shoreline components.

Instalation

Next and Shoreline are peer-dependencies:

pnpm add next @vtex/shoreline

Install Shoreline-next:

pnpm add @vtex/shoreline-next

Usage

NextTab

Uses Next's parallel routes to create accessible Tabs and tab panels that are rendered on the server and controlled by the URL.

First, create a layout using the NextTab components:

// layout.tsx
import {
  NextTabProvider,
  NextTabList,
  NextTab,
  NextTabPanel,
} from '@vtex/shoreline-page'

export default function Layout(props: Props) {
  return (
    <NextTabProvider>
      <NextTabList>
        <NextTab href="/">Tab 1</NextTab>
        <NextTab href="/tab-2">Tab 2</NextTab>
      </NextTabList>
      <NextTabPanel>{props.tabs}</NextTabPanel>
    </NextTabProvider>
  )
}

interface Props {
  tabs: React.ReactNode;
}

Under the @[parallel-route-name] folder, create your tabs:

// @tabs/page.tsx
export default function Page() {
  return <>Tab content 1</>
}
// @tabs/tab-2/page.tsx
export default function Page() {
  return <>Tab content 2</>
}

Readme

Keywords

none

Package Sidebar

Install

npm i @vtex/shoreline-next

Weekly Downloads

12

Version

1.0.76

License

none

Unpacked Size

33.5 kB

Total Files

9

Last publish

Collaborators

  • juan_almeida
  • aldreidosantosvtex
  • nikolas-oliveira-cwi
  • rodzac
  • kevinvtex
  • daniyelnnr
  • iago1501
  • carolinerpessoa
  • luiznickel-vtex
  • marcos_vtex
  • jardelymaris
  • denissilvavtex
  • eduardocesb
  • enzomerca
  • vinhags
  • zaedyvtex
  • filafb
  • bastotec
  • arthurtriis1vtex
  • geraldo.fernandes
  • georgebrindeiro
  • filipewl
  • emersonvtex
  • rodrigo.albuquerque
  • viniciuslouzadavtex
  • npedrosovtex
  • myllena.alves
  • mendescamara
  • mauro.takeda
  • lpolon
  • gianvittorio
  • eduardoformiga
  • vcnovaes
  • dpzvtex
  • vtexlab-user
  • wender
  • natamelo
  • mayzabel
  • augusto.lazaro
  • rafarubim
  • gustavorosolem
  • arthurepc
  • jeymisson
  • victorhmp
  • lurian
  • arturpimentel
  • anitavincent
  • brunojdo
  • lucasecdb
  • matheusps
  • emersonlaurentino
  • viniagostini
  • lucasaarcoverde
  • lariciamota
  • icazevedo
  • fabits
  • mateuspontes
  • gmantiqueira
  • vitorlgomes
  • rodolfoams
  • policarpo
  • marcelovicentegc
  • maianabt
  • jeffersontuc
  • hiagolcm
  • william.silva