---
title: "Argument ViewHelper <f:argument>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-argument@main"
source: "Global/Argument.rst"
rendered: "2026-09-25T05:46:13+00:00"
---

# Argument ViewHelper `<f:argument>` {#typo3fluid-fluid-argument}

`f:argument` allows to define requirements and type constraints to variables that
are provided to templates and partials. This can be very helpful to document how
a template or partial is supposed to be used and which input variables are required.

These requirements are enforced during rendering of the template or partial:
If an argument is defined with this ViewHelper which isn't marked as `optional`,
an exception will be thrown if that variable isn't present during rendering.
If a variable doesn't match the specified type and can't be converted automatically,
an exception will be thrown as well.

Note that `f:argument` ViewHelpers must be used at the root level of the
template, and can't be nested into other ViewHelpers. Also, the usage of variables
in any of its arguments is not possible (e. g. you can't define an argument name
by using a variable).

Rendering of specific sections will not validate argument constraints. They
will only be evaluated if the template or partial is rendered directly.

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

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

-   **default**

    -   *Type:* mixed

    default value for optional argument

-   **description**

    -   *Type:* string

    description of the template argument

-   **name**

    -   *Type:* string
    -   *Required:* true

    name of the template argument

-   **optional**

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

    true if the defined argument should be optional

-   **type**

    -   *Type:* string
    -   *Required:* true

    type of the template argument
