@jamiekyu/theyuzone-header
v1.0.6
Published
Shared header component for Next.js applications
Downloads
3
Maintainers
Readme
@jamiekyu/theyuzone-header
A reusable header component for Next.js applications.
Installation
npm install @jamiekyu/theyuzone-headerUsage
import Header from '@jamiekyu/theyuzone-header';
function App() {
return (
<Header
title="My App"
navigationItems={[
{ label: "Home", href: "/" },
{ label: "About", href: "/about" },
{ label: "External Link", href: "https://example.com", external: true }
]}
alwaysVisible={true}
/>
);
}Props
alwaysVisible?: boolean- Whether the header should always be visible (default: false)title?: string- The title/logo text (default: "the yu zone")titleHref?: string- The href for the title link (default: "/")navigationItems?: NavigationItem[]- Array of navigation itemsclassName?: string- Additional CSS classes
NavigationItem
label: string- The display texthref: string- The URL to navigate toexternal?: boolean- Whether this is an external link (uses instead of Next.js Link)
Development
Running Storybook
To view and test the header component in Storybook:
# Install dependencies
npm install
# Start Storybook development server
npm run storybookThis will start Storybook at http://localhost:6006 where you can:
- View different header configurations
- Test responsive behavior
- Interact with component props
- Test scroll-based visibility
Building the Package
# Build TypeScript to JavaScript
npm run build
# Watch for changes during development
npm run devPublishing to NPM
To publish a new version to npm:
Update the version in
package.json:npm version patch # for bug fixes npm version minor # for new features npm version major # for breaking changesBuild the package:
npm run buildPublish to npm:
npm publishOr if you need to publish with a specific access level:
npm publish --access public
Scripts
npm run build- Build the TypeScript packagenpm run dev- Watch for changes and rebuildnpm run storybook- Start Storybook development servernpm run build-storybook- Build Storybook for deployment
