Target slider
Pick a price target from +10% to +900%. A fixed ruler with one marker; the bars swell under your finger and every bar ticks.
Specs
Every value is a token from Foundations. The names match Figma and the Flutter file.
Bar area
100 tall, full width · 25 bars, 5 wide, about 16 apart at 392 · 2 faded bars past each end stop
Marker
8 × 78 (94 while dragging),
text/primary, 3pt ring in bg/surfaceStops
+10, +25, +50, +100, +400, +900 · 40 tall bars at 62%
In-between
3 round values per segment (13 16 20 · 30 38 45 · 60 75 90 · 150 200 300 · 500 600 750) · 24 tall at 30%
Labels
Moonshot/Label/Tick 17/24, no plus sign (10% … 900%) so they clear each other at 354 wide · 64 × 48 tap targetsBubble
bg/inverse pill, 12 / 4 padding (inset/pill-x)Haptics
selection tick per bar, medium on stops
Press
bars within about 3 of the marker swell up to 1.8× and brighten; a bubble rises with the value, and its number rolls
Drag
marker follows 1:1; the bubble leans against its travel, up to 14°, by speed
Ends
rubber band: a 120pt overdrag moves the marker about 34pt, then it springs home
Flick
letting go faster than 350pt/s carries on to where the flick would land (deceleration .985)
Hover
pointer devices only: bars under the cursor rise 28% before a press
Limits
Defined in the component and enforced by the linter: more than this and pnpm lint:ds fails.
1 per surface
Keep it the only slider on its sheet.
Usage
Do
- Show the result above it in money ("You get about $2.17"), the percent in the bubble.
- Let a tap on a label jump the marker there.
- Keep it the only slider on the sheet.
Don't
- Don't turn it into a range; a target is one value.
- Don't colour the bars by gain; magenta is for actions, never for data.
- Don't hide the labels to save space: they are the stops.
Accessibility
- role=slider with aria-valuetext "+45%".
- Arrow keys move one bar, Page Up and Page Down jump a stop, Home and End go to +10% and +900%.
- Labels are real buttons with 64 × 48 targets.
- Focus: a 2px
focus/ring2px outside the shape, for keyboard and switch control only. Targets are 44pt or more.