Skip to content

Status & Progress ​

Progress and loading states.

INFO

Every component also has the common methods (key, visible, class, attributes, view…).

ProgressBar ​

progress-bar

Progress bar with optional value and unit.

php
use Cg\ComponentFramework\Component\ProgressBar\ProgressBar;

ProgressBar::make('上傳進度')
    ->value(72)
    ->showValue()
    ->color('success');

Constructor:ProgressBar::make(Closure|string $label = '處理進度')

Options

  • color():primary · success · warning · danger · info
  • size():sm · md · lg
All methods (8)
  • color(string $color)
  • size(string $size)
  • showLabel(bool $condition = true)
  • label(Closure|string $label)
  • value(Closure|int|float|null $value)
  • range(int|float $min, int|float $max)
  • showValue(Closure|bool $condition = true)
  • unit(string $suffix, string $prefix = '')

ProgressIndicator ​

progress-indicator

Circular progress indicator with a custom range.

php
use Cg\ComponentFramework\Component\ProgressIndicator\ProgressIndicator;

ProgressIndicator::make('完成度')
    ->range(0, 5)
    ->value(3)
    ->showValue()
    ->size('lg');

Constructor:ProgressIndicator::make(Closure|string $label = '處理進度')

Options

  • color():primary · success · warning · danger · info
  • size():sm · md · lg · xl
All methods (7)
  • color(string $color)
  • size(string $size)
  • label(Closure|string $label)
  • value(Closure|int|float|null $value)
  • range(int|float $min, int|float $max)
  • showValue(Closure|bool $condition = true)
  • unit(string $suffix, string $prefix = '')

Skeleton ​

skeleton loading

Loading placeholder skeleton.

php
use Cg\ComponentFramework\Component\Skeleton\Skeleton;

Skeleton::make('載入文章')
    ->lines(3)
    ->animation('wave');

Constructor:Skeleton::make(string $label = '載入中')

Options

  • shape():text · rectangle · circle
  • animation():pulse · wave · none
All methods (6)
  • label(string $label)
  • shape(string $shape)
  • animation(string $animation)
  • dimensions(string|int|float $width, string|int|float|null $height = null)
  • lines(int $lines)
  • decorative(bool $condition = true)

Spinner ​

spinner loading

Spinning loading indicator.

php
use Cg\ComponentFramework\Component\Spinner\Spinner;

Spinner::make('儲存中')->size('sm')->color('primary');

Constructor:Spinner::make(string $label = '載入中')

Options

  • color():current · primary · success · warning · danger · info
  • size():xs · sm · md · lg · xl
All methods (4)
  • label(string $label)
  • color(string $color)
  • size(string $size)
  • decorative(bool $condition = true)

Stepper ​

stepper workflow

Step indicator showing progress through a flow.

php
use Cg\ComponentFramework\Component\Stepper\Step;
use Cg\ComponentFramework\Component\Stepper\Stepper;

Stepper::make([
    Step::make('cart', '購物車')->complete(),
    Step::make('pay', '付款')->current(),
    Step::make('done', '完成'),
]);

Constructor:Stepper::make(iterable $steps = [])

Options

  • orientation():horizontal · vertical
All methods (6)
  • steps(iterable $steps)
  • push(Step $step)
  • label(string $label)
  • orientation(string $orientation)
  • active(?string $key)
  • numbered(bool $condition = true)

Generated from source by scripts/wiki-components/generate.php; every example is rendered as part of the build.