I want to hide the carousel's indicator only. (like display: "none"
, not visibility: "hidden"
)
but when I set indicators={false}
property to Carousel tag, the whole component disappear.
The picture below is what it looks like when indicators={true}
I followed the documentation below, but I don't know why I get different results. https://www.npmjs.com/package/react-material-ui-carousel
[version]
react-material-ui-carousel: 3.4.2
react: 18.2.0
@emotion/react: 11.11.1
@emotion/styled: 11.11.0
@mui/icons-material: 5.11.16
@mui/material: 5.13.6
here is my code.
import Carousel from 'react-material-ui-carousel';
import { Paper, Button } from '@mui/material'
function Carousel() {
function Item(props)
{
return (
<Paper>
<h2>{props.item.name}</h2>
<p>{props.item.description}</p>
<Button className="CheckButton">
Check it out!
</Button>
</Paper>
)
}
var items = [
{
name: "Random Name #1",
description: "Probably the most random thing you have ever seen!"
},
{
name: "Random Name #2",
description: "Hello World!"
}
]
return (
<div>
<Carousel
// problem here
indicators={false}
>
{
items.map( (item, i) => <Item key={i} item={item} /> )
}
</Carousel>
</div>
);
}
export default Carousel;