Skip to main content

Header

The Header component is a versatile header that displays a logo, brand name, and user-related actions. Below you will find detailed information about its props and how to use it.

Props

PropTypeDefaultDescription
userUsernullThe user object containing the user's name and email.
iconReactNodenullAn optional icon to display next to the brand name.
anonymousActionsReactNodenullActions to display when the user is not logged in.
stickybooleantrueDetermines if the header should stick to the top of the page.
brandNamestringRequiredThe name of the brand to display in the header.
onLogout() => voidnullCallback function to handle logout action.

Example Usage

Header with Logged-In User

<Header
brandName="Ginger Society"
user={{ name: 'Jane Doe', email: 'jane.doe@example.com' }}
icon={<span >Icon</span>}
onLogout={() => alert('Logout clicked')}
/>

Ginger Society





Header with No User

<Header
brandName="Ginger Society"
icon={<span >Icon</span>}
anonymousActions={<Button label="Login" onClick={() => alert('Login clicked')} />}
/>

Ginger Society