Ability to set style for each item?
See original GitHub issueThis is a feature request.
I’m trying to create a fontFamily dropdown, something like this (https://nardeas.github.io/react-font-picker/).
As you can see, the font family of each item is different, so the user could be able to see each font’s style. But I cannot find a way to achieve this in react-select. Is it possible to set each item’s style? Something like this.
<Select
name="form-field-name"
value={value}
onChange={this.handleChange}
options={[
{ value: 'one', label: 'One', style={fontFamily: 'Arial'} },
{ value: 'two', label: 'Two', style={fontFamily: 'Times New Roman'} },
]}
/>
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Applying CSS styles to all elements inside a DIV
This code will apply styles all elements inside .yourWrapperClass. Share.
Read more >Specificity - CSS: Cascading Style Sheets - MDN Web Docs
Specificity is an algorithm that calculates the weight that is applied to a given CSS declaration. The weight is determined by the number...
Read more >Style Sheets in HTML documents - W3C
To specify an alternate style sheet, set the rel attribute to "alternate stylesheet" and name the style sheet with the title attribute.
Read more >Lesson 1: Understanding ID and Class in CSS
Lesson 1: Understanding ID and Class in CSS. Overview. So far you have added style to various elements in your portfolio page, but...
Read more >Solved with CSS! Logical Styling Based on the Number of ...
You don't have to set all of your logic-based styling rules in JavaScript, ... This post is the third in a series about...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a bit tricky, but the documentation covers it in “styles” section. I did it like this:
@searene are you sure? because object cannot have a property set with ‘=’, you have to use ‘:’ but even setting it like that did not work for me.