forked from VesperAkshay/qr-code-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSizeSlider.js
30 lines (29 loc) · 932 Bytes
/
SizeSlider.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
import { FaExpandArrowsAlt } from 'react-icons/fa';
export default function SizeSlider({ size, setSize }) {
return (
<div className="mb-6">
<label className=" mb-2 text-gray-700 flex items-center">
<FaExpandArrowsAlt className="mr-2 text-gray-500" />
Size
</label>
<div className="relative">
<input
type="range"
min="100"
max="600"
value={size}
onChange={(e) => setSize(e.target.value)}
className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider-thumb"
/>
<div
className="absolute top-0 left-0 h-full bg-indigo-500 rounded-lg"
style={{ width: `${((size - 100) / 500) * 100}%` }}
/>
</div>
<span className="block text-center text-gray-600 mt-2 text-lg font-semibold">
{size}px
</span>
</div>
);
}