Skip to content

Commit

Permalink
Add disabled state for slider
Browse files Browse the repository at this point in the history
  • Loading branch information
asimonok committed Feb 2, 2024
1 parent 95e41c6 commit a354add
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/components/src/components/Slider/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ interface Props extends Omit<SliderProps, 'ariaLabelForHandle'> {
* @type {number}
*/
inputWidth?: number;

/**
* Disabled
*
* @type {boolean}
*/
disabled?: boolean;
}

/**
Expand All @@ -55,6 +62,7 @@ export const Slider: React.FC<Props> = ({
included,
inputWidth = 8,
sliderAriaLabel,
disabled,
...props
}) => {
const isHorizontal = orientation === 'horizontal';
Expand Down Expand Up @@ -123,6 +131,7 @@ export const Slider: React.FC<Props> = ({
marks={marks}
included={included}
ariaLabelForHandle={sliderAriaLabel}
disabled={disabled}
/>

{inputWidth > 0 && (
Expand All @@ -141,6 +150,7 @@ export const Slider: React.FC<Props> = ({
max={max}
step={step}
data-testid={props['data-testid']}
disabled={disabled}
/>
)}
</div>
Expand Down

0 comments on commit a354add

Please sign in to comment.