6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

react-tooltipを使って、ReactでBootstrapっぽいツールチップを表示する

Posted at

概要

ReactでBootstrapのTooltipが使えないので、react-tooltipを使ってbootstrapっぽいツールチップを表示してみました。

比較

bootstrap

bootstrap.PNG

react-tooltip

react_tooltip.PNG

バージョン

"react": "^16.4.0",
"react-tooltip": "^3.9.0",

実行方法

yarn add react-tooltip

button.jsx
import React from 'react';
import ReactTooltip from 'react-tooltip';

const Button = props => (
  <button type="button" data-tip="一覧から選択">
    アイコン
    <ReactTooltip effect="solid" place="bottom" />
  </button>
);

export default Button;

デフォルトだと表示がeffect="float" place="top"になっているので、effect="solid" place="bottom"に変更しています。

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?