Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Slider #15507

Open
wants to merge 14 commits into
base: 4.x
Choose a base branch
from

Conversation

thethunderturner
Copy link
Contributor

@thethunderturner thethunderturner commented Feb 3, 2025

Description

Closes #12728

This PR aims to add the slider component natively on filament. This PR was originally scheduled for 3.x for which I already made a PR, then it was rescheduled for 4.1. Now im seeing Slider component is rescheduled for 4.0. Therefore I decided to revisit, and make it work for 4.x. I have also written the documentation for it.

Visual changes

image

The only things thast are probably missing, are test cases. But that can be done after the team makes sure the main code is ok.

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@danharrin
Copy link
Member

FYI this will be on hold and not reviewed until after v4.0.0-alpha1 is released

@thethunderturner
Copy link
Contributor Author

FYI this will be on hold and not reviewed until after v4.0.0-alpha1 is released

Yes, I'm aware

@andrefelipe18
Copy link

@thethunderturner Would you consider keeping two libraries?
This could be rethought while Dan doesn't revise it.
I'm looking forward to this feature

@thethunderturner
Copy link
Contributor Author

@thethunderturner Would you consider keeping two libraries? This could be rethought while Dan doesn't revise it. I'm looking forward to this feature

Can you elaborate? What do you mean by two libraries?

@ziming
Copy link
Contributor

ziming commented Feb 3, 2025

can this slider have just 1 value instead of 2 bars? the text above the bar is it editable by clicking on it?

@andrefelipe18
Copy link

andrefelipe18 commented Feb 3, 2025

@thethunderturner Would you consider keeping two libraries? This could be rethought while Dan doesn't revise it. I'm looking forward to this feature

Can you elaborate? What do you mean by two libraries?

You added: nouislider, wnumb.
This might be strongly considered since they are external libraries and would create two new dependencies for just one component

@thethunderturner
Copy link
Contributor Author

can this slider have just 1 value instead of 2 bars? the text above the bar is it editable by clicking on it?

Yes it can, if you check the screenshots that I added, there is a simple example and more complicated example

@thethunderturner
Copy link
Contributor Author

@thethunderturner Would you consider keeping two libraries? This could be rethought while Dan doesn't revise it. I'm looking forward to this feature

Can you elaborate? What do you mean by two libraries?

You added: nouislider, wnumb. This might be strongly considered since they are external libraries and would create two new dependencies for just one component

I will think about it.

@ziming
Copy link
Contributor

ziming commented Feb 3, 2025

https://github.com/n3r4zzurr0/range-slider-input

Can be considered too as its default stylings seem to look nicer or if the filament team prefer something more lightweight. I experiment with it briefly recently in a brief attempt to learn about making filament custom field for the 1st time

CleanShot 2025-02-03 at 21 07 00@2x
Slider Field with accompanying text box for manual edit

But it likely has way less features than nouislider and I'm sure community can make the nouislider looks nicer as I'm very bad at frontend

Also just curious, what are the reasons why it has to go to filament 4 and not filament 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants