forked from Semantic-Org/Semantic-UI-React
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Dropdown): Custom trigger element (Semantic-Org#477)
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react' | ||
import { Dropdown, Icon } from 'stardust' | ||
|
||
const trigger = ( | ||
<div style={{display: 'inline-block'}}> | ||
<Icon name='user' /> | ||
Hello, Bob | ||
</div> | ||
) | ||
|
||
const DropdownExample = () => ( | ||
<Dropdown trigger={trigger}> | ||
<Dropdown.Menu> | ||
<Dropdown.Item text='New' /> | ||
<Dropdown.Item text='Open...' description='ctrl + o' /> | ||
<Dropdown.Item text='Save as...' description='ctrl + s' /> | ||
<Dropdown.Item text='Rename' description='ctrl + r' /> | ||
<Dropdown.Item text='Make a copy' /> | ||
<Dropdown.Item icon='trash' text='Move to trash' /> | ||
<Dropdown.Divider /> | ||
<Dropdown.Item text='Download As...' /> | ||
<Dropdown.Item text='Publish To Web' /> | ||
{/* item text can also be defined as children */} | ||
<Dropdown.Item>E-mail Collaborators</Dropdown.Item> | ||
</Dropdown.Menu> | ||
</Dropdown> | ||
) | ||
|
||
export default DropdownExample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters