Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for icon before button text #5

Open
delatorremario opened this issue Nov 17, 2017 · 3 comments
Open

Add option for icon before button text #5

delatorremario opened this issue Nov 17, 2017 · 3 comments

Comments

@delatorremario
Copy link

Hello!, please!

Add option for icon and icon class, for example,

Thanks

PD: if you want, you add me as a collaborator

@rickjordan
Copy link

The buttonText property can contain other components. So if you are using Bootstrap (for example), you can do something like this...

<ReactHTMLTableToExcel
    table="table"
    filename="filename"
    className="btn btn-default"
    buttonText={<Glyphicon glyph="download-alt" />}
/>

@dmaison
Copy link

dmaison commented Jan 29, 2018

@rickdjiii that produces the desired result but throws an error because the expected PropType is a string and that's an object.

Component should be changed to accept child props if the buttonText prop is not provided.

<ReactHTMLTableToExcel
    table="table"
    filename="filename"
    className="btn btn-default">
    <Glyphicon glyph="download-alt" />
    Button Text
</ReactHTMLTableToExcel>

@Linschlager
Copy link

Linschlager commented Mar 22, 2018

Just implemented a fix for the error here #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants