---
title: "If ViewHelper <f:if>"
manual: "Fluid ViewHelper Reference"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-if@14.3"
source: "Global/If.rst"
rendered: "2026-10-01T16:43:06+00:00"
---

# If ViewHelper `<f:if>` {#typo3fluid-fluid-if}

This ViewHelper implements an if/else condition.

Go to the source code of this ViewHelper: [IfViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/IfViewHelper.php).

## Arguments of the `<f:if>` ViewHelper {#typo3fluid-fluid-if-arguments}

-   **condition**

    -   *Type:* boolean
    -   *Default:* false

    Condition expression conforming to Fluid boolean rules

-   **else**

    -   *Type:* mixed

    Value to be returned if the condition if not met.

-   **then**

    -   *Type:* mixed

    Value to be returned if the condition if met.
