Theme

PlaygroundBeta

npm_versionnpm Paragon package page

ListBox

basic usage

Any Paragon component or export may be added to the code example.

using tag prop

Any Paragon component or export may be added to the code example.

using onSelect prop

Any Paragon component or export may be added to the code example.

using selectedOptionIndex prop

Any Paragon component or export may be added to the code example.

Props API#

ListBox Props API
  • children node Required

    specifies the ListBoxOption component(s) that will be displayed within the ListBox element. You can pass in one or more ListBoxOption components.

  • className string

    specifies Bootstrap class names to apply to the ListBox component. The default is an empty string.

  • selectedOptionIndex nonNegativeInteger

    Although the ListBox component keeps track of which ListBoxOption is selected, selectedOptionIndex provides a mechanism for an override, if necessary. An example would be to clear the selectedOption when moving between views. Note that override is not permanent and that clicking on a ListBoxOption or interacting with the ListBox with the keyboard will change the selected ListBoxOption relative to the original override. The default is undefined.

  • tag string

    used to specify the element type of the rendered ListBox component. The default is div. Example alternatives include ol, ul, span, etc.

    Default'div'
ListBoxOption Props API
  • children node Required
  • className string
  • index number
  • isSelected bool
    Defaultfalse
  • tag string
    Default'div'
  • onSelect func
    Default() => { }