coreui / coreui-react

CoreUI React.js UI Components. CoreUI for React.js replaces and extends the Bootstrap javascript. Components have been built from scratch as true React.js hook components, without jQuery and unneeded dependencies.
https://coreui.io/react/docs/getting-started/introduction/
MIT License
679 stars 262 forks source link

add tooltip to sidebar nav link #36

Closed agdolla closed 4 years ago

agdolla commented 6 years ago

Is it possible to add tooltip to a sidebar nav link ?

xidedix commented 4 years ago

As a workaround you can add the html title attribute to src/app/_nav.ts like this:

  {
    name: 'Dashboard',
    url: '/dashboard',
    icon: 'icon-speedometer',
    attributes: { title: 'Dashboard tooltip'}
  },
kevinashworth commented 4 years ago

? Per https://github.com/coreui/coreui-free-react-admin-template/blob/master/src/_nav.js, the necessary syntax is actually this:

{
      title: true,
      name: 'Theme',
      wrapper: {
        element: 'a',
        attributes: { title: 'Dashboard tooltip' }
      }
},
xidedix commented 4 years ago

@kevinashworth you are right for sidebar-nav title element (when title: true) in this case, title is wrapped with <a> element