flowbite
flowbite copied to clipboard
About npm `import 'flowbite'` related issues
When importing the js library through npm import 'flowbite'
.
- Is it optional? Like:
import { Modal } form 'flowbite'
. Although, I can
import Accordion from 'flowbite/src/components/accordion'
import Collapse from 'flowbite/src/components/collapse'
import Carousel from 'flowbite/src/components/carousel'
import Dismiss from 'flowbite/src/components/dismiss'
import Dropdown from 'flowbite/src/components/dropdown'
import Modal from 'flowbite/src/components/modal'
import Tabs from 'flowbite/src/components/tabs'
import Tooltip from 'flowbite/src/components/tooltip'
But I feel so innocent! !
- Can you provide a namespace instead of directly
window.Modal = Modal;
to bind the Class to the window object?
Hey @daxiongYang,
I'll take a look at this. Thanks for reporting.
Hello @daxiongYang,
Since v1.5.5
you can now import flowbite
and then use something like flowbite.Modal
instead of the window object.
Here's the source code of the exports: https://github.com/themesberg/flowbite/blob/main/src/flowbite.js
Cheers, Zoltan