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

ContentSwitcher with Icons #183

Closed
arcfide opened this issue May 10, 2020 · 4 comments
Closed

ContentSwitcher with Icons #183

arcfide opened this issue May 10, 2020 · 4 comments

Comments

@arcfide
Copy link

arcfide commented May 10, 2020

It would be nice to be able to use icons as the contents for content switchers.

@metonym
Copy link
Collaborator

metonym commented May 10, 2020

Agreed. Would you be interested in submitting a PR?

@arcfide
Copy link
Author

arcfide commented May 10, 2020

It will depend on whether we decide to go this route in our own project. If so, then I will submit a PR on the feature, if you don't get to it first.

metonym added a commit that referenced this issue Jul 19, 2020
- add ref prop for applicable components (#196)
- add slot to Content Switcher `Switch` component (#183)
- remove fillArray, css utilities
@metonym
Copy link
Collaborator

metonym commented Jul 19, 2020

This feature has been added in v0.8.0.

A slot wraps the text prop in the Content Switcher Switch component.

In this reduced example, the first two switches use the text prop while the third switch overrides it with an icon.

<ContentSwitcher>
  <Switch text="First section" />
  <Switch text="Second section" />
  <Switch>
    <span style="display: flex; align-items: center;">
      <Add16 style="margin-right: .25rem;" />
      Third section
    </span>
  </Switch>
</ContentSwitcher>

Screen Shot 2020-07-19 at 12 37 16 PM

@arcfide
Copy link
Author

arcfide commented Jul 19, 2020

Very cool!

@metonym metonym closed this as completed Sep 19, 2020
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

2 participants