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

Added support for icons in semantic theme #67

Merged
merged 5 commits into from
Jul 14, 2016

Conversation

MacRusher
Copy link
Member

Adds ability to use icons in TextField component.

Example usage:

<TextField name="username" icon="user" />
<TextField name="query" iconLeft="search" />

There could be only one icon, and icon take precedence before iconLeft.

I could also add support for pointer events if you think it would useful:

<TextField name="username" icon="add user" onIconClick={() => {}} />

One problem I'm aware of is that adding ui icon input classes change the input width.
This could be solved by adding fluid class either by TextField itself (IMHO bad idea) or end user:

<TextField name="username" className="fluid" icon="user" />

@radekmie radekmie added the Type: Feature New features and feature requests label Jul 12, 2016
@MacRusher
Copy link
Member Author

MacRusher commented Jul 12, 2016

Few changes.

Per @radekmie recommendation I've introduced new section for the input which may or may not contain icon classes. So the problem with different input sizes is gone now.

Instead of onIconClick etc. I've also introduced iconProps that are passed directly to <i/> element.
Example usage:

<TextField name="username" icon="add user link" iconProps={{ onClick: () => {} }} />

@radekmie
Copy link
Contributor

Great! Would you like to do the same for DateField and NumField also?

@MacRusher
Copy link
Member Author

Sure, why not. I'll take care of this tomorrow.

@MacRusher MacRusher changed the title SemanticUI: Added support for input icons SemanticUI: Add support for input icons Jul 14, 2016
@MacRusher
Copy link
Member Author

I've added icon support for DateField and NumField

@radekmie
Copy link
Contributor

Great!

@radekmie radekmie merged commit ba7e04e into master Jul 14, 2016
@radekmie radekmie deleted the feature/semantic-input-icons branch July 14, 2016 21:01
@radekmie radekmie changed the title SemanticUI: Add support for input icons Added support for icons in semantic theme Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants