<!--
  Copyright 2023 Comcast Cable Communications Management, LLC

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  SPDX-License-Identifier: Apache-2.0
-->

import { Canvas, Story } from '@storybook/addon-docs';
import ListItemPicker from '.';

# ListItemPicker

ListItem component with the ability to let a user pick from a list of options.

## Source

https://github.com/rdkcentral/Lightning-UI-Components/blob/develop/packages/%40lightningjs/ui-components/src/components/ListItem/ListItemPicker.js

## Usage

ListItemPicker requires a title and a list of options

```js
import { ListItemPicker } from '@lightningjs/ui-components';

class Basic extends lng.Component {
  static _template() {
    return {
      ListItemPicker: {
        type: ListItemPicker,
        title: 'Title',
        description: 'Description'
      }
    };
  }
}
```

<Canvas>
  <Story id="controls-listitempicker--list-item-picker" />
</Canvas>

## API

### Properties

`ListItemPicker` has the same properties as the ones listed in [ListItem](?path=/docs/controls-listitem--list-item) in addition to a couple listed below:

| name          | type     | default   | description                      |
| ------------- | -------- | --------- | -------------------------------- |
| options       | string[] | undefined | list of selectable options       |
| selectedIndex | number   | undefined | index of current selected option |

### Style Properties

| name                 | type   | description                                                          |
| -------------------- | ------ | -------------------------------------------------------------------- |
| arrowAlphaValue      | number | alpha value of the arrows if value is not equal to the min/max value |
| arrowAlphaValueLimit | number | alpha value of the arrows when value is equal to the min/max value   |
| arrowWidth           | number | width of the arrows                                                  |
| arrowHeight          | object | height of the arrows                                                 |
| arrowColor           | string | color of the arrows                                                  |
| iconLeftSrc          | string | path of the icon to use for the left arrow                           |
| iconRightSrc         | string | path of the icon to use for the right arrow                          |
