sanity-plugin-input-slider
v1.0.4
Published
Slider input for Sanity-io
Downloads
4
Maintainers
Readme
input-slider
Slider input for Sanity IO.
Usage
In your sanity project's root folder, run the following command:
sanity install input-slider
Use the following example schema as a reference:
export default {
name: 'example',
type: 'object',
title: 'Example number slider',
fields: [
{
name: 'fieldName',
type: 'number',
options: {
range: {
min: 0, // Minimum value
max: 100, // Maximum value
step: 1 // Slider interval
}
}
}
]
}
Labels
If you wish to use labels for your slider,
add the labels
property to the options:
export default {
name: 'example',
type: 'object',
title: 'Example number slider',
fields: [
{
name: 'rating',
type: 'number',
options: {
range: {
min: 0, // Minimum value
max: 10, // Maximum value
step: 1 // Slider interval
},
labels: [
{ value: 0, title: 'Very bad' },
{ value: 3, title: 'Bad' },
{ value: 5, title: 'Ok' },
{ value: 7, title: 'Good' },
{ value: 0, title: 'Very good' }
]
}
}
]
}