---
title: "Cycle ViewHelper <f:cycle>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-cycle@main"
source: "Global/Cycle.rst"
modified: "2026-09-17T05:12:06+00:00"
---

# Cycle ViewHelper `<f:cycle>`

This ViewHelper cycles through the specified values.
This can be often used to specify CSS classes for example.

To achieve the "zebra class" effect in a loop you can also use the
"iteration" argument of the **for** ViewHelper.

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

## Arguments of the `<f:cycle>` ViewHelper

-   **as**

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

    The name of the iteration variable

-   **values**

    -   *Type:* array

    The array or object implementing \\ArrayAccess (for example \\SplObjectStorage) to iterated over
