Quarkus Feature Flags - Qute

The extension provides integration with Qute. It provides a namespace resolver that makes it possible to use the flags directly in templates.

If you want to use the Qute integration in your application you’ll need to add the io.quarkiverse.flags:quarkus-flags-qute extension to your build file first. For instance, with Maven, add the following dependency to your POM file:

<dependency>
    <groupId>io.quarkiverse.flags</groupId>
    <artifactId>quarkus-flags-qute</artifactId>
    <version>{project-version}</version>
</dependency>

Then you can access the flags directly in a template.

<!DOCTYPE html>
<html>
<head>
   <title>Flags</title>
</head>
<body>
   <h1>Hello - Quarkus Club 2025</h1>
   {#if flag:enabled('my-feature-alpha')}
   <p>Feature alpha is enabled!
   {/if}
   <ul>
   <h2>List of all flags</h2>
   {#for flag in flag:flags}
      <li>{flag.feature}</li>
   {/for}
   </ul>
</body>
</html>

Value accessors

The namespace resolver provides the following value accessor methods. If the flag does not exist, io.quarkus.qute.Results.NotFound is returned. You can use Qute default values to handle this case, e.g. {flag:string('my-feature').or('some default value')}.

{flag:enabled('my-feature')} (1)
{flag:bool('my-feature')} (2)
{flag:disabled('my-feature')} (3)
{flag:string('my-feature')} (4)
{flag:int('my-feature')} (5)
{flag:decimal('my-feature')} (6)
1 Returns true if the flag value is true, false otherwise.
2 Same as enabled.
3 Returns true if the flag value is false (negated boolean).
4 Returns the flag value as a string.
5 Returns the flag value as an integer.
6 Returns the flag value as a decimal (BigDecimal).

Other methods

If the flag does not exist, io.quarkus.qute.Results.NotFound is returned.

{flag:flags} (1)
{flag:find('my-feature')} (2)
{flag:meta('my-feature')} (3)
1 Returns a list of all flags.
2 Returns the Flag object for the given feature name.
3 Returns the metadata of the flag.

Default values

The value accessor methods (bool, enabled, disabled, string, int, decimal) accept an optional default value as the second parameter. The default value is returned if the flag is not found or if the underlying value cannot be converted to the requested type.

{flag:enabled('my-feature', true)} (1)
{flag:bool('my-feature', false)} (2)
{flag:disabled('my-feature', true)} (3)
{flag:string('my-feature', 'fallback')} (4)
{flag:int('my-feature', 42)} (5)
{flag:decimal('my-feature', 3.14)} (6)
1 Returns true if the flag does not exist or the value cannot be converted to boolean.
2 Same as enabled but returns false as the default.
3 Returns true (i.e. the feature is considered disabled) if the flag does not exist or the value cannot be converted.
4 Returns 'fallback' if the flag does not exist or the value cannot be converted to string.
5 Returns 42 if the flag does not exist or the value cannot be converted to integer.
6 Returns 3.14 if the flag does not exist or the value cannot be converted to decimal.