overleaf/services/web/frontend/stories/ui/tooltip.stories.tsx
M Fahru 9f38436f10 Merge pull request #17736 from overleaf/ii-bs5-tooltip
[web] Create Btoostrap 5 tooltips

GitOrigin-RevId: 28c7c389bda74765482049750fc0ae8a5995968e
2024-04-16 08:04:42 +00:00

41 lines
970 B
TypeScript

import { Button } from 'react-bootstrap-5'
import Tooltip from '@/features/ui/components/bootstrap-5/tooltip'
import { Meta } from '@storybook/react'
export const Tooltips = () => {
const placements = ['top', 'right', 'bottom', 'left'] as const
return (
<div
style={{
width: '200px',
display: 'flex',
flexDirection: 'column',
margin: '0 auto',
padding: '35px 0',
gap: '35px',
}}
>
{placements.map(placement => (
<Tooltip
key={placement}
id={`tooltip-${placement}`}
description={`Tooltip on ${placement}`}
overlayProps={{ placement }}
>
<Button variant="secondary">Tooltip on {placement}</Button>
</Tooltip>
))}
</div>
)
}
const meta: Meta<typeof Tooltip> = {
title: 'Shared / Components / Bootstrap 5 / Tooltip',
component: Tooltip,
parameters: {
bootstrap5: true,
},
}
export default meta