From 366bedc6a74984675c567b227d02c59017d0d3bc Mon Sep 17 00:00:00 2001 From: nanda Date: Mon, 5 Oct 2026 09:30:23 -0700 Subject: [PATCH 1/2] fix(slider): fill the track at the range ends and center the grips Base UI positions edge-aligned thumbs as a percentage of the control's full width, but the control's padding made the track narrower than that, and the indicator stopped at the thumb's center. Move the padding to a wrapper, stretch the indicator over the whole thumb, and center each grip in its thumb. Co-Authored-By: Claude Opus 5.5 --- .../kumo/src/components/slider/slider.tsx | 81 ++++++++++--------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/packages/kumo/src/components/slider/slider.tsx b/packages/kumo/src/components/slider/slider.tsx index 90417e958..92f7e4e29 100644 --- a/packages/kumo/src/components/slider/slider.tsx +++ b/packages/kumo/src/components/slider/slider.tsx @@ -125,50 +125,55 @@ export function Slider({ {label} ) : null} - - - - {Array.from({ length: thumbCount }, (_, index) => ( - + + + - + {Array.from({ length: thumbCount }, (_, index) => ( + - - - {(formattedValues) => formattedValues[index]} - - - - ))} - - + + + + {(formattedValues) => formattedValues[index]} + + + + ))} + + +
Date: Mon, 5 Oct 2026 11:22:44 -0700 Subject: [PATCH 2/2] style(docs): format slider demos Co-Authored-By: Claude Opus 5.5 --- .../src/components/demos/HomeGrid.tsx | 2 +- .../src/components/demos/SliderDemo.tsx | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/kumo-docs-astro/src/components/demos/HomeGrid.tsx b/packages/kumo-docs-astro/src/components/demos/HomeGrid.tsx index 4b7c8bf68..2afe62243 100644 --- a/packages/kumo-docs-astro/src/components/demos/HomeGrid.tsx +++ b/packages/kumo-docs-astro/src/components/demos/HomeGrid.tsx @@ -566,7 +566,7 @@ export function HomeGrid() { Component: ( (index === 0 ? "Minimum" : "Maximum")} + getAriaLabel={(index) => (index === 0 ? "Minimum" : "Maximum")} className="w-48" /> ), diff --git a/packages/kumo-docs-astro/src/components/demos/SliderDemo.tsx b/packages/kumo-docs-astro/src/components/demos/SliderDemo.tsx index fa61afa24..fd7683acf 100644 --- a/packages/kumo-docs-astro/src/components/demos/SliderDemo.tsx +++ b/packages/kumo-docs-astro/src/components/demos/SliderDemo.tsx @@ -2,9 +2,7 @@ import { useState } from "react"; import { Slider } from "@cloudflare/kumo"; export function SliderBasicDemo() { - return ( - - ); + return ; } export function SliderRangeDemo() { @@ -12,7 +10,9 @@ export function SliderRangeDemo() { (index === 0 ? "Minimum price" : "Maximum price")} + getAriaLabel={(index) => + index === 0 ? "Minimum price" : "Maximum price" + } className="w-72" /> ); @@ -55,7 +55,7 @@ export function SliderControlledDemo() { setValue(next)} + onValueChange={(next) => setValue(next)} />

Brightness: {value}%

@@ -63,7 +63,5 @@ export function SliderControlledDemo() { } export function SliderDisabledDemo() { - return ( - - ); + return ; }