# Customizing Header

## Customizing The Header

**Files:** `src/config/config.toml`, `src/config/menu.<lang>.json`, `src/i18n/<lang>.json`, `src/layouts/components/global/header/` · **Skill level:** Beginner

The Folex header holds these parts:

- **Logo:** [update your site's logo](../site-identify-logo/).
- **Menu:** [edit the menus](../menus/). For dropdowns, nested flyouts, mega menus, and keyboard support, see [Navigation](../../features/navigation/).
- **Language switch:** [manage your languages](../internationalization/). It doesn't show on blog category and tag pages.
- **Navigation button:** see below.
- **Side panel button:** the round button that opens the side panel. See below.

In the Tina edition, edit these in **Site settings > Settings**, **Menus**, and **Interface labels** at `/admin/`. In the Sanity edition, they are in **Site settings > Settings**, and the **Menus** and **Interface labels** of each language, in the Studio. The options for each page, at the end of this page, stay in code in every edition.

### Customizing The Navigation Button
To show or edit the button in the header, open `src/config/config.toml` and find this section:

```toml
# src/config/config.toml
[settings.navigationButton]
  enable = true        # Show or hide the button
  label  = ""          # Button text. Leave empty to use the text in each language file
  url    = "/contact/" # Button link
```

The label is in each language file, so it can change with the language:

1. Open `src/i18n/en.json`, then the same file for each of your other languages, such as `src/i18n/fr.json` and `src/i18n/ar.json`.
2. Find the `navigation` group.
3. Change the `buttonLabel` value.

```json
"navigation": {
  "buttonLabel": "Get Started"
}
```

A value in `label` in `config.toml` replaces the text in every language.

### Customizing The Side Panel
The round button opens a panel from the side, with your logo, a description, your address, phone, and email, your social links, and a button. On small screens, the panel also holds the menu.

```toml
# src/config/config.toml
[settings.headerOffcanvas]
  enable      = true
  logo        = "/images/logo-light.svg"
  description = "" # Leave empty to use the text in each language file

  [settings.headerOffcanvas.button]
    enable = true
    label  = "" # Leave empty to use the text in each language file
    url    = "/contact/"
```

The description and button label are in each language file, under `headerOffcanvas`: `description` and `buttonLabel`. The address, phone, and email come from [your contact information](../../how-to/contact-info/).

<Aside type="caution">
  Keep `enable = true`. The menu for small screens sits inside this panel, so
  turning the panel off also removes the menu on phones. To hide the panel on
  large screens only, see `hideOffcanvas` below.
</Aside>

### Sticky Header
`stickyHeader` under `[settings]` turns on the scroll behavior of the header, such as hiding it as you scroll down.

```toml
# src/config/config.toml
[settings]
  stickyHeader = true
```

### Options For Each Page
Each page file in `src/pages/[...lang]/` can set these options on `Base`:

| Option                    | Values                                  | What it does                                             |
| ------------------------- | --------------------------------------- | -------------------------------------------------------- |
| `headerPosition`          | `sticky` (the default), `fixed`, `static` | Where the header sits                                  |
| `hasHeaderDarkBackground` | `true` or `false` (the default)         | Uses `logoAlternate` and light colors, for a dark page top |
| `hideOffcanvas`           | `true` or `false` (the default)         | Hides the side panel and its button on large screens     |

This is how the pages use them:

| Page                  | `headerPosition` | `hasHeaderDarkBackground` | `hideOffcanvas` |
| --------------------- | ---------------- | ------------------------- | --------------- |
| `/creative-agency/`   | `fixed`          | `true`                    | `true`          |
| `/personal-portfolio/` | `fixed`         | `true`                    | No              |
| `/startup-agency/`    | `fixed`          | `true`                    | `true`          |
| `/about/`             | Default          | No                        | `true`          |
| Every other page      | Default          | No                        | No              |

For example, in `src/pages/[...lang]/startup-agency.astro`:

```astro
<Base
  {...page?.data}
  hideOffcanvas={true}
  headerPosition="fixed"
  footerLayout={"footer-3"}
  hasHeaderDarkBackground={true}>
```

### Do It With AI
```text
On the page [ROUTE FILE] in src/pages/[...lang]/, make the header [fixed / sticky] with a
[dark / light] background, using headerPosition and hasHeaderDarkBackground on Base. Don't change
any other page. Keep settings.headerOffcanvas enabled, because the mobile menu is inside it. Then
run npm run astro-check.
```