Verwende AccentBoxen, um z. B. ...
- ergänzende, aber nicht kritische Hinweise anzuzeigen.
- kontextuelle Informationen oder Tipps zu geben.
- visuell strukturierende Inhalte einzubetten, ohne zu unterbrechen.
import { AccentBox, Heading, Link, Section, Text, } from "@mittwald/flow-react-components"; <AccentBox backgroundColor="blue"> <Section> <Heading>Hilf uns, Flow noch besser zu machen!</Heading> <Text> Fehlt dir eine bestimmte Component oder etwas anderes? Hast du Feedback? Dann teile es uns gerne auf GitHub mit. </Text> <Link href="#" target="_blank"> Feedback zu Flow geben </Link> </Section> </AccentBox>
AccentBoxen und Alerts dienen beide dazu, dem User zusätzliche Informationen bereitzustellen. Eine einfache Faustregel hilft bei der Entscheidung: Kann die Information ignoriert werden, ohne negative Folgen? Dann ist eine AccentBox die richtige Wahl. Wenn das Ignorieren hingegen zu Problemen führen könnte – etwa bei sicherheitsrelevanten Hinweisen oder wichtigen Systemmeldungen – sollte ein Alert mit entsprechendem Status verwendet werden.
Die AccentBox unterstützt die Basisfarben Blue und Neutral (Default). Diese helfen dabei, Inhalte für den User dezent hervorzuheben.
Die Brand Colors Teal, Violet, Lilac, Navy und Green eignen sich besonders für werbliche Inhalte und Marketing-Storys.
Die AccentBox unterstützt zusätzlich eine benutzerdefinierte Farbe. Diese Option sollte nur in Ausnahmefällen genutzt werden. Für die meisten Use Cases sollten Base Colors oder Brand Colors verwendet werden, damit die visuelle Konsistenz erhalten bleibt.
Eine AccentBox mit Gradient hebt sich visuell stärker hervor. Dadurch eignet sich diese Variante besonders für aufmerksamkeitsstarke Inhalte wie Werbemaßnahmen.
Die AccentBox unterstützt ein Hintergrundbild. Über aspectRatio kann ein
festes Seitenverhältnis definiert werden.
Die AccentBox kann in einen Link gewrappt werden, um die gesamte Component klickbar zu machen.
Befindet sich eine AccentBox als erstes Element innerhalb einer LayoutCard, füllt sie die gesamte Größe der LayoutCard aus.
| Property | Type | Default | Description |
|---|---|---|---|
aspectRatio | AspectRatio | - | The aspect ratio of the accent box. |
backgroundColor | AccentBoxWithCustomBackgroundColor | "neutral" | The background color of the accent box. |
backgroundImage | string | - | The background image of the accent box. |
children | ReactNode | - | |
color | "default" | "dark" | "light" | "dark-static" | "light-static" | "default" | The content color of the accent box. |
elementType | "div" | "article" | ExoticComponent<{}> | "section" | - | The HTML element or React component rendered as the elements root. |
wrapWith | ReactElement<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. |
| Property | Type | Default | Description |
|---|---|---|---|
aria-describedby | string | - | Identifies the element (or elements) that describes the object. @see aria-labelledby |
aria-hidden | Booleanish | - | Indicates whether the element is exposed to an accessibility API. @see aria-disabled. |
aria-label | string | - | Defines a string value that labels the current element. @see aria-labelledby. |
aria-labelledby | string | - | Identifies the element (or elements) that labels the current element. @see aria-describedby. |