You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@vtex/shoreline-next

Package Overview
Dependencies
0
Maintainers
0
Versions
87
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtex/shoreline-next

Nextjs-aware Shoreline components


Version published
Maintainers
0
Created

Readme

Source

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</>
}

FAQs

Package last updated on 16 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc