import * as React from 'react'; import { DefaultButton } from '@fluentui/react/lib/Button'; import { Panel, PanelType } from '@fluentui/react/lib/Panel'; import { Dropdown, IDropdownOption } from '@fluentui/react/lib/Dropdown'; import { Link } from '@fluentui/react/lib/Link'; import { useBoolean } from '@fluentui/react-hooks'; // The panel type and description are passed in by the PanelSizesExample component (later in this file) const PanelExample: React.FunctionComponent<{ panelType: PanelType; description: string }> = props => { const { description, panelType } = props; const [isOpen, { setTrue: openPanel, setFalse: dismissPanel }] = useBoolean(false); const a = 'aeiou'.indexOf(description[0]) === -1 ? 'a' : 'an'; // grammar... return (
This is {a} {description} panel {panelType === PanelType.smallFixedFar ? ' (the default size)' : ''}.
Select this size using {`type={PanelType.${PanelType[panelType]}}`}.
See the{' '} PanelType documentation {' '} for details on how each option affects panel sizing at different screen widths.
All panels are anchored to the far side of the screen (right in LTR, left in RTL) unless otherwise specified.