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

Popover Tip Addition #10772

Closed
1 task done
kaufmann42 opened this issue Mar 23, 2018 · 6 comments
Closed
1 task done

Popover Tip Addition #10772

kaufmann42 opened this issue Mar 23, 2018 · 6 comments
Assignees
Labels
component: Popover The React component. component: tooltip This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation

Comments

@kaufmann42
Copy link

kaufmann42 commented Mar 23, 2018

Anyone have any idea of the best way to go about changing the look of the popover to include a small triangle up top (making it look more like a tooltip). Any help advice would be appreciated.

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

Context

For the project I'm working on the generally accepted components by users usually contain a "tooltipish" tip on the top of the box. We think it's a little abrupt (and menu like) for our needs to leave out this indicator.

Your Environment

Tech Version
Material-UI ^1.0.0-beta.38
React ^16.2.0
@oliviertassinari
Copy link
Member

@kaufmann42 It's a good question. I would love to have a demo in the documentation demonstrating it.

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: Popover The React component. component: tooltip This is the name of the generic UI component, not the React module! labels Mar 23, 2018
@kaufmann42
Copy link
Author

kaufmann42 commented Mar 24, 2018

I'll definitely be working on it and I'll post it here once I get it working. Maybe hopefully get some feedback on how I went about it :)

p.s. Sorry there was something you didn't enjoy about this issue creation @manAbl - feel free to let me know what it was so I can avoid it for next time/fix it.

@tjefferson08
Copy link

I got this working by providing a theme with an override set on the tooltip component.

Something like:

const theme = createMuiTheme({
  overrides: {
    MuiTooltip: {
      tooltip: {
        '&:before': {
          /* tricky doubly-quoted empty string so mui parses it as truly empty */
          content: '""',
          display: 'block',
          width: '0',
          height: '0',
          position: 'absolute',
          borderLeft: '10px solid transparent',
          borderRight: '10px solid transparent',
          /* border color should probably match whatever your tooltip color is */
          borderTop: '10px solid #000',
          left: 'calc(50% - 10px)',
          top: '100%'
        }
      }
    }
})

image

It's a downward triangle but you get the idear.

@oliviertassinari oliviertassinari self-assigned this Jul 11, 2018
@oliviertassinari
Copy link
Member

@tjefferson08
Copy link

Annnnd I totally missed that. Reinventing the wheel darn it! Thanks for the links

@oliviertassinari
Copy link
Member

@tjefferson08 It's not released yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Popover The React component. component: tooltip 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