runway

Runway

Header

A customizable header component for any website



The Header component is a customizable header that can include a logo, app name (both pulled from config.js), navigation links, and a call-to-action button. It is designed to be responsive and can adapt to different screen sizes automatically (dropdown menu on mobile).

It uses TextLink and Button components for navigation and call-to-action respectively.



Usage

The component automatically pulls the logo and app name from config.js if they are defined, so you can simply import the component and use it like this:

javascript

1import Header from '@/components/organisms/Header';
2
3<Header
4    navLinks={[
5        { title: 'Home', href: '/' },
6        { title: 'About', href: '/about' },
7        { title: 'Contact', href: '/contact' },
8    ]}
9    ctaButton={{
10        label: 'Get Started',
11        href: '/get-started',
12    }}
13/>

Since Header uses TextLink and Button components, you can pass any prop that they accept to customize the header, for example:

javascript

1// For nav links
2{
3    title: 'Home',
4    href: '/',
5    props: { underline: true, fade: true },
6}
7
8// For CTA button
9{
10    label: 'Get Started',
11    href: '/get-started',
12    props: { size: 'lg', color: 'primary' },
13}



Props

NameTypeDefaultDescription
showLogobooleantrueIf true, the logo will be displayed.
showAppNamebooleantrueIf true, the app name will be displayed.
navLinksarray[]Array of navigation links. Each link is an object with name, href, and optional props.
ctaButtonobjectnullCall-to-action button. An object with label, href, and optional props.
backgroundstring"bg-bg-100 dark:bg-bg-800"Background color (use tailwind.config).
bottomBorderbooleanfalseIf true, a bottom border will be displayed.
stickybooleanfalseIf true, the header will be sticky.
accountbooleanfalseIf true, the account button will be displayed.
classNamestring""Additional Tailwind utility classes.
...propsobject-Any other valid HTML attributes for the <header> element.

The sticky prop is disabled by default, so the header will scroll with the page. To make it sticky, set the sticky prop to true.

The account prop can only be used under /app/(auth) pages since it uses the UserProvider. It uses the AccountCard component.




Examples

Default Header


Header Hiding App Name


Header with Custom Nav Links and CTA Button

Checkout TextLink and Button for more customization options.


Header with Custom Background Color

The background prop accepts any valid Tailwind utility classes.