Search
 
SCRIPT & CODE EXAMPLE
 

HTML

show text when mouse over button html

--Usage of Tooltip component

import { Button } from 'reactstrap'

<Tooltip
  tooltipContent={
    'You cannot cancel invoices that were created automatically by memberships!'
  }
  component={
    <span id={'cancelButton'}>
      <Button
        style={{ pointerEvents: 'none' }}
        onClick={...}
        disabled
      >
        Cancel
      </Button>
    </span>
  }
/>
Comment

show text when mouse over button html

--Tooltip.jsx

import React, { useState } from 'react'
import * as Reactstrap from 'reactstrap'

const Tooltip = props => {
  const [tooltipOpen, setTooltipOpen] = useState(false)
  const toggle = () => setTooltipOpen(!tooltipOpen)
  // Warnings for component useage
  if (!props.component) {
    console.warn('Missing component for tooltip')
  }
  if (!props.tooltipContent) {
    console.warn('Missing content for tooltip')
  }
  if (props.component && !props.component.props.id) {
    console.warn('Component for tooltip has no id (must not have spaces)')
  }
  return (
    <React.Fragment>
      {props.component}
      {props.tooltipContent && (
        <Reactstrap.Tooltip
          placement={props.placement ? props.placement : 'top'}
          isOpen={tooltipOpen}
          target={props.component.props.id}
          toggle={toggle}
          delay={props.delay ? props.delay : 750}
        >
          {props.tooltipContent && (
            <div className="row p-2">
              <div className="col-md-12">{props.tooltipContent}</div>
            </div>
          )}
        </Reactstrap.Tooltip>
      )}
    </React.Fragment>
  )
}
Tooltip.displayName = 'Tooltip'
export default Tooltip
Comment

PREVIOUS NEXT
Code Example
Html :: hirudhi map 
Html :: how to alert in http 
Html :: dont ignore space tag html 
Html :: Theological 
Html :: HTML <q for Short Quotations 
Html :: hoe to make a html page attractive 
Html :: how to make a form display in a site 
Html :: boostrap thymeleaf modal 
Html :: cheked html 
Html :: hide input field title show when it is filled 
Html :: vue children not reload route params change 
Html :: make a link of index in previous folder 
Html :: how to make a text website 
Html :: simple html template 
Html :: html how to nest 2 tags 
Html :: how to add send call in html 
Html :: how to insert div inside input 
Html :: javascript timespan 
Html :: How to add link on bar for google bar chart 
Html :: vmware workstation ubuntu 17.10 
Html :: hello world html template download file 
Html :: kanaankanaan123 
Html :: <body tag 
Html :: html overflow with span 
Html :: html5 tutorial 
Html :: java ee static html 
Html :: h1Inne1rHtml is not defined at main 
Html :: functioning search engine code 
Html :: site language localize by ip 
Html :: html text not editable 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =