Feedback Progress Component Documentation

 Progress Component
   - value: number - Current progress value (required)
   - min: number - Minimum value (default: 0)
   - max: number - Maximum value (default: 100)
   - label: string - Accessible label (default: Basic example)
   - class: string - Additional CSS classes (optional)
   - showLabel: bool - Whether to show the value as text (optional)
   - variant: string - Color variant (primary, success, info, warning, danger) (optional)
   - striped: bool - Whether to show striped pattern (optional)
   - animated: bool - Whether to animate the stripes (optional)
   - textBg: bool - Whether to use text-bg-* classes for better text contrast (optional)

All available options for the Progress component

All available options for the Progress component


    ThemedComponent::make("feedback/progress")
	->addAttribute('value') //Add an attribute to the element. This is a string like 'data-foo="bar"' or multiple attributes in a single string like 'data-foo="bar" data-bar="baz"' (optional)
	->addCss('value') //string - Add css styles to the element. This should be '<style> custom-class {...} </style>' (optional)
	->addJavaScript('value') //string - Add a script to the element. This is a string like '<script>console.log('Hello World!')</script>' (optional)
	->animated('value') //bool - Whether to animate the stripes (optional)
	->canSee('value') //bool - Whether the component should be visible or not (optional)
	->class('value') //string - Additional CSS classes (optional)
	->id('value') //string - The id of the element. If no id is supplied, a random one will be generated (optional)
	->label('value') //string - Accessible label (default: Basic example)
	->max('value') //number - Maximum value (default: 100)
	->min('value') //number - Minimum value (default: 0)
	->showLabel('value') //bool - Whether to show the value as text (optional)
	->striped('value') //bool - Whether to show striped pattern (optional)
	->textBg('value') //bool - Whether to use text-bg-* classes for better text contrast (optional)
	->value('value') //number - Current progress value (required)
	->variant('value') //string - Color variant (primary, success, info, warning, danger) (optional)
	->render();

Basic Progress Bars

Simple progress bars with different values

// Basic progress bars
echo ThemedComponent::make('feedback/progress')
    ->value(0)
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(25)
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(50)
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(100)
    ->render();

Progress Bar Variants

Progress bars with different color variants

// Progress bar variants
echo ThemedComponent::make('feedback/progress')
    ->value(25)
    ->variant('success')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(50)
    ->variant('info')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->variant('warning')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(100)
    ->variant('danger')
    ->render();

