@bdt-component-library/option
v0.1.5
Published
Option component
Downloads
10
Readme
Option Component
About
This is a component published as its own package from our component library monorepo: https://github.com/BenefitsDataTrust/ui-components. Setup instructions, as well as higher-level goals and concerns can be found from the main project README.
Description
Option is a separate component that serves both the Menu and Select component, by acting as the default display option, reducing complexity within those components, and enabled reuse and composability.
- https://zeroheight.com/990ea04ab/p/16f49b-menu
- https://zeroheight.com/990ea04ab/p/422d4b-selects
API
| prop | type | required | default | explanation | |-----------|--------|----------|---------|--------------| | className | string | no | undefined | Adds an optional classname to the component | | children | React node | yes | n/a | Handles the display inside an Option element | | value | string OR number | yes | n/a | Determines value of the Option, used for selections | | disabled | boolean | no | false | Determines whether or not the option is disabled | | onClick | function(e: event, val: string) | no | () => {} | Event handler for onclick event for the Option | | selected | boolean | no | false | Determines whether or not the element is in a selected state |