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

breaking: Slider type prop for number or number[] value #1032

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

huntabyte
Copy link
Owner

@huntabyte huntabyte commented Dec 31, 2024

Closes #1031

Now we no longer need to use an array with a single value as the slider's value if we only need one value, while still giving the flexibility to render multiple thumbs should you need them.

<script lang="ts">
	import { Slider } from "bits-ui"

	let singleValue = $state(50)
	let multiValue = $state([25, 75])
</script>

<Slider.Root type="single" bind:value={singleValue} />
<Slider.Root type="multiple" bind:value={multiValue} />

This API change aligns with the other components that provide multiple value types, such as the Accordion, Combobox, Select, Calendar, etc.

Copy link

changeset-bot bot commented Dec 31, 2024

🦋 Changeset detected

Latest commit: ef3e9b0

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

This PR includes changesets to release 1 package
Name Type
bits-ui Patch

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
Contributor

github-actions bot commented Dec 31, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview ef3e9b0

@huntabyte huntabyte changed the title breaking: Slider required type prop breaking: Slider required type prop for number or number[] value Dec 31, 2024
@huntabyte huntabyte changed the title breaking: Slider required type prop for number or number[] value breaking: Slider type prop for number or number[] value Dec 31, 2024
@huntabyte huntabyte merged commit 91913f4 into next Dec 31, 2024
5 checks passed
@huntabyte huntabyte deleted the next-slider-type branch December 31, 2024 02:28
This was referenced Feb 13, 2025
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.

1 participant