> For the complete documentation index, see [llms.txt](https://docs.papillon.bzh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.papillon.bzh/design/components/layouts/tabheader.md).

# TabHeader

`<TabHeader />` est un composant [Layout](/design/components/layouts.md) conçu pour gérer l'en-tête (header) d'un écran, souvent utilisé dans des contextes de navigation par onglets.

Ce composant est conçu pour se placer au-dessus du contenu de la page (avec un positionnement `absolute`) et peut être intégré à des logiques d'animation comme le défilement (scrolling) pour des effets de réduction ou de superposition, bien que ces logiques d'animation doivent être implémentées à l'extérieur via les propriétés (voir `shouldCollapseHeader`).

### Exemple

```tsx
import React, {u seState } from 'react';
import { View } from 'react-native';
import { Papicons } from '@getpapillon/papicons';
import TabHeader from './TabHeader'; // Assurez-vous d'utiliser le bon chemin d'import
import TabHeaderTitle from './TabHeaderTitle';
import Search from './Search';
import Typography from '@/ui/components/Typography';
import { TouchableOpacity } from 'react-native';

const MyTabScreen = () => {
  const [height, setHeight] = useState(0)

  return (
    <View style={{ flex: 1 }}>
      <TabHeader
        onHeightChanged={(height) => setHeight(height)}
        title={
          <TabHeaderTitle
            title="Réglages"
            subtitle="Vos préférences utilisateur"
          />
        }
        trailing={
          <TouchableOpacity onPress={() => console.log('Settings pressed')}>
            <Papicons.Settings />
          </TouchableOpacity>
        }
        bottom={
          <Search placeholder="Rechercher un paramètre..." />
        }
      />
      {/* Le reste de votre contenu, comme un <TableFlatList />, doit avoir une marge supérieure pour ne pas être caché */}
      <View style={{ paddingTop: height, paddingHorizontal: 16 }}>
        <Typography>Contenu de l'écran...</Typography>
      </View>
    </View>
  );
};

export default MyTabScreen;
```

### Propriétés

| `onHeightChanged`      | `(height: number) => void`                | Callback appelé à chaque fois que la hauteur de l'en-tête est calculée ou modifiée. Essentiel pour ajuster la marge supérieure du contenu de l'écran.                                                    |
| ---------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `title`                | `React.ReactElement<TabHeaderTitleProps>` | Le composant de titre principal, généralement un `<TabHeaderTitle />`.                                                                                                                                   |
| `trailing`             | `React.ReactElement`                      | Un élément React placé à droite du titre (boutons, icônes d'action, etc.).                                                                                                                               |
| `bottom`               | `React.ReactElement`                      | Un élément React placé sous la ligne du titre (ex: `<Search />`).                                                                                                                                        |
| `shouldCollapseHeader` | `boolean`                                 | Indicateur si l'en-tête doit participer à un mécanisme de réduction (collapse) lors du défilement (même si l'animation elle-même est gérée à l'extérieur). *Non utilisé dans l'implémentation actuelle.* |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.papillon.bzh/design/components/layouts/tabheader.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
