Semantic-ui-react: [Installation] How to install only a few components?

Created on 2 Aug 2017  路  3Comments  路  Source: Semantic-Org/Semantic-UI-React

Hello, I wish to use only a few components of SUI in my react application. Even if I import only a few components the whole library which is close to 1 MB uncompressed is imported. Is there anyway I can only import an element and its dependencies?

Any help is appreciated! Thank you.

question

All 3 comments

Please post your questions on SO. You can directly import components:

import Button from 'semantic-ui-react/dist/commonjs/elements/Button'

But recommended way is to use babel-plugin-lodash, see #609 and our docs. Also see this reply on SO.

With

import Button from 'semantic-ui-react/elements/Button'

I get

Module not found: Error: Can't resolve 'semantic-ui-react/elements/Button' in '...'

Does this requires a special Webpack configuration?

Thanks.

There was a typo, correct:

import Button from 'semantic-ui-react/dist/commonjs/elements/Button'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

SajagTiwari picture SajagTiwari  路  3Comments

mattmacpherson picture mattmacpherson  路  3Comments

devsli picture devsli  路  3Comments

eGust picture eGust  路  3Comments

ryanpcmcquen picture ryanpcmcquen  路  3Comments