How can we reduce the size of components

UI Components for React
Post Reply
pnraltnsk
Posts: 4
Joined: 01 Jul 2021, 08:19

01 Jul 2021, 08:25

Hi, I am using bootstrap4-dark-purple theme and I want to make the components smaller. I tried to change the font-sizes in primereact.css and theme.css of bootstrap but it didn't make any changes. How can I do this?

DorukKantarcioglu
Posts: 1
Joined: 30 Jun 2021, 13:00

02 Jul 2021, 08:34

Hello,

I also used one of the bootstrap themes in a personal project. AFAIK, for most of the components there are size specifying classes. If no size is specified, the components' default size is medium. For example, in the InputText component, adding className "p-inputtext-sm" makes the component smaller. It is present in the showcase for many components.

Kind regards

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

05 Jul 2021, 08:19

Hi,

Thanks @DorukKantarcioglu ;) Also, you can use the following css;

Code: Select all

html, body {
	font-size: 10px;
}
Best Regards,

pnraltnsk
Posts: 4
Joined: 01 Jul 2021, 08:19

06 Jul 2021, 07:49

Hi, thank you for your responses. But I realized that my page was zoomed in %200 so that's why the components looked too large.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

16 Jul 2021, 10:17

Thanks a lot for your update!

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests