mittwald Flow Logo

Components

Select

Die Select-Komponente bietet eine Liste von Optionen an, von denen eine ausgewählt werden kann.GitHub
App (optional)

Playground

App (optional)
import {
  Label,
  Option,
  Select,
} from "@mittwald/flow-react-components";

<Select>
  <Label>App</Label>
  <Option>WordPress</Option>
  <Option>TYPO3</Option>
  <Option>Contao</Option>
  <Option>Drupal</Option>
  <Option>Joomla!</Option>
  <Option>Matomo</Option>
</Select>

Mit FieldDescription

App (optional)Weitere Informationen
import {
  FieldDescription,
  Label,
  Option,
  Select,
} from "@mittwald/flow-react-components";

<Select>
  <Label>App</Label>
  <Option>WordPress</Option>
  <Option>TYPO3</Option>
  <Option>Contao</Option>
  <Option>Drupal</Option>
  <Option>Joomla!</Option>
  <Option>Matomo</Option>
  <FieldDescription>Weitere Informationen</FieldDescription>
</Select>

Kombiniere mit ...

Align

Benutze die Align Komponente, um einem Button neben deinem Select zu platzieren.

App (optional)
import {
  Align,
  Button,
  Select,
  Label,
  Option,
} from "@mittwald/flow-react-components";

<Align>
  <Select>
    <Label>App</Label>
    <Option>WordPress</Option>
    <Option>TYPO3</Option>
    <Option>Contao</Option>
    <Option>Drupal</Option>
    <Option>Joomla!</Option>
    <Option>Matomo</Option>
  </Select>
  <Button>Hinzufügen</Button>
</Align>

Kombiniere mit ...

ContextualHelp

Benutze die ContextualHelp Komponente, wenn du weitere Informationen bereitstellen möchtest, und diese zu lang für die FieldDescription sind.

App (optional)
import {
  Button,
  ContextualHelp,
  ContextualHelpTrigger,
  Heading,
  Label,
  Option,
  Select,
  Text,
} from "@mittwald/flow-react-components";

<Select>
  <Label>
    App
    <ContextualHelpTrigger>
      <Button />
      <ContextualHelp>
        <Heading>Weitere Informationen</Heading>
        <Text>
          Hier gibt es weitere Informationen, die zu lang
          für die FieldDescription sind.
        </Text>
      </ContextualHelp>
    </ContextualHelpTrigger>
  </Label>
  <Option>WordPress</Option>
  <Option>TYPO3</Option>
  <Option>Contao</Option>
  <Option>Drupal</Option>
  <Option>Joomla!</Option>
  <Option>Matomo</Option>
</Select>

Properties

PropertyTypeDefaultDescription
controllerOverlayController-

An overlay controller to control the select option popover state.

isOpenboolean-

Sets the open state of the menu.

defaultOpenboolean-

Sets the default open state of the menu.

styleCSSProperties | ((values: SelectRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)-

The inline style for the element. A function may be provided to compute the style based on component state.

validationBehavior"native" | "aria"'native'

Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.

isDisabledboolean-

Whether the input is disabled.

isRequiredboolean-

Whether user input is required on the input before form submission.

isInvalidboolean-

Whether the input value is invalid.

validate((value: Key) => true | ValidationError)-

A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if validationBehavior="native". For realtime validation, use the isInvalid prop instead.

autoFocusboolean-

Whether the element should receive focus on render.

idstring-

The element's unique identifier. See MDN.

namestring-

The name of the input, used when submitting an HTML form.

slotstring-

A slot name for the component. Slots allow the component to receive props from a parent component. An explicit null value indicates that the local props completely override all props received from a parent.

excludeFromTabOrderboolean-

Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available.

placeholderstring-

Temporary text that occupies the text input when it is empty.

selectedKeyKey-

The currently selected key in the collection (controlled).

defaultSelectedKeyKey-

The initial selected key in the collection (uncontrolled).

disabledKeysIterable<Key>-

The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.

autoCompletestring-

Describes the type of autocomplete functionality the input should provide if any. See MDN.

childrenReactNode-
wrapWithReactElement<unknown, string | JSXElementConstructor<any>>-
classNamestring-

The elements class name.

refRef<HTMLDivElement>-

Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref). @see React Docs

keyKey-

Feedback geben