// Progress bar variants with text background
echo ThemedComponent::make('feedback/progress')
    ->value(25)
    ->variant('success')
    ->textBg(true)
    ->showLabel(true)
    ->label('Success example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(50)
    ->variant('info')
    ->textBg(true)
    ->showLabel(true)
    ->label('Info example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->variant('warning')
    ->textBg(true)
    ->showLabel(true)
    ->label('Warning example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(100)
    ->variant('danger')
    ->textBg(true)
    ->showLabel(true)
    ->label('Danger example')
    ->render();
25%
50%
75%
100%

Striped and Animated Progress

Progress bars with striped patterns and animations

// Default striped progress bar
echo ThemedComponent::make('feedback/progress')
    ->value(10)
    ->striped(true)
    ->label('Default striped example')
    ->class('mb-3')
    ->render();

// Success striped progress bar
echo ThemedComponent::make('feedback/progress')
    ->value(25)
    ->striped(true)
    ->variant('success')
    ->label('Success striped example')
    ->class('mb-3')
    ->render();

// Info striped progress bar
echo ThemedComponent::make('feedback/progress')
    ->value(50)
    ->striped(true)
    ->variant('info')
    ->label('Info striped example')
    ->class('mb-3')
    ->render();

// Warning striped progress bar
echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->striped(true)
    ->variant('warning')
    ->label('Warning striped example')
    ->class('mb-3')
    ->render();

// Danger striped progress bar
echo ThemedComponent::make('feedback/progress')
    ->value(100)
    ->striped(true)
    ->variant('danger')
    ->label('Danger striped example')
    ->class('mb-3')
    ->render();

// Animated striped progress bars
echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->striped(true)
    ->animated(true)
    ->label('Animated striped example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->striped(true)
    ->animated(true)
    ->variant('success')
    ->label('Success animated example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->striped(true)
    ->animated(true)
    ->variant('info')
    ->label('Info animated example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->striped(true)
    ->animated(true)
    ->variant('warning')
    ->label('Warning animated example')
    ->class('mb-3')
    ->render();

echo ThemedComponent::make('feedback/progress')
    ->value(75)
    ->striped(true)
    ->animated(true)
    ->variant('danger')
    ->label('Danger animated example')
    ->render();

Progress with Labels

Progress bars with visible labels and custom ranges

// Progress bar with label
echo ThemedComponent::make('feedback/progress')
    ->value(25)
    ->showLabel(true)
    ->class('mb-3')
    ->render();

// Progress bar with custom min/max
echo ThemedComponent::make('feedback/progress')
    ->value(7500)
    ->min(0)
    ->max(10000)
    ->showLabel(true)
    ->render();
25%
( ! ) Warning: A non-numeric value encountered in /var/www/html/vendor/twig/twig/src/Environment.php(420) : eval()'d code on line 82 Call Stack #TimeMemoryFunctionLocation 10.0000359256{main}( ).../index.php:0 20.0191698248include( '/var/www/html/feedback/progress.php ).../index.php:79 30.0344984512Skuilplek\Themed\ThemedComponent->render( ).../progress.php:404 40.0344984936Twig\Environment->render( $name = 'feedback/progress.twig', $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]] ).../ThemedComponent.php:379 50.0344985016Twig\TemplateWrapper->render( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]] ).../Environment.php:333 60.0344985016Twig\Template->render( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]] ).../TemplateWrapper.php:51 70.03441002048Twig\Template->display( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]], $blocks = ??? ).../Template.php:373 80.03441007416__TwigTemplate_619ee5ca8b6d766f5a8962c61d45640b->doDisplay( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]], $blocks = [] ).../Template.php:358
( ! ) Warning: A non-numeric value encountered in /var/www/html/vendor/twig/twig/src/Environment.php(420) : eval()'d code on line 82
Call Stack
#TimeMemoryFunctionLocation
10.0000359256{main}( ).../index.php:0
20.0191698248include( '/var/www/html/feedback/progress.php ).../index.php:79
30.0344984512Skuilplek\Themed\ThemedComponent->render( ).../progress.php:404
40.0344984936Twig\Environment->render( $name = 'feedback/progress.twig', $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]] ).../ThemedComponent.php:379
50.0344985016Twig\TemplateWrapper->render( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]] ).../Environment.php:333
60.0344985016Twig\Template->render( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]] ).../TemplateWrapper.php:51
70.03441002048Twig\Template->display( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]], $blocks = ??? ).../Template.php:373
80.03441007416__TwigTemplate_619ee5ca8b6d766f5a8962c61d45640b->doDisplay( $context = ['content' => ['value' => 7500, 'min' => '', 'max' => 10000, 'showLabel' => TRUE, 'id' => '68206d6d25274', 'classes' => '', 'attributes' => [...]]], $blocks = [] ).../Template.php:358
70%"> 7500%

Progress component template

The Twig template file for the Progress component

Content of the progress.twig file
{# Progress Component
   - value: number - Current progress value (required)
   - min: number - Minimum value (default: 0)
   - max: number - Maximum value (default: 100)
   - label: string - Accessible label (default: Basic example)
   - class: string - Additional CSS classes (optional)
   - showLabel: bool - Whether to show the value as text (optional)
   - variant: string - Color variant (primary, success, info, warning, danger) (optional)
   - striped: bool - Whether to show striped pattern (optional)
   - animated: bool - Whether to animate the stripes (optional)
   - textBg: bool - Whether to use text-bg-* classes for better text contrast (optional)
#}
<div class="progress {{ content.class|default('') }}" 
     role="progressbar" 
     aria-label="{{ content.label|default('Basic example') }}" 
     aria-valuenow="{{ content.value|default(0) }}" 
     aria-valuemin="{{ content.min|default(0) }}" 
     aria-valuemax="{{ content.max|default(100) }}">
    <div class="progress-bar{% if content.variant %}{% if content.textBg %} text-bg-{{ content.variant }}{% else %} bg-{{ content.variant }}{% endif %}{% endif %}{% if content.striped %} progress-bar-striped{% endif %}{% if content.animated %} progress-bar-animated{% endif %}" 
         style="width: {{ ((content.value|default(0)|number_format) / (content.max|default(100)|number_format) * 100)|round }}%">
        {% if content.showLabel %}{{ content.value|default(0) }}%{% endif %}
    </div>
</div>