()
| 39 | } |
| 40 | |
| 41 | export function DefaultValueExample() { |
| 42 | return ( |
| 43 | <Select |
| 44 | defaultValue="Blueberry" |
| 45 | options={STRING_OPTIONS} |
| 46 | placeholder="Select a fruit…" |
| 47 | itemComponent={(props) => ( |
| 48 | <Select.Item item={props.item} class={style.select__item}> |
| 49 | <Select.ItemLabel>{props.item.rawValue}</Select.ItemLabel> |
| 50 | <Select.ItemIndicator class={style["select__item-indicator"]}> |
| 51 | <CheckIcon /> |
| 52 | </Select.ItemIndicator> |
| 53 | </Select.Item> |
| 54 | )} |
| 55 | > |
| 56 | <Select.Trigger class={style.select__trigger} aria-label="Fruit"> |
| 57 | <Select.Value<string> class={style.select__value}> |
| 58 | {(state) => state.selectedOption()} |
| 59 | </Select.Value> |
| 60 | <Select.Icon class={style.select__icon}> |
| 61 | <CaretSortIcon /> |
| 62 | </Select.Icon> |
| 63 | </Select.Trigger> |
| 64 | <Select.Portal> |
| 65 | <Select.Content class={style.select__content}> |
| 66 | <Select.Listbox class={style.select__listbox} /> |
| 67 | </Select.Content> |
| 68 | </Select.Portal> |
| 69 | </Select> |
| 70 | ); |
| 71 | } |
| 72 | |
| 73 | export function ControlledExample() { |
| 74 | const [value, setValue] = createSignal("Blueberry"); |
nothing calls this directly
no outgoing calls
no test coverage detected