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

Adding icon and text to trigger #80

Closed
EllaVader opened this issue Feb 14, 2018 · 2 comments
Closed

Adding icon and text to trigger #80

EllaVader opened this issue Feb 14, 2018 · 2 comments

Comments

@EllaVader
Copy link

I know that someone asked if you can use an icon in the trigger property for the Collapsible tag.
But can you combine an image icon and text in the trigger props?

this is what I have currently:

so I can either do this (which displays the "text"
const sectionLabel = props.testResult.name + " - " + props.testResult.result; <Collapsible trigger={sectionLabel}

or I can do this (which displays the icon
const failed = props.testResult.result.toLowerCase() === "failed"; const img = failed ? "/images/x.png" : "/images/check.png"; <Collapsible trigger={<img src={img}/>}

but I don't see how to combine them?

@rsarai
Copy link
Collaborator

rsarai commented Mar 25, 2018

Hey @EllaVader you can create a component and pass to the trigger like this:

<Collapsible trigger={<YourNewComponent />}>

Let me know if this works for you!

@karltaylor
Copy link
Collaborator

Closing this due to inactivity. Feel free to open a new issue.

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

3 participants