I just wanna know, if there is a way to change the span’s font size. How can we refer to it?
import React from 'react'
import Select from 'react-select'
const options = [
{ value: 'chocolate', label: I need to change the span below: <br><span>Hi, I am going to be a little be smaller</span> },
]
const MyComponent = () => (
<Select options={options} />
)
2
Answers
try this:
formatOptionLabel
Formats option labels in the menu and control as React components
(...) => ...
References
react-select docs
You can try adding a
style
attribute to the span tag and set the font size you want in there.You can explore more ways to style react-select elements in the docs: https://react-select.com/styles