Semantic-ui-react: Menu dropdown icon position/two icons

Created on 25 Nov 2017  路  7Comments  路  Source: Semantic-Org/Semantic-UI-React

<Dropdown className="icon" item icon='caret down' text='Account'>
    <Dropdown.Menu>
        <Dropdown.Item></Dropdown.Item>
    </Dropdown.Menu>
</Dropdown>

With above code you cant set up a Dropdown, but you can't align icon left nor you can't have two icons like this:
imagen

Why? I'm using React, do I have to use Semantic UI (not react one) to achieve that?

duplicate

Most helpful comment

image

<Dropdown trigger={<span><Icon name='user'/>File</span>} />

All 7 comments

Duplicate, see #1147 for workaround.

Thats not what I asked. I mean two icons on Dropdown text, not options. :/

image

<Dropdown trigger={<span><Icon name='user'/>File</span>} />

do I have to use Semantic UI (not react one) to achieve that?

Note, you'll run into lots of issues trying to run SUI's jQuery plugins on top of React's virtual DOM. They both will be making changes to the DOM and will get out of sync. You should use one or the other.

is there any option other than using the text prop? that one is supposed to be a string, and using @layershifter's solution it works, but triggers a PropTypes validation warning.

/** The text displayed in the dropdown, usually for the active item. */
text: PropTypes.string,

It was wrong advice, use the trigger prop:

<Dropdown trigger={<span><Icon name='user'/>File</span>} />

The result will be same.

Thanks! it works like a charm

Was this page helpful?
0 / 5 - 0 ratings