0.7.2

WidgetNavbar

Source code

.

---
import { WidgetNavbar } from '@yatoday/astro-ui/astro';
---

<WidgetNavbar
  position="right"
  links={[
    {
      text: "Getting started",
      links: [
        {text: "Styling & Theme variables", href: "/docs/styling"}, 
        {text: "Components", href: "/docs/breadcrumbs"}, 
        {text: "Features", href: "/docs/feature-back-to-top"}, 
        {text: "Widgets", href: "/docs/widget-card-slider"}
      ]
    }, 
    {
      text: "Accessibility",
      links: [
        {text: "Accessibility", href: "/docs/accessibility"}, 
        {text: "Accessibility testing", href: "/docs/accessibility-testing"}
      ]
    }, 
    {text: "About Us", href: "/"}, 
    {text: "Contact", href: "/"}
  ]}
/>
Sticky & ToggleTheme
---
import { WidgetNavbar } from '@yatoday/astro-ui/astro';
---

<WidgetNavbar
  isSticky={true}
  showToggleTheme={true}
  classes={{
    container: "mx-auto max-w-6xl bg-background text-foreground",
  }}
  links={[
    {
      text: "Getting started",
      links: [
        {text: "Styling & Theme variables", href: "/docs/styling"}, 
        {text: "Components", href: "/docs/breadcrumbs"}, 
        {text: "Features", href: "/docs/feature-back-to-top"}, 
        {text: "Widgets", href: "/docs/widget-card-slider"}
      ]
    }, 
    {
      text: "Accessibility",
      links: [
        {text: "Accessibility", href: "/docs/accessibility"}, 
        {text: "Accessibility testing", href: "/docs/accessibility-testing"}
      ]
    }, 
    {text: "About Us", href: "/"}, 
    {text: "Contact", href: "/"}
  ]}
  actions={[{ text: 'Action', href: '/', variant: 'outline' }]}
>
  <Fragment slot="logo">LOGO</Fragment>
  <Fragment slot="actions">
    <Button variant="outline" class="ml-2 py-2.5 px-5.5 md:px-6 font-semibold shadow-none text-sm w-auto">
      Create Account
    </Button>
  </Fragment>
</WidgetNavbar>
With actions
---
import { WidgetNavbar } from '@yatoday/astro-ui/astro';
---

<WidgetNavbar
  isSticky={true}
  classes={{
    container: "mx-auto max-w-6xl bg-background text-foreground",
  }}
  links={[
    {
      text: "Getting started",
      links: [
        {text: "Styling & Theme variables", href: "/docs/styling"}, 
        {text: "Components", href: "/docs/breadcrumbs"}, 
        {text: "Features", href: "/docs/feature-back-to-top"}, 
        {text: "Widgets", href: "/docs/widget-card-slider"}
      ]
    }, 
    {
      text: "Accessibility",
      links: [
        {text: "Accessibility", href: "/docs/accessibility"}, 
        {text: "Accessibility testing", href: "/docs/accessibility-testing"}
      ]
    }, 
    {text: "About Us", href: "/"}, 
    {text: "Contact", href: "/"}
  ]}
  actions={[{ text: 'Action', href: '/', variant: 'outline' }]}
>
  <Fragment slot="logo">LOGO</Fragment>
  <Fragment slot="actions">
    <Button variant="outline" class="ml-2 py-2.5 px-5.5 md:px-6 font-semibold shadow-none text-sm w-auto">
      Custom Action
    </Button>
  </Fragment>
</WidgetNavbar>

<!-- Actions as props -->
<WidgetNavbar
  actions={[
    { text: 'Action 1',  href: '/', variant: 'outline' },
    { text: 'Action 2',  href: '/', variant: 'primary' },
  ]}
/>

Props

PropTypeDefaultDescription
positioncenter | left | rightcenter-
linksArray[]Array of Link items
actionsArray[]Array of ToAction components
isStickybooleanfalse-
isDarkbooleanfalseAdds the dark CSS class to the WidgetWrapper
showToggleThemebooleanfalse-
scrollOffsetnumber60How much do you need to scroll the page to apply pinned classes
classes.headerstringCSS classes for the wrapper header container
classes.containerstringmax-w-7xl 2xl:max-w-[96rem] md:mx-autoCSS classes for the container
classes.linksstringhover:text-link dark:hover:text-white-
classes.dropdownstringbg-background text-foreground md:shadow-lg-
classes.dropdownLinksstringhover:bg-black/10 hover:text-link dark:hover:text-white dark:hover:bg-white/10-
classes.darkModeIconstring--
classes.pinnedstringbg-background md:bg-background/90 md:backdrop-blur-mdClasses that will be applied when scrolling the page
classes.unpinnedstring-Classes applied by default