mirror of
https://github.com/wassname/slider.git
synced 2026-10-05 13:10:52 +08:00
18 lines
413 B
React
18 lines
413 B
React
import React from 'react';
|
|
|
|
const Track = ({ className, included, vertical, offset, length }) => {
|
|
const style = {
|
|
visibility: included ? 'visible' : 'hidden',
|
|
};
|
|
if (vertical) {
|
|
style.bottom = `${offset}%`;
|
|
style.height = `${length}%`;
|
|
} else {
|
|
style.left = `${offset}%`;
|
|
style.width = `${length}%`;
|
|
}
|
|
return <div className={className} style={style} />;
|
|
};
|
|
|
|
export default Track;
|