
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@sofidevo/astro-dynamic-header
Advanced tools
A dynamic Astro header component that switches between floating and fullscreen styles
A dynamic, responsive header component for Astro projects that can switch between floating and fullscreen styles with multi-level dropdown navigation support.
https://base-astro-psi.vercel.app/fullscreen-demo
npm i @sofidevo/astro-dynamic-header
---
// Option 1: Import from direct subpath (recommended)
import Header from '@sofidevo/astro-dynamic-header/Header';
// Option 2: Import from main entry point with types
import { HeaderProps, type MenuItemType } from '@sofidevo/astro-dynamic-header';
const menuItems = [
{ link: '/about', text: 'About' },
{ link: '/contact', text: 'Contact' },
];
---
<Header
headerType="floating"
logoSrc="/logo.png"
menuItems={menuItems}
/>
To ensure imports work correctly in your Astro project, make sure your tsconfig.json has the appropriate configuration:
{
"compilerOptions": {
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"strict": true,
"noEmit": true,
"jsx": "preserve"
},
"extends": "astro/tsconfigs/strict"
}
---
import Header from '@sofidevo/astro-dynamic-header/Header';
import type { MenuItemType } from '@sofidevo/astro-dynamic-header';
const menuItems = [
{
link: '#',
text: 'Services',
submenu: [
{
link: '#',
text: 'Web Development',
submenu: [
{ link: '/web/frontend', text: 'Frontend' },
{ link: '/web/backend', text: 'Backend' },
{ link: '/web/fullstack', text: 'Full Stack' },
],
},
{ link: '/design', text: 'Design' },
{ link: '/consulting', text: 'Consulting' },
],
},
{ link: '/about', text: 'About' },
{ link: '/contact', text: 'Contact' },
];
---
<Header
headerType="fullscreen"
logoSrc="/logo.png"
logoAlt="My Company"
logoWidth="150px"
homeUrl="/"
menuItems={menuItems}
backgroundColor="#000000dd"
backdropBlur="blur(15px)"
zIndex={100}
/>
| Prop | Type | Default | Description |
|---|---|---|---|
headerType | "floating" | "fullscreen" | "floating" | Header layout style |
logoSrc | string | "/logo.png" | Logo image source |
logoAlt | string | "Logo" | Logo alt text |
logoWidth | string | "120px" | Logo width |
homeUrl | string | "/" | Home page URL |
menuItems | MenuItemType[] | [] | Navigation menu items |
backgroundColor | string | "#0d0d0dcc" | Header background color |
backdropBlur | string | "blur(20px)" | Backdrop filter blur |
zIndex | number | 10 | CSS z-index value |
interface MenuItemType {
link: string;
text: string;
submenu?: MenuItemType[];
}
The Header component provides two customizable slots that allow you to add additional content:
| Slot Name | Location | Visibility | Description |
|---|---|---|---|
slot-desktop | Header (desktop & mobile) | Always visible | Add content to the main header area |
slot-panel | Mobile navigation panel | Mobile only | Add content to the mobile menu panel |
---
import Header from '@sofidevo/astro-dynamic-header/Header';
const menuItems = [
{ link: '/about', text: 'About' },
{ link: '/contact', text: 'Contact' },
];
---
<!-- Adding content only to desktop header -->
<Header
headerType="floating"
logoSrc="/logo.png"
menuItems={menuItems}
>
<button slot="slot-desktop" class="cta-button">Get Started</button>
</Header>
<!-- Adding content only to mobile panel -->
<Header
headerType="fullscreen"
logoSrc="/logo.png"
menuItems={menuItems}
>
<div slot="slot-panel" class="mobile-footer">
<p>© 2024 My Company</p>
<div class="social-links">
<a href="/twitter">Twitter</a>
<a href="/linkedin">LinkedIn</a>
</div>
</div>
</Header>
---
import Header from '@sofidevo/astro-dynamic-header/Header';
const menuItems = [
{ link: '/about', text: 'About' },
{ link: '/services', text: 'Services' },
{ link: '/contact', text: 'Contact' },
];
---
<Header
headerType="fullscreen"
logoSrc="/logo.png"
logoAlt="My Company"
logoWidth="150px"
homeUrl="/"
menuItems={menuItems}
backgroundColor="#000000dd"
backdropBlur="blur(15px)"
zIndex={100}
>
<!-- Content for desktop header -->
<button slot="slot-desktop" class="cta-button">
Sign Up
</button>
<!-- Content for mobile panel -->
<div slot="slot-panel" class="mobile-extras">
<button class="mobile-cta">Download App</button>
<div class="mobile-contact">
<p>Call us: +1 (555) 123-4567</p>
<p>Email: info@company.com</p>
</div>
</div>
</Header>
The slot-desktop is visible on both desktop and mobile by default. If you want to hide it on mobile, use CSS:
/* Hide desktop slot on mobile devices */
@media (width < 768px) {
.cta-button {
display: none;
}
}
/* Or create responsive variants */
.desktop-only {
display: block;
}
@media (width < 768px) {
.desktop-only {
display: none;
}
}
<Header menuItems={menuItems}>
<button slot="slot-desktop" class="cta-button desktop-only">
Desktop CTA
</button>
<div slot="slot-panel">
<button class="mobile-cta">Mobile CTA</button>
</div>
</Header>
The component uses CSS custom properties that you can override:
:root {
--light-spot-color: #00ffff;
--color-tertiary: #ffffff;
--color-hamburger-lines: #ffffff;
}
Full TypeScript support with exported interfaces:
import type {
MenuItemType,
HeaderProps,
NavMenuProps,
MobileNavProps,
HamburgerButtonProps
} from '@sofidevo/astro-dynamic-header';
backdrop-filterIf you encounter import errors, try these solutions:
Use direct subpath import:
import Header from '@sofidevo/astro-dynamic-header/Header';
Verify TypeScript configuration:
// tsconfig.json
{
"compilerOptions": {
"moduleResolution": "bundler", // or "nodenext"
"allowImportingTsExtensions": true
}
}
Import types separately:
---
import Header from '@sofidevo/astro-dynamic-header/Header';
import type { MenuItemType } from '@sofidevo/astro-dynamic-header';
---
Visit our demo website to see the component in action with interactive examples and complete documentation.
This project includes a comprehensive test suite with 34 tests covering all critical functionality.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage report
npm run test:coverage
The test suite covers:
MIT License - see the LICENSE file for details.
If you find this package helpful, please consider giving it a ⭐ on GitHub!
FAQs
A dynamic Astro header component that switches between floating and fullscreen styles
The npm package @sofidevo/astro-dynamic-header receives a total of 19 weekly downloads. As such, @sofidevo/astro-dynamic-header popularity was classified as not popular.
We found that @sofidevo/astro-dynamic-header demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.