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

feat: add option "end" to the slider's origin property #2237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danieledler
Copy link

Closes #2236

📝 Description

The slider has an origin property that sets the start position of the filled track for single values. It currently includes "start" and "center" but misses an "end" option.

An "end" option is useful in scenarios where the slider value functions as a threshold to include values above it. Then it might make more sense to have the track filled from the thumb to the end rather than from the start to the thumb.

⛳️ Current behavior (updates)

Now the origin property has option "start" (default) and "center". For the "start" value, the track is filled from start (left in LTR contexts, right in RTL contexts) to the thumb. For "center", the track is filled from the center (50%) to the thumb.

🚀 New behavior

This PR adds the origin option "end" to the slider.

This PR also explains effect of this property more clearly.

💣 Is this a breaking change (Yes/No):

No

Copy link

changeset-bot bot commented Feb 15, 2025

🦋 Changeset detected

Latest commit: 28a35c5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 75 packages
Name Type
@zag-js/slider Minor
@zag-js/anatomy-icons Minor
@zag-js/anatomy Minor
@zag-js/core Minor
@zag-js/docs Minor
@zag-js/preact Minor
@zag-js/react Minor
@zag-js/solid Minor
@zag-js/svelte Minor
@zag-js/vue Minor
@zag-js/accordion Minor
@zag-js/angle-slider Minor
@zag-js/avatar Minor
@zag-js/carousel Minor
@zag-js/checkbox Minor
@zag-js/clipboard Minor
@zag-js/collapsible Minor
@zag-js/color-picker Minor
@zag-js/combobox Minor
@zag-js/date-picker Minor
@zag-js/dialog Minor
@zag-js/editable Minor
@zag-js/file-upload Minor
@zag-js/floating-panel Minor
@zag-js/hover-card Minor
@zag-js/menu Minor
@zag-js/navigation-menu Minor
@zag-js/number-input Minor
@zag-js/pagination Minor
@zag-js/pin-input Minor
@zag-js/popover Minor
@zag-js/presence Minor
@zag-js/progress Minor
@zag-js/qr-code Minor
@zag-js/radio-group Minor
@zag-js/rating-group Minor
@zag-js/select Minor
@zag-js/signature-pad Minor
@zag-js/splitter Minor
@zag-js/steps Minor
@zag-js/switch Minor
@zag-js/tabs Minor
@zag-js/tags-input Minor
@zag-js/time-picker Minor
@zag-js/timer Minor
@zag-js/toast Minor
@zag-js/toggle-group Minor
@zag-js/toggle Minor
@zag-js/tooltip Minor
@zag-js/tour Minor
@zag-js/tree-view Minor
@zag-js/store Minor
@zag-js/types Minor
@zag-js/aria-hidden Minor
@zag-js/auto-resize Minor
@zag-js/collection Minor
@zag-js/color-utils Minor
@zag-js/utils Minor
@zag-js/date-utils Minor
@zag-js/dismissable Minor
@zag-js/dom-query Minor
@zag-js/element-rect Minor
@zag-js/element-size Minor
@zag-js/file-utils Minor
@zag-js/focus-trap Minor
@zag-js/focus-visible Minor
@zag-js/highlight-word Minor
@zag-js/i18n-utils Minor
@zag-js/interact-outside Minor
@zag-js/live-region Minor
@zag-js/popper Minor
@zag-js/rect-utils Minor
@zag-js/remove-scroll Minor
@zag-js/scroll-snap Minor
@zag-js/stringify-state Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
zag-nextjs ✅ Ready (Inspect) Visit Preview Mar 7, 2025 7:34pm
zag-solid ✅ Ready (Inspect) Visit Preview Mar 7, 2025 7:34pm
zag-svelte ✅ Ready (Inspect) Visit Preview Mar 7, 2025 7:34pm
zag-vue ✅ Ready (Inspect) Visit Preview Mar 7, 2025 7:34pm
zag-website ✅ Ready (Inspect) Visit Preview Mar 7, 2025 7:34pm

@danieledler danieledler changed the title Add option "end" to the slider's origin property next to "start" and "center" feat: add option "end" to the slider's origin property Feb 15, 2025
@danieledler danieledler force-pushed the feat/slider-origin-end branch from b1aa780 to f4fa359 Compare March 7, 2025 15:31
@danieledler danieledler force-pushed the feat/slider-origin-end branch from f4fa359 to 4270c21 Compare March 7, 2025 19:05
@danieledler danieledler force-pushed the feat/slider-origin-end branch from 4270c21 to b6778ee Compare March 7, 2025 19:14
@danieledler
Copy link
Author

image Screenshot of the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option "end" to the slider's origin property next to "start" and "center"
1 participant