I am thinking of using Bootstarp in my Ionic 2 app to achieve “responsive” functionality of the app. The reason is because I want the users to be able to use the app as a regular website. I want to make sure it renders and functions like a website.
That way, I don’t need to create and maintain two different code bases for mobile and desktop/laptop platforms respectively.
But before I do that, I wanted to run it by the experts here and get some advise.
Some questions I have are:
Is it a good approach?
Are there any disadvantages? If yes, what and how will they affect?
Since I will use Bootstrap, will I be able to mix Bootstrap components with Ionic 2’s components? Or maybe, use only Bootstrap ones?
I would highly appreciate if you guys can give your honest opinions on this.
Ionic is sometimes described as like “Bootstrap for mobile”, so I don’t think it makes sense to use both at the same time. I haven’t tried but you may end up with conflicting style definitions.
I think, I got your point about Ionic being like Bootstrap for mobile. And my question lies in that.
“Bootstrap for mobile” - does that mean that it can’t be used to create the app for regular desktop/laptop browser? And therefore I will need to use Bootstrap to make it responsive?
Would appreciate to hear from somebody who has tried using Bootstrap for achieving “responsive”-ness for the website usage with Ionic 2.
I haven’t used Bootstrap, but I have included FontAwesome in my mobile project. I think there’s an issue with the current CLI though, so I haven’t verified if this works in RC4/5. When I did this I worked in RC3
It require two things
npm install FontAwesome/Bootstrap
Custom copy script in the config section of the package.json file
“config”: {
“ionic_copy”: “./config/copy.config.js” //within your project directory
},
Thanks for the reply @mtycholaz. So you have tried to use a different library in addition to Ionic 2. Do let me know if you were able to get past the issue and were actually able to use it.
Anybody else tried Bootstrap in Ionic 2 for getting “responsive”-ness? Or does anybody know if Ionic 2 provides some kind of wire frames (like Bootstrap) to build responsive web apps?
I’m actually having the same question. I’m building a dashboard website and I’d like to have the same look inside my mobile Ionic 2 app. Because I’m using a template for the website which relies on bootstrap, i’m gonna need bootstrap inside Ionic too.
Did you manage to get it to work; or is it simply not possible with ionic 2?
Regarding the responsive requirement, I believe the Ionic framework has always been responsive. You can see this by doing ‘ionic serve’ and changing the window size of the browser.
Regarding the “create and maintain two different code bases” part, this one is more difficult.
I’m not sure if it’s possible or a good idea to serve your Ionic 2 project in production. PWAs might solve this issue in the future, but on this page: https://ionicframework.com/pricing/index3.html it lists PWA as a feature as part of the Indie service, so Ionic may only offer this as a paid service.
One of the features of a PWA (progressive web app) is that it is discoverable like a website and can be linked to like a website. This would indicate that there is a way to serve an Ionic app as a website in production.
However, this ionic forum answer (Web version in ionic 2) from a moderator states that Ionic 2 apps cannot be hosted as stand-alone web apps yet, but that the functionality is “in the works”.
Other problems I have heard about are resource issues, as serving an Ionic app would create a separate instance for every remote user.
Still, this does not mean that you can’t share code between two projects.
I created a shared library to do this at my company.
However, another department decided to use Bootstrap 4 in their Angular 2 project.
So I figured out how to use Bootstrap 4 with an Ionic 2 project:
npm install bootstrap@4.0.0-alpha.6 --save
Then add this to src/theme/variables.scss @import “./node_modules/bootstrap/dist/css/bootstrap”
That worked for me. I haven’t found any conflicts yet, but haven’t really tried anything besides a proof of concept project so far.
In case you are interested, here is an example of a shared lib that will work with Ionic 2:
Here is an example of an Ionic 2 app which uses the shared lib:
hello @gauz09 i am using bootstrap in ionic 2. i did not face with any problem yet. and i don’t know if there is any disadvantage. so if anyone knows that it have any disadvantage, let me know.
Hi @averhaegen!
I’m building a dashboard to. I’m using startbootstrap-sb-admin-2 and I cant get some bootstrap features like the panels in my app. Do you find any solution for that?
Any help would be huge!
Even the ionic website is not built with ionic, it’s using bootstrap directly.
I’m facing similar issue, going to try https://github.com/hyperapp/hyperapp, will share my findind here again soon.