Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
65 lines
1.7 KiB
JavaScript
65 lines
1.7 KiB
JavaScript
import * as React from 'react';
|
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
import IconButton from '@mui/joy/IconButton';
|
|
import Tooltip from '@mui/joy/Tooltip';
|
|
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';
|
|
|
|
export default function TooltipUsage() {
|
|
return (
|
|
<JoyUsageDemo
|
|
componentName="Tooltip"
|
|
data={[
|
|
{
|
|
propName: 'variant',
|
|
knob: 'radio',
|
|
defaultValue: 'solid',
|
|
options: ['plain', 'outlined', 'soft', 'solid'],
|
|
},
|
|
{
|
|
propName: 'color',
|
|
knob: 'color',
|
|
defaultValue: 'neutral',
|
|
},
|
|
{
|
|
propName: 'size',
|
|
knob: 'radio',
|
|
options: ['sm', 'md', 'lg'],
|
|
defaultValue: 'md',
|
|
},
|
|
{
|
|
propName: 'open',
|
|
knob: 'controlled',
|
|
},
|
|
{
|
|
propName: 'placement',
|
|
knob: 'placement',
|
|
defaultValue: 'bottom',
|
|
},
|
|
{
|
|
propName: 'arrow',
|
|
knob: 'switch',
|
|
defaultValue: false,
|
|
},
|
|
]}
|
|
renderDemo={({ open, ...props }) => (
|
|
<React.Fragment>
|
|
{open === undefined && (
|
|
<Tooltip title="This is a tooltip" {...props}>
|
|
<IconButton size="lg" variant="soft" color="neutral">
|
|
<DeleteIcon />
|
|
</IconButton>
|
|
</Tooltip>
|
|
)}
|
|
{typeof open === 'boolean' && (
|
|
<Tooltip title="This is a tooltip" open={open} {...props}>
|
|
<IconButton size="lg" variant="soft" color="neutral">
|
|
<DeleteIcon />
|
|
</IconButton>
|
|
</Tooltip>
|
|
)}
|
|
</React.Fragment>
|
|
)}
|
|
/>
|
|
);
|
|
}
|