ColumnLayout

Das ColumnLayout organisiert Inhalte in Spalten, definierbar je Breakpoint.
Vorname
Max
Nachname
Mustermann
Straße
Musterstraße 1
Ort
32423 Minden
Telefon
+49 571 000000
E-Mail
max@example.com
import {
  ColumnLayout,
  Content,
  Label,
  LabeledValue,
} from "@mittwald/flow-react-components";

<ColumnLayout>
  <LabeledValue>
    <Label>Vorname</Label>
    <Content>Max</Content>
  </LabeledValue>
  <LabeledValue>
    <Label>Nachname</Label>
    <Content>Mustermann</Content>
  </LabeledValue>
  <LabeledValue>
    <Label>Straße</Label>
    <Content>Musterstraße 1</Content>
  </LabeledValue>
  <LabeledValue>
    <Label>Ort</Label>
    <Content>32423 Minden</Content>
  </LabeledValue>
  <LabeledValue>
    <Label>Telefon</Label>
    <Content>+49 571 000000</Content>
  </LabeledValue>
  <LabeledValue>
    <Label>E-Mail</Label>
    <Content>max@example.com</Content>
  </LabeledValue>
</ColumnLayout>

Best Practices

  • Verwende nicht zu viele Spalten, in der Regel höchstens vier.
  • Wähle die Spaltenbreiten bewusst. Einheitliche Breiten wirken harmonisch, unterschiedliche lenken den Fokus auf breitere Inhalte.
  • Kombiniere das ColumnLayout bei Bedarf mit einer Section. Das schafft übersichtliche Layouts.
  • Verschachtele mehrere ColumnLayouts, um Inhalte optisch zu gruppieren.

Responsive Layout

Die Breakpoints beziehen sich nicht auf die Bildschirmgröße des Endgeräts, sondern auf die Breite des Containers, in dem das ColumnLayout verwendet wird. So bricht das Layout automatisch um, sobald es eine bestimmte Breite unterschreitet. Standardmäßig sind die Spalten wie folgt definiert:

  • Größe s bis 550 Pixel Breite: [1]
  • Größe m bis 850 Pixel Breite: [1, 1]
  • Größe l ab 851 Pixel Breite: [1, 1, 1]

In der Definition der Spaltenbreiten werden sowohl die Anzahl der Spalten als auch ihr Größenverhältnis festgelegt. Eine Aufteilung wie [1, 2, 1] erzeugt zum Beispiel drei Spalten, wobei die mittlere doppelt so breit ist wie die beiden äußeren.


Benutzerdefinierte Werte

Für jeden Breakpoint können eigene Werte für die Spaltenanzahl und deren Größenverhältnis festgelegt werden. Wenn für einen größeren Breakpoint keine eigenen Werte definiert sind, übernimmt er automatisch die Werte des nächstkleineren Breakpoints. Standardwerte werden nur verwendet, wenn bei keinem kleineren Breakpoint benutzerdefinierte Werte angegeben sind. Beispiel:

  • Größe s bis 550 Pixel Breite: [1] (Default-Wert)
  • Größe m bis 850 Pixel Breite: [2, 1] (benutzerdefinierter Wert)
  • Größe l ab 851 Pixel Breite: [2, 1] (Wert von m geerbt)

In diesem Beispiel wurde für den Breakpoint m eine benutzerdefinierte Spaltenaufteilung festgelegt. Der Breakpoint l übernimmt diese Aufteilung von m, anstatt auf den Standardwert von [1, 1, 1] zurückzufallen. Da für den Breakpoint s kein benutzerdefinierter Wert angegeben wurde, bleibt er beim Standardwert von [1].


Ausgeblendete Spalten

Als Werte für die Breakpoints kann neben Zahlen auch null mitgegeben werden. Das führt dazu, dass die entsprechende Spalte ausgeblendet wird. Hier wird beispielsweise das Bild in der kleinsten Ansicht ausgeblendet:

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque eius quam quas vel voluptas, ullam aliquid fugit. Voluptate harum accusantium rerum ullam modi blanditiis vitae, laborum ea tempore, dolore voluptas. Earum pariatur, similique corrupti id officia perferendis. Labore, similique. Earum, quas in. At dolorem corrupti blanditiis nulla deserunt laborum! Corrupti delectus aspernatur nihil nulla obcaecati ipsam porro sequi rem? Quam.
mittwald

Abstände

Die Abstände des ColumnLayout können in drei Stufen angepasst werden:

  • s = 8px
  • m = 16px
  • l = 24px

