0

I am new to react-native and i am trying to add multi selection component to my app my code is as follows:

   <SectionedMultiSelect
              items={this.state.days}
              uniqueKey="id"
              hideSearch={true}
              subKey="day"
              selectText="Select Days"
              selectToggle={{ color: '#f79334' }}
              showDropDowns={true}
              readOnlyHeadings={true}
              onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
              selectedItems={this.state.selectedDaysHomeRepair}
              showChips={false}
              theme = {
                {
                  Colors:{ 
                    selectToggleTextColor:'#053075',
                    text:'#053075'
                   }
                }
              }
            />

does anyone know how to apply color to "Select Days" text. thanks

1 Answer 1

2

You could use the renderSelectText prop and pass your own text component with your custom styles.

<SectionedMultiSelect
  items={this.state.days}
  uniqueKey="id"
  hideSearch={true}
  subKey="day"
  renderSelectText={() => <Text style={{ color: 'red', fontSize: 24 }}>Select Days</Text>}
  selectToggle={{ color: '#f79334' }}
  showDropDowns={true}
  readOnlyHeadings={true}
  onSelectedItemsChange={this.onSelectedItemsChangeHomeRepair}
  selectedItems={this.state.selectedDaysHomeRepair}
  showChips={false}
  theme = {
    {
      Colors: { 
        selectToggleTextColor:'#053075',
        text:'#053075'
      }
    }
  }
/>

Have a look at how this can be used in the example here.

Sign up to request clarification or add additional context in comments.

3 Comments

its working, I want to change toggle icon color also, is there any way to do this?, please help
Which toggle are you referring to? Could you please provide a full working example?
This.component has its built in toggle icon, Thank you by the way, i did it using colors object pass as props to the component as per their docuementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.