import React from 'react'; import {storiesOf} from '@storybook/react'; import {withInfo} from '@storybook/addon-info'; import {text, boolean, select} from '@storybook/addon-knobs'; import Tooltip from 'app/components/tooltip'; import Button from 'app/components/button'; class CustomThing extends React.Component { render() { return A class component with no ref; } } storiesOf('UI|Tooltip', module) .add( 'Tooltip', withInfo({ text: 'Adds a tooltip to any component,', propTablesExclude: [CustomThing, Button, 'Button'], })(() => { const title = text('tooltip', 'Basic tooltip content'); const disabled = boolean('Disabled', false); const displayMode = select('Container display mode', ['block', 'inline-block', 'inline']); const position = select( 'position', {top: 'top', bottom: 'bottom', left: 'left', right: 'right'}, 'top' ); return (

With styled component trigger

With class component trigger

Custom React Component

With an SVG element trigger

With element title and native html element

so strong } containerDisplayMode={displayMode} position={position} disabled={disabled} >

); }) );