Skip to content

Select Option

brandonk1234 edited this page Dec 5, 2016 · 4 revisions

SelectOption

The select option component allows the user to select a value from a series of options.

Props

The props needed for this component are listed and explained below:

  • className - This prop must be a string.

  • type - This prop must be a string.

  • iconPosition - This prop must be a string.

  • isSmall - This prop must be a boolean. Use this to have a smaller version of the component

  • initialText - This prop must be a string.

  • value - This prop must be a string.

  • options - This prop must be a array of objects with the given keys shown in the example.

  • onChange - This prop must be a function.

Example

<SelectOptions 
	className="options"
	type="primary"
	isSmall={true}
	value={this.state.value}
	initialText="Select"
	onChange={this.onSelectOptionChanged}
	options={[
		{
		text: 'Ascending',
		_value: 'ascending'
		},
		{
		text: 'Descending',
		_value: 'descending'
		},
		{
		text: 'Recent',
		_value: 'recent'
		},
		{
		text: 'Oldest',
		_value: 'oldest'
		}
	]}
/>

Related