Files
ui/docs/content/3.forms/3.select.md
Benjamin Canac 5ea43ab4e4 chore: uniformize icons in Button / Input / Select / SelectMenu
Also adds `loading` to `Select` and `SelectMenu`
2023-05-31 23:30:52 +02:00

3.0 KiB

github, description
github description
true Display a select field.

Usage

The Select component is a wrapper around the native <select> HTML element. For more advanced use cases like searching or multiple selection, consider using the SelectMenu component.

::component-card

baseProps: name: 'select' modelValue: 'United States' props: options: - 'United States' - 'Canada' - 'Mexico' excludedProps:

  • options

::

Style

Use the color and variant props to change the visual style of the Select.

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' props: color: 'primary' variant: 'outline'

::

Besides all the colors from the ui.colors object, you can also use the white (default) and gray colors with their pre-defined variants.

White

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' props: color: 'white' variant: 'outline' excludedProps:

  • color

::

Gray

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' props: color: 'gray' variant: 'outline' excludedProps:

  • color

::

Size

Use the size prop to change the size of the Select.

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' props: size: 'sm'

::

Placeholder

Use the placeholder prop to set a placeholder text.

::component-card

::

Icon

Use any icon from Iconify by setting the icon prop by using this pattern: i-{collection_name}-{icon_name}.

Use the trailing-icon prop to set a different icon or change it globally in ui.select.default.trailingIcon. Defaults to i-heroicons-chevron-down-20-solid.

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' placeholder: 'Search...' props: icon: 'i-heroicons-magnifying-glass-20-solid' color: 'white' size: 'sm' extraColors:

  • white
  • gray excludedProps:
  • icon

::

Disabled

Use the disabled prop to disable the Select.

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' placeholder: 'Search...' props: disabled: true

::

Loading

Use the loading prop to show a loading icon and disable the Input.

Use the loading-icon prop to set a different icon or change it globally in ui.select.default.loadingIcon. Defaults to i-heroicons-arrow-path-20-solid.

::component-card

baseProps: name: 'select' options: - 'United States' - 'Canada' - 'Mexico' placeholder: 'Search...' props: loading: true icon: 'i-heroicons-magnifying-glass-20-solid' excludedProps:

  • icon

::

Props

:component-props

Preset

:component-preset