Step Slider #28618
FlippFlopps
started this conversation in
Feature Request
Step Slider
#28618
Replies: 1 comment
|
You can actually easily upgrade the SELECT control by only changing the UI side. It could have an options same as 'label_block' (which modifies how label is displayed), that option whould be 'display_as' and have two options 'dropdown' (default) and 'slider', where 'slider' would produce the above described step-slider UI. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
What problem is your feature request going to solve? Please describe..
It will simplify UX for end users and speed up development for developers.
Describe the solution you'd like.
Widget Control: Step Slider
It's like a SLIDER Control on the UI side, and like a SELECT control on the backend. And instead of sliding over min/max range, it slides over an array of key=>value pairs, aka the steps.
It's useful for any custom incremental sequence that is not a simple 1, 2, 3... for example custom font sizes, container sizes, button sizes etc. (providing a "font sizes" example below)
Describe alternatives you've considered.
I've only encountered this in music software production "controls", the alternative in Elementor would be the SELECT control but doesn't have a slider UI option. SELECT stops the user and their creative process, and they need to constantly use the dropdown (most aren't using the up/down arrows). But think of a user using a slider to apply all available custom theme/widget font sizes on a text in real time.
Additional context
Here is an example how the control should look, with comments regarding functionality:
`/**
/
$this->add_control(
'custom_font_sizes',
[
'label' => esc_html__( 'Custom Font Sizes', 'text-domain' ),
'type' => Controls_Manager::STEP_SLIDER, // CONTROL NAME
'steps' => [
/*
* HERE WE PASS AN ARRAY OF OUR CUSTOM "STEPS", SAME AS 'options' IN SELECT CONTROL.
* DEVS WORK WITH THE KEYS, AND THE USERS SEE THE VALUES
/
[
'font-10' => esc_html__( 'Font 10', 'text-domain' ),
'font-16' => '16',
'font-18' => esc_html__( 'Font 18', 'text-domain' ),
'large-font' => esc_html__( 'Large Font', 'text-domain' ),
'banana-font' => esc_html__( 'Banana Font', 'text-domain' ),
]
],
'default' => 'font-16',
]
);
/*
*/`
Agreement
All reactions