3

Is there a minified material-ui version for react available somewhere?

I'm planning to include the jsx files externally in html, so was wondering is there any static/cdn resource available, apart from installing it via node/npm?

2 Answers 2

4

Using Material-UI without NPM

<body>
  <div id="root"></div>

  <!-- React -->
  <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>

  <!-- Babel -->
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

  <!-- MUI -->
  <script src="https://unpkg.com/@material-ui/core@latest/umd/material-ui.development.js"></script>

  <script type="text/babel">
    const { Button } = MaterialUI; // Components are available in MaterialUI object
    
    ReactDOM.render(
      <Button variant="contained" color="primary">
         Hello World!
      </Button>, 
      document.getElementById("root") 
    );
  </script>
</body>

Reference: https://github.com/mui-org/material-ui/tree/master/examples/cdn

Sign up to request clarification or add additional context in comments.

Comments

3

Yes, there is <link href="//cdn.muicss.com/mui-0.9.9/css/mui.min.css" rel="stylesheet" type="text/css" media="screen" />. More info here: https://www.muicss.com/docs/v1/react/introduction

1 Comment

Isn't this a completely different library?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.