import * as React from 'react'; import { Icon, Stack, TooltipHost } from '@fluentui/react'; import { CollapsibleSection, CollapsibleSectionTitle, ICollapsibleSectionTitleProps, } from '@fluentui/react-experiments/lib/CollapsibleSection'; // TODO: convert this example to use extendComponent // This is our customized component making use of default CollapsibleSectionTitle while using slots // to add the tooltip and icon. This would also have to be modified to add a prop for tooltip content (not done here) const CustomizedCollapsibleSectionTitle: React.FunctionComponent = props => { const titleText: ICollapsibleSectionTitleProps['slots'] = { text: { render: (renderProps, DefaultComponent) => ( // Supplement the default title text with an icon. Wrap in a Stack for proper placement. {props.text} ), }, }; // Wrap the entire title in a Tooltip return ( ); }; export class CollapsibleSectionSlotsExample extends React.Component<{}, {}> { public render(): JSX.Element { return (

This CollapsibleSection has been customized with a TooltipHost around its entire title and an icon in its title.

Content 1
); } }