Playground
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
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.
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.
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
Property | Type | Default | Description |
---|---|---|---|
controller | OverlayController | - | An overlay controller to control the select option popover state. |
isOpen | boolean | - | Sets the open state of the menu. |
defaultOpen | boolean | - | Sets the default open state of the menu. |
style | CSSProperties | ((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. |
isDisabled | boolean | - | Whether the input is disabled. |
isRequired | boolean | - | Whether user input is required on the input before form submission. |
isInvalid | boolean | - | 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 |
autoFocus | boolean | - | Whether the element should receive focus on render. |
id | string | - | The element's unique identifier. See MDN. |
name | string | - | The name of the input, used when submitting an HTML form. |
slot | string | - | A slot name for the component. Slots allow the component to receive props from a parent component.
An explicit |
excludeFromTabOrder | boolean | - | 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. |
placeholder | string | - | Temporary text that occupies the text input when it is empty. |
selectedKey | Key | - | The currently selected key in the collection (controlled). |
defaultSelectedKey | Key | - | The initial selected key in the collection (uncontrolled). |
disabledKeys | Iterable<Key> | - | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with. |
autoComplete | string | - | Describes the type of autocomplete functionality the input should provide if any. See MDN. |
children | ReactNode | - | |
wrapWith | ReactElement<unknown, string | JSXElementConstructor<any>> | - | |
className | string | - | The elements class name. |
ref | Ref<HTMLDivElement> | - | Allows getting a ref to the component instance.
Once the component unmounts, React will set |
key | Key | - |