# Icon

Icon est un wrapper conçu pour contenir une icône [**Lucide**](https://lucide.dev/icons/) ou une [**Papicon**](https://icons.papillon.bzh/). Celle-ci permet d'avoir d'avantage de contrôle sur l'affichage des icônes.

<figure><picture><source srcset="/files/eg5H3dCKrnriCoq8ywGV" media="(prefers-color-scheme: dark)"><img src="/files/X8FUf5q1vQsguyG3WGKH" alt=""></picture><figcaption></figcaption></figure>

## Fonctionnement

{% tabs %}
{% tab title="Avec une Papicon" %}

<pre class="language-tsx"><code class="lang-tsx">import * as Papicons from "@getpapillon/papicons"
import Icon from "@/ui/components/Icon";

<strong>&#x3C;Icon papicon>
</strong><strong>  &#x3C;Papicons.Ghost />
</strong><strong>&#x3C;/Icon>
</strong></code></pre>

{% endtab %}

{% tab title="Avec une icône Lucide" %}

```tsx
import { Ghost } from "lucide-react-native";
import Icon from "@/ui/components/Icon";

<Icon>
  <Ghost />
</Icon>
```

{% endtab %}

{% tab title="Avec une Vector Icon" %}

```tsx
import { FontAwesome5 } from "@react-native-vector-icons/fontawesome5";
import Icon from "@/ui/components/Icon";

<Icon>
  <FontAwesome5 name="ghost" />
</Icon>
```

{% endtab %}
{% endtabs %}

## Propriétés

### `color`

Couleur de fond de l'icône (Ajoute un padding et un fond)

| Type          |
| ------------- |
| Couleur (HEX) |

### `fill`

Couleur de remplissage de l'icône

| Type          | Valeur par défaut                                 |
| ------------- | ------------------------------------------------- |
| Couleur (HEX) | *Couleur du texte selon le thème clair ou sombre* |

### `papicon`

A activer si l'icône est une Papicon pour le fonctionnement d'`Icon`

{% hint style="warning" %}
Cette propriété sera inutile dans une future version des Papicons
{% endhint %}

| Type    | Valeur par défaut |
| ------- | ----------------- |
| Booléen | false             |

### `size`

Taille de l'icône

| Type   | Valeur par défaut |
| ------ | ----------------- |
| Nombre | 24                |

### `opacity`

Opacité de l'icône

| Type   | Valeur par défaut |
| ------ | ----------------- |
| Nombre | 1                 |


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.papillon.bzh/ui/components/icon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
