Skip to content

Commit

Permalink
[docs] Fix code on the Working with Tailwind CSS guide (mui#36090)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnajdova authored and pull[bot] committed Oct 21, 2023
1 parent 0015f04 commit 5191053
Showing 1 changed file with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,35 @@ Copy and paste the code below into the file:

```tsx
import * as React from 'react';
import SliderUnstyled, { SliderUnstyledThumbSlotProps, SliderUnstyledProps } from '@mui/base/SliderUnstyled';
import SliderUnstyled, {
SliderUnstyledThumbSlotProps,
SliderUnstyledProps,
} from '@mui/base/SliderUnstyled';

const Slider = React.forwardRef(function Slider(
props: SliderUnstyledProps,
ref: React.ForwardedRef<HTMLSpanElement>,
){
return (<SliderUnstyled
{...props}
ref={ref}
slotProps={{
thumb: { className: 'ring-cyan-500 dark:ring-cyan-400 ring-2 w-4 h-4 -mt-1 -ml-2 flex items-center justify-center bg-white rounded-full shadow absolute' }
root: { className: 'w-full relative inline-block h-2 cursor-pointer' },
rail: { className: 'bg-slate-100 dark:bg-slate-700 h-2 w-full rounded-full block absolute' },
track: { className: 'bg-cyan-500 dark:bg-cyan-400 h-2 absolute rounded-full' }
}}
/>);
) {
return (
<SliderUnstyled
{...props}
ref={ref}
slotProps={{
thumb: {
className:
'ring-cyan-500 dark:ring-cyan-400 ring-2 w-4 h-4 -mt-1 -ml-2 flex items-center justify-center bg-white rounded-full shadow absolute',
},
root: { className: 'w-full relative inline-block h-2 cursor-pointer' },
rail: {
className:
'bg-slate-100 dark:bg-slate-700 h-2 w-full rounded-full block absolute',
},
track: {
className: 'bg-cyan-500 dark:bg-cyan-400 h-2 absolute rounded-full',
},
}}
/>
);
});

export default Slider;
Expand Down

0 comments on commit 5191053

Please sign in to comment.