Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 728 Bytes

range.mdx

File metadata and controls

54 lines (38 loc) · 728 Bytes

Range

A slider input for selecting a numeric value within a range.


PHP API

Field::range(string $key): RangeField

Type-specific methods

->min(float $min): static    // Default: 0.0
->max(float $max): static    // Default: 100.0
->step(float $step): static  // Default: 1.0
->showValue(bool $show = true): static  // Show current value next to slider

Storage

Stored as a float.

{ "opacity": 0.75 }

Example

Field::range('opacity')
    ->label('Opacity')
    ->min(0.0)
    ->max(1.0)
    ->step(0.05)
    ->showValue()
    ->default(1.0),

Template usage

<div style="opacity: {{ ctrlfield_get('opacity') }}">
    ...
</div>