2

I want to use the Slider component from Material UI in my React app. The Slider is part of 'Lab', a 'package that hosts the incubator components that are not yet ready to move to the core.'

npm install @material-ui/lab
npm install @material-ui/core

Do I still need to install Core Material UI to my project or can I only add the Lab? I do not want to add more bulk to my already big project.

tk421
  • 5,775
  • 6
  • 23
  • 34
katjass
  • 197
  • 2
  • 22

2 Answers2

1

@material-ui/lab have dependency on @material-ui/core, so you must need to added @material-ui/core.it's your choice how you added npm install or cdn

here some useful for you i guess:

@material-ui/core cdn reference: Here

@material-ui/lab cdn reference: Here

or you can try ant.design they have some awesome tools for you.

Thank You :)

menomanabdulla
  • 175
  • 1
  • 5
1

@material-ui/lab has @material-ui/core as a peer dependency. So yes you do need to add it. However if you're concerned about bundle size then rest assured that importing a lab component will not add the complete core to the bundle. It will only add what's necessary.

Sebastian
  • 3,322
  • 22
  • 34