Skip to content

How to use a primary button with an icon? #1

@mike-morr

Description

@mike-morr

If I am reading the documentation right, I can only add an icon to hero or command buttons. So this is likely by design. Is there a way I can have the ButtonType.primary button look and have an icon?

I tried this:

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Button, ButtonType } from 'office-ui-fabric-react/lib/Button';

const MyPage = () => (<div><Button icon="personAdd" buttonType={ ButtonType.primary }>I am a button.</Button></div>);

ReactDOM.render(<MyPage />, document.getElementById("content") as Element);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions