design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Support dropdown on page header title

Open mbeard opened this issue 9 years ago • 3 comments

The page header title should support an optional element for switching views. For example, in this SLDS example clicking on "My Leads" should display a dropdown with additional views to switch to.

See example in GUS for this behavior as well.

mbeard avatar Dec 06 '16 20:12 mbeard

@plumlee-sf SLDS team told me that this popover/menu/search thing is paired with the page header heading. https://latest-208.lightningdesignsystem.com/components/menus#flavor-dynamic-list-10-plus-items

Although, I'm considering just doing a dropdown or picklist to start off simple.

interactivellama avatar Dec 09 '16 23:12 interactivellama

@mbeard Here is exactly what you want. I will probably write a wrapper for page headers that will have all these props as defaults, but this should work for you if you want a dropdown.

screen shot 2016-12-09 at 10 59 53 pm

The page header icon still needs to be added, of course.

<PageHeader
	contentRight={contentRight}
	iconAssistiveText="User"
	iconCategory="standard"
	iconName="lead"
	info="10 items • sorted by name"
	label="Leads"
	navRight={navRight}
	title={<h1 className="slds-page-header__title slds-p-right--x-small">
		<Dropdown
			options={[
				{ label: 'Menu Item One', value: 'A0' },
				{ label: 'Menu Item Two', value: 'B0' },
				{ label: 'Menu Item Three', value: 'C0' },
				{ type: 'divider' },
				{ label: 'Menu Item Four', value: 'D0' }
			]}
		>
			<DropdownTrigger>
				<Button
					className="slds-button--reset slds-type-focus"
					iconName="down"
					iconPosition="right"
					label="Dropdown"
					responsive
					variant="base"
				/>
			</DropdownTrigger>
		</Dropdown>
	</h1>}
	truncate
	variant="objectHome"
/>

interactivellama avatar Dec 10 '16 05:12 interactivellama

Adding features are the responsibility of the consuming product team. Please follow up if any B2C UXE or SLDS decisions need to be made.

interactivellama avatar Oct 20 '17 18:10 interactivellama