Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reduce size of radio/checkbox #10781

Closed
1 task done
barbalex opened this issue Mar 23, 2018 · 5 comments
Closed
1 task done

How to reduce size of radio/checkbox #10781

barbalex opened this issue Mar 23, 2018 · 5 comments
Assignees
Labels
component: checkbox This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation

Comments

@barbalex
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The standard size of 48x48px for Radios and Checkboxes is way to large for long lists on Desktop.
(How) Can this size be reduced without ending up overriding lots of settings set by material?

@oliviertassinari oliviertassinari added support: question Community support but can be turned into an improvement component: checkbox This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation labels Mar 23, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 23, 2018

@barbalex I would like to add a documentation section about the selection controls overrides. You can do something like:

import React from "react";
import Checkbox from "material-ui/Checkbox";
import CheckBoxOutlineBlankIcon from "material-ui-icons/CheckBoxOutlineBlank";
import CheckBoxIcon from "material-ui-icons/CheckBox";

function Checkboxes(props) {
  return (
    <Checkbox
      style={{ width: 36, height: 36 }}
      icon={<CheckBoxOutlineBlankIcon style={{ fontSize: 20 }} />}
      checkedIcon={<CheckBoxIcon style={{ fontSize: 20 }} />}
    />
  );
}

export default Checkboxes;

https://codesandbox.io/s/l7jr4207j7
capture d ecran 2018-03-23 a 20 26 06

Do you want to work on it?

@oliviertassinari oliviertassinari added good first issue Great for first contributions. Enable to learn the contribution process. and removed support: question Community support but can be turned into an improvement labels Mar 23, 2018
@oliviertassinari oliviertassinari self-assigned this Mar 24, 2018
@oliviertassinari oliviertassinari removed the good first issue Great for first contributions. Enable to learn the contribution process. label Mar 24, 2018
@wasyster
Copy link

@barbalex
I tried this code sample for mui 3.9 with typescript v3.x and its not working. CheckBoxOutlineBlankIcon and CheckBoxIcon not exist.

@oliviertassinari
Copy link
Member

@wasyster You can find this demo live in https://material-ui.com/demos/selection-controls/#checkboxes. We are working on migrating all our demos to TypeScript: #14897.

@wasyster
Copy link

wasyster commented Mar 26, 2019

@oliviertassinari
I copied out the import from the demo example form https://github.com/mui-org/material-ui/blob/494c410716a11d2239d95ad3c000a8d43a78065c/docs/src/pages/demos/selection-controls/CheckboxLabels.js#L100-L111, and still stays:

import CheckBoxOutlineBlankIcon from 'material-ui-icons/CheckBoxOutlineBlank';
import CheckBoxIcon from 'material-ui-icons/CheckBox';

"Cannot find module 'material-ui-icons/CheckBoxOutlineBlank'.ts(2307)"
"Cannot find module 'material-ui-icons/CheckBox'.ts(2307)"

But if I change import for this, it exist and works:
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
import CheckBoxIcon from '@material-ui/icons/CheckBox';

@oliviertassinari
Copy link
Member

@wasyster It's outdated. Use the documentation website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: checkbox This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

3 participants