Das Property rowGap steuert die Abstände zwischen den Zeilen (oben und unten), columnGap die Abstände zwischen den Spalten (rechts und links) und gap setzt alle Abstände gleichzeitig.


Properties

PropertyTypeDefaultDescription
s(number)[]-Column layout for container size s.
m(number)[]-Column layout for container size m.
l(number)[]-Column layout for container size l.
gapGapSize"m"Size of the row and column gap between the content blocks inside the column layout.
rowGapGapSize-Size of the row gap between the content blocks inside the column layout.
columnGapGapSize-Size of the column gap between the content blocks inside the column layout.
childrenReactNode-
defaultCheckedboolean-
defaultValuestring | number | readonly string[]-
suppressContentEditableWarningboolean-
suppressHydrationWarningboolean-
accessKeystring-
autoCapitalize"none" | (string & {}) | "off" | "on" | "sentences" | "words" | "characters"-
autoFocusboolean-
classNamestring-
contentEditableBooleanish | "inherit" | "plaintext-only"-
contextMenustring-
dirstring-
draggableBooleanish-
enterKeyHint"enter" | "done" | "go" | "next" | "previous" | "search" | "send"-
hiddenboolean-
idstring-
langstring-
noncestring-
slotstring-
spellCheckBooleanish-
styleCSSProperties-
tabIndexnumber-
titlestring-
translate"yes" | "no"-
radioGroupstring-
roleAriaRole-
aboutstring-
contentstring-
datatypestring-
inlistany-
prefixstring-
propertystring-
relstring-
resourcestring-
revstring-
typeofstring-
vocabstring-
autoCorrectstring-
autoSavestring-
colorstring-
itemPropstring-
itemScopeboolean-
itemTypestring-
itemIDstring-
itemRefstring-
resultsnumber-
securitystring-
unselectable"off" | "on"-
popover"" | "auto" | "manual" | "hint"-
popoverTargetAction"toggle" | "show" | "hide"-
popoverTargetstring-
inertboolean-@see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
inputMode"text" | "none" | "search" | "url" | "tel" | "email" | "numeric" | "decimal"-Hints at the type of data that might be entered by the user while editing the element or its contents @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
isstring-Specify that a standard HTML element should behave like a defined custom built-in element @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
exportpartsstring-@see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
partstring-@see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
dangerouslySetInnerHTML{ __html: string | TrustedHTML; }-
elementType"div" | ExoticComponent<{}> | "ul"-The HTML element or React component rendered as the elements root.
wrapWithReactElement<unknown, string | JSXElementConstructor<any>>-A React element the component is wrapped with. The element is cloned and receives the component as its only child — useful to render the component inside a link, a tooltip trigger or any other wrapper without changing the surrounding markup.
refRef<HTMLSpanElement>-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-

Events

