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

[Tabs] Leading Icon variant #23337

Closed
1 task done
numToStr opened this issue Oct 31, 2020 · 3 comments
Closed
1 task done

[Tabs] Leading Icon variant #23337

numToStr opened this issue Oct 31, 2020 · 3 comments
Labels
component: tabs This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@numToStr
Copy link
Contributor

numToStr commented Oct 31, 2020

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

Summary 💡

Currently <Tab /> does not support the leading icon. This variant is useful for desktop screens as there is plenty of horizontal space is available.

Examples 🌈

material io_components_tabs

https://material.io/components/tabs

Current Solution

I was able to achieve similar result. But I don't like that.

<Tab
    key={t.value}
    disableRipple
    label={t.label}
    value={t.value}
    component={({ children, ...p }) => (
        <Box {...p}>
            <Box sx={{ mr: 1, lineHeight: 0 }}>
                <EditIcon fontSize="small" />
            </Box>
            {children}
        </Box>
    )}
/>
@numToStr numToStr added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 31, 2020
@oliviertassinari oliviertassinari added component: tabs This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 31, 2020
@oliviertassinari
Copy link
Member

Related to #15324

@jiazhengxing
Copy link

jiazhengxing commented Nov 29, 2020

I have a question about the introduction of custom svg in tabs, and switch tabs, but the icon color does not change. How to solve this problem?

eg:
import SvgIcon from "@material-ui/core/SvgIcon";
import { ReactComponent as Cash } from "./cash.svg";
import PhoneIcon from "@material-ui/icons/Phone";
import FavoriteIcon from "@material-ui/icons/Favorite";
const CashIconCom= () => (



);

<Tab icon={} aria-label="phone" />
<Tab icon={} aria-label="favorite" />
<Tab icon={} aria-label="person" />
<Tab icon={} aria-label="personIcon" />

cash.svg file:


@oliviertassinari oliviertassinari changed the title [Tab] Leading Icon variant [Tabs] Leading Icon variant Nov 29, 2020
@oliviertassinari oliviertassinari added the new feature New feature or request label Nov 29, 2020
@oliviertassinari
Copy link
Member

Duplicate of #11653

@oliviertassinari oliviertassinari marked this as a duplicate of #11653 Apr 17, 2021
@github-actions github-actions bot added the duplicate This issue or pull request already exists label Apr 17, 2021
@oliviertassinari oliviertassinari removed the new feature New feature or request label Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants