Using: https://react-select.com/home I've been trying variations of the following idea:
const hex = 'f2bc';
const char = unescape('%u' + hex);
<Select
defaultValue={ label: char, value: 'some-value'}
...={...}/>
This is the result of the above attempt:
react-select
is flexible to allow PropTypes.node
to be passed for the label
option.
font-awesome
icons can be used with className applied to an HTMLSpan element e.g.
const labelWithIcon = <span className="fas fa-stroopwafel" />
<Select defaultValue={{ label: labelWithIcon, value: 'some-value' }} />
To dispaly icons instead of text you can do like this :
const options = [
{ value: "text", label: <FontAwesomeIcon icon={faFileAlt} /> },
{ value: "image", label: <FontAwesomeIcon icon={faFileImage} /> },
{ value: "video", label: <FontAwesomeIcon icon={faFileVideo} /> }
];
<Select placeholder="Text" options={options} />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With