UPD: Custom slider handles

This commit is contained in:
Robert Kossessa
2024-02-02 19:27:35 +01:00
parent 37715b8013
commit 9d97a88f67
2 changed files with 6 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
</template> </template>
<script setup> <script setup>
import { Slider } from '@/components/ui/slider' import { Slider } from '@/components/ui/slider'
import { computed, onBeforeMount } from 'vue' import { computed } from 'vue'
const value = defineModel({ const value = defineModel({
type: Number, type: Number,

View File

@@ -7,6 +7,7 @@ import {
useEmitAsProps, useEmitAsProps,
} from 'radix-vue' } from 'radix-vue'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { MoreHorizontal } from 'lucide-vue-next'
const props = defineProps({ const props = defineProps({
name: { type: String, required: false }, name: { type: String, required: false },
@@ -42,6 +43,9 @@ const emits = defineEmits(['update:modelValue', 'valueCommit'])
<SliderRange class="absolute h-full bg-primary" /> <SliderRange class="absolute h-full bg-primary" />
</SliderTrack> </SliderTrack>
<SliderThumb <SliderThumb
class="block h-5 w-5 rounded-full border hover:bg-zinc-900 border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 cursor-pointer focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" /> class="flex h-6 w-8 rounded-[8px] border hover:bg-zinc-200 border-zinc-100 bg-zinc-300 transition-colors focus-visible:outline-none focus-visible:ring-1 cursor-pointer focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-zinc-600 justify-center items-center"
style="box-shadow: 0 0 15px 0 black">
<MoreHorizontal class="h-full" />
</SliderThumb>
</SliderRoot> </SliderRoot>
</template> </template>