diff --git a/front/src/components/ui/Slider.vue b/front/src/components/ui/Slider.vue
index b58cec20d..414714358 100644
--- a/front/src/components/ui/Slider.vue
+++ b/front/src/components/ui/Slider.vue
@@ -3,6 +3,7 @@ import { ref, computed, onMounted } from 'vue'
import Layout from "~/components/ui/Layout.vue"
import Spacer from "~/components/ui/Spacer.vue"
+import Markdown from "~/components/ui/Markdown.vue"
const props = defineProps<{
label?: string,
@@ -48,7 +49,7 @@ onMounted(() => {
{{ label }}
-
+
@@ -103,5 +108,37 @@ onMounted(() => {
--inset: calc(var(--step-size) * var(--current-step));
margin-left: var(--inset);
margin-right: calc(0px - var(--inset));
+ p {
+ margin: 0;
+ line-height: 1.5em;
+ }
}
+ // Fake slider
+ .range {
+ width: calc(var(--step-size) * var(--current-step));
+ border-bottom: 2px solid currentcolor;
+ position: absolute;
+ top: 11px;
+ transition: all .1s;
+ pointer-events: none;
+ }
+ input:focus~.range {
+ // focused style
+ }
+ .pin {
+ border-radius: 8px;
+ width: 16px;
+ height: 16px;
+ left: calc(var(--step-size) * var(--current-step));
+ background: currentcolor;
+ position: absolute;
+ top: 4px;
+ transition: all .1s;
+ pointer-events: none;
+ }
+ input:focus~.pin {
+ background-color: var(--focus-ring-color);
+ outline: 2px solid currentcolor;
+ }
+
diff --git a/front/ui-docs/components/ui/slider.md b/front/ui-docs/components/ui/slider.md
index c2ba5cb39..ee68f2b14 100644
--- a/front/ui-docs/components/ui/slider.md
+++ b/front/ui-docs/components/ui/slider.md
@@ -1,6 +1,7 @@
```ts
@@ -18,9 +19,10 @@ import Slider from "~/components/ui/Slider.vue";
# Slider
-Let a user select a value along a gradient.
+Let a user select a value along a line.
-The model (required) is the current value.
+For each option, provide a description. Markdown is supported.
+Select a key from the `options` by setting `v-model`
```ts
const options = {
@@ -33,10 +35,21 @@ const option = ref("me");
```
```vue-html
-
+
```
-
+
+
+
+## Add a label
+
+You can either specify the `label` prop or add custom Html into the `#label` slot.
+
+## Autofocus
+
+Add the prop `autofocus` to focus the slider as soon as it renders. Make sure to only autofocus one element per page.
+
+---
Functionality:
@@ -55,5 +68,6 @@ Design:
- A pin (same as in the toggle component)
- a range (very faint)
- Ticks
+- Constant dimensions, fitting the largest text box
- Not to be confused with a pearls navigation patterns (list of dots; indicates temporal range)