Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
A drop-down menu pops up for the user to choose.
In some cases, dropdown list needs to be customized according to the length of the content. If so, you can set the dropdownMatchSelectWidth
property to false
(with a maximum width limit):
Each option can set its own pre-icon and suffix-icon, the Icon is imported from the @apitable/icons
library.
When the selected option has an icon, the icon will be displayed by default.
Note that the trigger itself can also specify the pre-Icon and suffix-Icon. When the selected result also has the corresponding Icon passed in, the Icon specified by the trigger will be higher than the Icon weight of the option.
When an option cannot be selected, the disabled state can be set for the option, and a reason for not being selected can be provided. When the mouse hovers over the content area, the reason will be displayed.
When an option is too long and the content is not displayed completely, an ellipsis will appear. At this time, hovering over the option will display the complete content of the current option. If the option is disabled at this moment, the weight of disabledTip will be higher than the content.
Set disabled tips:
The suffix-icon of an option is special. When an option is in the disabled
state, the pre-icon and the text part will turn gray, but the post-icon will keep the original color. And the rear Icon can also have its own hover.
Status prompt, just pass the content in suffixIconTip
.
The search is case insensitive in English.
Get option user name by renderValue
function:
Instead of using the options
props, you can add options through sub-elements, as follows:
Name | Type | Description | Default |
---|---|---|---|
value | string / number | selected value, corresponding to the value in option | - |
onSelected | (option: IOption, index: number) => void | select action callback | - |
options | IOption[] | dropdown list data | - |
placeholder | string | - | - |
prefixIcon | ReactNode | prefix icon | - |
suffixIcon | ReactNode | suffix icon | - |
dropdownMatchSelectWidth | boolean | whether the drop-down box and the trigger keep the same width | - |
triggerStyle | CSSProperties | trigger inline style | - |
triggerCls | string | trigger classname | - |
listCls | string | list classname | - |
listStyle | CSSProperties | list inline style | - |
openSearch | boolean | whether to show search | - |
searchPlaceholder | string | search placeholder | - |
highlightStyle | CSSProperties | custom highlight inline style | - |
noDataTip | string | (() => ReactNode) | empty data text or UI |
hideSelectedOption | boolean | whether hide selected options | - |
dropdownRender | ReactNode | custom dropdown | - |
disabled | boolean | disabled action | - |
renderValue | (option: IOption) => string | format select option value | - |
maxListWidth | number | limit max list width | - |
defaultVisible | boolean | - | - |
hiddenArrow | boolean | hide arrow | - |
triggerLabel | boolean | - | - |