Lorand
Lorand

Reputation: 311

Why don't PrimeNG buttons classes work even if i have primeNG installed properly?

My problem is that I can't design buttons using default classes in primeNG..

Steps that I took: I have installed it in NPM locally. I have added button modules into app-modules. I have included it in angular.json. - have included it in package.json.

This is how my webpage should look like: tutorial

But this is how it actually looks like:

my image

I am not sure why.

Upvotes: 2

Views: 4785

Answers (1)

SiddAjmera
SiddAjmera

Reputation: 39432

Have you added the styles/css that comes as a part of primeng?

If not, try adding these to the styles array in angular.json/.angular-cli.json(Depending on your Angular version)

"styles": [
  "node_modules/primeng/resources/themes/nova-light/theme.css",
  "node_modules/primeng/resources/primeng.min.css",
  "node_modules/primeicons/primeicons.css",
  //...
],

OR Better

Add them to the styles.css file:

@import "~primeng/resources/themes/nova-light/theme.css";
@import "~primeng/resources/primeng.min.css";
@import "~primeicons/primeicons.css";

Upvotes: 4

Related Questions