PropertyTypeDefaultDescription
onCopyClipboardEventHandler<HTMLElement>-
onCopyCaptureClipboardEventHandler<HTMLElement>-
onCutClipboardEventHandler<HTMLElement>-
onCutCaptureClipboardEventHandler<HTMLElement>-
onPasteClipboardEventHandler<HTMLElement>-
onPasteCaptureClipboardEventHandler<HTMLElement>-
onCompositionEndCompositionEventHandler<HTMLElement>-
onCompositionEndCaptureCompositionEventHandler<HTMLElement>-
onCompositionStartCompositionEventHandler<HTMLElement>-
onCompositionStartCaptureCompositionEventHandler<HTMLElement>-
onCompositionUpdateCompositionEventHandler<HTMLElement>-
onCompositionUpdateCaptureCompositionEventHandler<HTMLElement>-
onFocusFocusEventHandler<HTMLElement>-
onFocusCaptureFocusEventHandler<HTMLElement>-
onBlurFocusEventHandler<HTMLElement>-
onBlurCaptureFocusEventHandler<HTMLElement>-
onChangeChangeEventHandler<HTMLElement, Element>-
onChangeCaptureChangeEventHandler<HTMLElement, Element>-
onBeforeInputInputEventHandler<HTMLElement>-
onBeforeInputCaptureInputEventHandler<HTMLElement>-
onInputInputEventHandler<HTMLElement>-
onInputCaptureInputEventHandler<HTMLElement>-
onResetReactEventHandler<HTMLElement>-
onResetCaptureReactEventHandler<HTMLElement>-
onSubmitSubmitEventHandler<HTMLElement>-
onSubmitCaptureSubmitEventHandler<HTMLElement>-
onInvalidReactEventHandler<HTMLElement>-
onInvalidCaptureReactEventHandler<HTMLElement>-
onLoadReactEventHandler<HTMLElement>-
onLoadCaptureReactEventHandler<HTMLElement>-
onErrorReactEventHandler<HTMLElement>-
onErrorCaptureReactEventHandler<HTMLElement>-
onKeyDownKeyboardEventHandler<HTMLElement>-
onKeyDownCaptureKeyboardEventHandler<HTMLElement>-
onKeyPressKeyboardEventHandler<HTMLElement>-@deprecated Use `onKeyUp` or `onKeyDown` instead
onKeyPressCaptureKeyboardEventHandler<HTMLElement>-@deprecated Use `onKeyUpCapture` or `onKeyDownCapture` instead
onKeyUpKeyboardEventHandler<HTMLElement>-
onKeyUpCaptureKeyboardEventHandler<HTMLElement>-
onAbortReactEventHandler<HTMLElement>-
onAbortCaptureReactEventHandler<HTMLElement>-
onCanPlayReactEventHandler<HTMLElement>-
onCanPlayCaptureReactEventHandler<HTMLElement>-
onCanPlayThroughReactEventHandler<HTMLElement>-
onCanPlayThroughCaptureReactEventHandler<HTMLElement>-
onDurationChangeReactEventHandler<HTMLElement>-
onDurationChangeCaptureReactEventHandler<HTMLElement>-
onEmptiedReactEventHandler<HTMLElement>-
onEmptiedCaptureReactEventHandler<HTMLElement>-
onEncryptedReactEventHandler<HTMLElement>-
onEncryptedCaptureReactEventHandler<HTMLElement>-
onEndedReactEventHandler<HTMLElement>-
onEndedCaptureReactEventHandler<HTMLElement>-
onLoadedDataReactEventHandler<HTMLElement>-
onLoadedDataCaptureReactEventHandler<HTMLElement>-
onLoadedMetadataReactEventHandler<HTMLElement>-
onLoadedMetadataCaptureReactEventHandler<HTMLElement>-
onLoadStartReactEventHandler<HTMLElement>-
onLoadStartCaptureReactEventHandler<HTMLElement>-
onPauseReactEventHandler<HTMLElement>-
onPauseCaptureReactEventHandler<HTMLElement>-
onPlayReactEventHandler<HTMLElement>-
onPlayCaptureReactEventHandler<HTMLElement>-
onPlayingReactEventHandler<HTMLElement>-
onPlayingCaptureReactEventHandler<HTMLElement>-
onProgressReactEventHandler<HTMLElement>-
onProgressCaptureReactEventHandler<HTMLElement>-
onRateChangeReactEventHandler<HTMLElement>-
onRateChangeCaptureReactEventHandler<HTMLElement>-
onSeekedReactEventHandler<HTMLElement>-
onSeekedCaptureReactEventHandler<HTMLElement>-
onSeekingReactEventHandler<HTMLElement>-
onSeekingCaptureReactEventHandler<HTMLElement>-
onStalledReactEventHandler<HTMLElement>-
onStalledCaptureReactEventHandler<HTMLElement>-
onSuspendReactEventHandler<HTMLElement>-
onSuspendCaptureReactEventHandler<HTMLElement>-
onTimeUpdateReactEventHandler<HTMLElement>-
onTimeUpdateCaptureReactEventHandler<HTMLElement>-
onVolumeChangeReactEventHandler<HTMLElement>-
onVolumeChangeCaptureReactEventHandler<HTMLElement>-
onWaitingReactEventHandler<HTMLElement>-
onWaitingCaptureReactEventHandler<HTMLElement>-
onAuxClickMouseEventHandler<HTMLElement>-
onAuxClickCaptureMouseEventHandler<HTMLElement>-
onClickMouseEventHandler<HTMLElement>-
onClickCaptureMouseEventHandler<HTMLElement>-
onContextMenuMouseEventHandler<HTMLElement>-
onContextMenuCaptureMouseEventHandler<HTMLElement>-
onDoubleClickMouseEventHandler<HTMLElement>-
onDoubleClickCaptureMouseEventHandler<HTMLElement>-
onDragDragEventHandler<HTMLElement>-
onDragCaptureDragEventHandler<HTMLElement>-
onDragEndDragEventHandler<HTMLElement>-
onDragEndCaptureDragEventHandler<HTMLElement>-
onDragEnterDragEventHandler<HTMLElement>-
onDragEnterCaptureDragEventHandler<HTMLElement>-
onDragExitDragEventHandler<HTMLElement>-
onDragExitCaptureDragEventHandler<HTMLElement>-
onDragLeaveDragEventHandler<HTMLElement>-
onDragLeaveCaptureDragEventHandler<HTMLElement>-
onDragOverDragEventHandler<HTMLElement>-
onDragOverCaptureDragEventHandler<HTMLElement>-
onDragStartDragEventHandler<HTMLElement>-
onDragStartCaptureDragEventHandler<HTMLElement>-
onDropDragEventHandler<HTMLElement>-
onDropCaptureDragEventHandler<HTMLElement>-
onMouseDownMouseEventHandler<HTMLElement>-
onMouseDownCaptureMouseEventHandler<HTMLElement>-
onMouseEnterMouseEventHandler<HTMLElement>-
onMouseLeaveMouseEventHandler<HTMLElement>-
onMouseMoveMouseEventHandler<HTMLElement>-
onMouseMoveCaptureMouseEventHandler<HTMLElement>-
onMouseOutMouseEventHandler<HTMLElement>-
onMouseOutCaptureMouseEventHandler<HTMLElement>-
onMouseOverMouseEventHandler<HTMLElement>-
onMouseOverCaptureMouseEventHandler<HTMLElement>-
onMouseUpMouseEventHandler<HTMLElement>-
onMouseUpCaptureMouseEventHandler<HTMLElement>-
onSelectReactEventHandler<HTMLElement>-
onSelectCaptureReactEventHandler<HTMLElement>-
onTouchCancelTouchEventHandler<HTMLElement>-
onTouchCancelCaptureTouchEventHandler<HTMLElement>-
onTouchEndTouchEventHandler<HTMLElement>-
onTouchEndCaptureTouchEventHandler<HTMLElement>-
onTouchMoveTouchEventHandler<HTMLElement>-
onTouchMoveCaptureTouchEventHandler<HTMLElement>-
onTouchStartTouchEventHandler<HTMLElement>-
onTouchStartCaptureTouchEventHandler<HTMLElement>-
onPointerDownPointerEventHandler<HTMLElement>-
onPointerDownCapturePointerEventHandler<HTMLElement>-
onPointerMovePointerEventHandler<HTMLElement>-
onPointerMoveCapturePointerEventHandler<HTMLElement>-
onPointerUpPointerEventHandler<HTMLElement>-
onPointerUpCapturePointerEventHandler<HTMLElement>-
onPointerCancelPointerEventHandler<HTMLElement>-
onPointerCancelCapturePointerEventHandler<HTMLElement>-
onPointerEnterPointerEventHandler<HTMLElement>-
onPointerLeavePointerEventHandler<HTMLElement>-
onPointerOverPointerEventHandler<HTMLElement>-
onPointerOverCapturePointerEventHandler<HTMLElement>-
onPointerOutPointerEventHandler<HTMLElement>-
onPointerOutCapturePointerEventHandler<HTMLElement>-
onGotPointerCapturePointerEventHandler<HTMLElement>-
onGotPointerCaptureCapturePointerEventHandler<HTMLElement>-
onLostPointerCapturePointerEventHandler<HTMLElement>-
onLostPointerCaptureCapturePointerEventHandler<HTMLElement>-
onScrollUIEventHandler<HTMLElement>-
onScrollCaptureUIEventHandler<HTMLElement>-
onScrollEndUIEventHandler<HTMLElement>-
onScrollEndCaptureUIEventHandler<HTMLElement>-
onWheelWheelEventHandler<HTMLElement>-
onWheelCaptureWheelEventHandler<HTMLElement>-
onAnimationStartAnimationEventHandler<HTMLElement>-
onAnimationStartCaptureAnimationEventHandler<HTMLElement>-
onAnimationEndAnimationEventHandler<HTMLElement>-
onAnimationEndCaptureAnimationEventHandler<HTMLElement>-
onAnimationIterationAnimationEventHandler<HTMLElement>-
onAnimationIterationCaptureAnimationEventHandler<HTMLElement>-
onToggleToggleEventHandler<HTMLElement>-
onBeforeToggleToggleEventHandler<HTMLElement>-
onTransitionCancelTransitionEventHandler<HTMLElement>-
onTransitionCancelCaptureTransitionEventHandler<HTMLElement>-
onTransitionEndTransitionEventHandler<HTMLElement>-
onTransitionEndCaptureTransitionEventHandler<HTMLElement>-
onTransitionRunTransitionEventHandler<HTMLElement>-
onTransitionRunCaptureTransitionEventHandler<HTMLElement>-
onTransitionStartTransitionEventHandler<HTMLElement>-
onTransitionStartCaptureTransitionEventHandler<HTMLElement>-

