Skip to main content
Version: v1 (Current)

Slider

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

Slider​

import { Slider } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
defaultValuenumber[] | undefined—The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
modelValuenumber[] | null | undefined—The controlled value of the slider. Can be bind as v-model.
disabledboolean | undefined—When true, prevents the user from interacting with the slider.
orientationDataOrientation | undefined—The orientation of the slider.
dirDirection | undefined—The reading direction of the combobox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
invertedboolean | undefined—Whether the slider is visually inverted.
minnumber | undefined—The minimum value for the range.
maxnumber | undefined—The maximum value for the range.
stepnumber | undefined—The stepping interval.
minStepsBetweenThumbsnumber | undefined—The minimum permitted steps between multiple thumbs.
thumbAlignmentThumbAlignment | undefined—The alignment of the slider thumb. - contain: thumbs will be contained within the bounds of the track. - overflow: thumbs will not be bound by the track. No extra offset will be added.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
namestring | undefined—The name of the field. Submitted with its owning form as part of a name/value pair.
requiredboolean | undefined—When true, indicates that the user must set the value before the owning form can be submitted.

Events​

NameTypeRequired / defaultDescription
update:modelValue[payload: number[] | undefined]——
valueCommit[payload: number[]]——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Slider } from '.'
import { ref } from 'vue'
{
render: () => ({
components: { Slider },
setup() {
const value = ref([50])
return { value }
},
template: `
<div class="w-full max-w-sm">
<Slider v-model="value" :max="100" :step="1" />
<p class="mt-2 text-sm text-muted-foreground">Value: {{ value[0] }}</p>
</div>
`,
}),
}

WithDefaultValue​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Slider } from '.'
import { ref } from 'vue'
{
name: 'With Default Value',
render: () => ({
components: { Slider },
setup() {
const value = ref([33])
return { value }
},
template: `
<div class="w-full max-w-sm">
<Slider v-model="value" :default-value="[33]" :max="100" :step="1" />
<p class="mt-2 text-sm text-muted-foreground">Value: {{ value[0] }}</p>
</div>
`,
}),
}

Range​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Slider } from '.'
import { ref } from 'vue'
{
name: 'Range',
render: () => ({
components: { Slider },
setup() {
const value = ref([25, 75])
return { value }
},
template: `
<div class="w-full max-w-sm">
<Slider v-model="value" :max="100" :step="1" />
<p class="mt-2 text-sm text-muted-foreground">Range: {{ value[0] }} - {{ value[1] }}</p>
</div>
`,
}),
}