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 2 commits 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

⚠️ No Changeset found

Latest commit: b1aa780

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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 Feb 15, 2025 4:07pm
zag-solid ✅ Ready (Inspect) Visit Preview Feb 15, 2025 4:07pm
zag-svelte ✅ Ready (Inspect) Visit Preview Feb 15, 2025 4:07pm
zag-vue ✅ Ready (Inspect) Visit Preview Feb 15, 2025 4:07pm
zag-website ✅ Ready (Inspect) Visit Preview Feb 15, 2025 4:07pm

@danieledler
Copy link
Author

I can't commit a changelog due to missing submodule zag-plus?

After running npx @changesets/cli I got a file .changeset/five-donkeys-complain.md with the following content

---
"@zag-js/slider": minor
---

Add option 'end' to slider origin.

However, I could not commit this change. Git returns an error because it can't find the submodule examples/next-ts/pages/compositions.

In the repo, compositions links to https://github.com/chakra-ui/zag-plus which doesn't exist. How to proceed?

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