Accessibility

PropertyTypeDefaultDescription
aria-activedescendantstring-Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
aria-atomicBooleanish-Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
aria-autocomplete"list" | "none" | "inline" | "both"-Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
aria-braillelabelstring-Defines a string value that labels the current element, which is intended to be converted into Braille. @see aria-label.
aria-brailleroledescriptionstring-Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille. @see aria-roledescription.
aria-busyBooleanish-
aria-checkedboolean | "false" | "true" | "mixed"-Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. @see aria-pressed @see aria-selected.
aria-colcountnumber-Defines the total number of columns in a table, grid, or treegrid. @see aria-colindex.
aria-colindexnumber-Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. @see aria-colcount @see aria-colspan.
aria-colindextextstring-Defines a human readable text alternative of aria-colindex. @see aria-rowindextext.
aria-colspannumber-Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. @see aria-colindex @see aria-rowspan.
aria-controlsstring-Identifies the element (or elements) whose contents or presence are controlled by the current element. @see aria-owns.
aria-currentboolean | "step" | "false" | "true" | "page" | "location" | "date" | "time"-Indicates the element that represents the current item within a container or set of related elements.
aria-describedbystring-Identifies the element (or elements) that describes the object. @see aria-labelledby
aria-descriptionstring-Defines a string value that describes or annotates the current element. @see related aria-describedby.
aria-detailsstring-Identifies the element that provides a detailed, extended description for the object. @see aria-describedby.
aria-disabledBooleanish-Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. @see aria-hidden @see aria-readonly.
aria-dropeffect"none" | "link" | "copy" | "execute" | "move" | "popup"-Indicates what functions can be performed when a dragged object is released on the drop target. @deprecated in ARIA 1.1
aria-errormessagestring-Identifies the element that provides an error message for the object. @see aria-invalid @see aria-describedby.
aria-expandedBooleanish-Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
aria-flowtostring-Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
aria-grabbedBooleanish-Indicates an element's "grabbed" state in a drag-and-drop operation. @deprecated in ARIA 1.1
aria-haspopupboolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog"-Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
aria-hiddenBooleanish-Indicates whether the element is exposed to an accessibility API. @see aria-disabled.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling"-Indicates the entered value does not conform to the format expected by the application. @see aria-errormessage.
aria-keyshortcutsstring-Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
aria-labelstring-Defines a string value that labels the current element. @see aria-labelledby.
aria-labelledbystring-Identifies the element (or elements) that labels the current element. @see aria-describedby.
aria-levelnumber-Defines the hierarchical level of an element within a structure.
aria-live"off" | "assertive" | "polite"-Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
aria-modalBooleanish-Indicates whether an element is modal when displayed.
aria-multilineBooleanish-Indicates whether a text box accepts multiple lines of input or only a single line.
aria-multiselectableBooleanish-Indicates that the user may select more than one item from the current selectable descendants.
aria-orientation"horizontal" | "vertical"-Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
aria-ownsstring-Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. @see aria-controls.
aria-placeholderstring-Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
aria-posinsetnumber-Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. @see aria-setsize.
aria-pressedboolean | "false" | "true" | "mixed"-Indicates the current "pressed" state of toggle buttons. @see aria-checked @see aria-selected.
aria-readonlyBooleanish-Indicates that the element is not editable, but is otherwise operable. @see aria-disabled.
aria-relevant"text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"-Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. @see aria-atomic.
aria-requiredBooleanish-Indicates that user input is required on the element before a form may be submitted.
aria-roledescriptionstring-Defines a human-readable, author-localized description for the role of an element.
aria-rowcountnumber-Defines the total number of rows in a table, grid, or treegrid. @see aria-rowindex.
aria-rowindexnumber-Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. @see aria-rowcount @see aria-rowspan.
aria-rowindextextstring-Defines a human readable text alternative of aria-rowindex. @see aria-colindextext.
aria-rowspannumber-Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. @see aria-rowindex @see aria-colspan.
aria-selectedBooleanish-Indicates the current "selected" state of various widgets. @see aria-checked @see aria-pressed.
aria-setsizenumber-Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. @see aria-posinset.
aria-sort"none" | "ascending" | "descending" | "other"-Indicates if items in a table or grid are sorted in ascending or descending order.
aria-valuemaxnumber-Defines the maximum allowed value for a range widget.
aria-valueminnumber-Defines the minimum allowed value for a range widget.
aria-valuenownumber-Defines the current value for a range widget. @see aria-valuetext.
aria-valuetextstring-Defines the human readable text alternative of aria-valuenow for a range widget.

Auf dieser Seite