Skip to content

Commit

Permalink
docs: update EuiComboBox tooltip docs example
Browse files Browse the repository at this point in the history
  • Loading branch information
mgadewoll committed May 2, 2024
1 parent 632cc7a commit 05695b4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 99 deletions.
99 changes: 0 additions & 99 deletions src-docs/src/views/combo_box/tool_tips.js

This file was deleted.

43 changes: 43 additions & 0 deletions src-docs/src/views/combo_box/tool_tips.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useState } from 'react';

import {
EuiComboBox,
EuiComboBoxOptionOption,
} from '../../../../src/components';

const options: Array<EuiComboBoxOptionOption<string>> = [
{
label: 'Titan',
toolTipContent:
'Titan is the largest moon of Saturn and the second-largest in the Solar System',
},
{
label: 'Pandora',
toolTipContent:
"Pandora is one of Saturn's moons, named for a Titaness of Greek mythology",
},
{
label: 'Iapetus',
toolTipContent: "Iapetus is the outermost of Saturn's large moons",
toolTipProps: { position: 'bottom' },
},
];
export default () => {
const [selectedOptions, setSelected] = useState([options[2]]);

const onChange = (
selectedOptions: Array<EuiComboBoxOptionOption<string>>
) => {
setSelected(selectedOptions);
};

return (
<EuiComboBox
aria-label="Example of combobox options with tooltips"
options={options}
selectedOptions={selectedOptions}
onChange={onChange}
isClearable={true}
/>
);
};

0 comments on commit 05695b4

Please sign in to comment.