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.
<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 Navy, Lilac, Sage und Salmon eignen sich besonders für werbliche Inhalte und Marketing-Storys. Auf allen farbigen Hintergründen ist der Inhalt standardmäßig in der Dark Color.
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. Zu jeder Brand Color gibt es einen Gradient: Navy, Sage, Lilac und Salmon.
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 | Description |
|---|---|---|
aspectRatio | AspectRatio | The aspect ratio of the accent box. |
backgroundColor | AccentBoxWithCustomBackgroundColordefault: "neutral" | The background color of the accent box. Besides the Flow colors, any custom CSS color is supported. |
backgroundImage | string | The background image of the accent box. |
children | ReactNode | |
color | default | dark | light | dark-static | light-static | The content color of the accent box. Defaults to `dark` on the decorative colors and the gradients, otherwise to `default`. |
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. `null` takes a wrapper a surrounding props context set back off, the way `tunnel: null` does for a tunnel. |
| Property | Type | 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. |
| Token | Wert |
|---|---|
--accent-box--padding | 16px |
--accent-box--corner-radius | 12px |
| Token | Light | Dark |
|---|---|---|
--accent-box--background-color-neutral | #ebeff3 | #2c2f33 |
--accent-box--background-color-blue | #b2b2f0 | #211c7f |
--accent-box--background-color-navy | #c6ceec | #2f3551 |
--accent-box--background-color-lilac | #dbcbf8 | #483b5c |
--accent-box--background-color-sage | #c5cdcc | #3e4241 |
--accent-box--background-color-salmon | #e9c8bd | #533f38 |
--accent-box--background-color-gradient-navy | linear-gradient(to top right, #a6b2e7 0%, #b7c1ea 35%, #bbc4ea 50%, #d5dbef 75%, #e2e7f1 100%) | linear-gradient(to top right, #25293a 0%, #2e3550 35%, #303653 50%, #414b7a 75%, #49558b 100%) |
--accent-box--background-color-gradient-sage | linear-gradient(to top right, #a7b2ac 0%, #b7c0bc 35%, #bac4c0 50%, #d5dcdc 75%, #e3e8ea 100%) | linear-gradient(to top right, #272c2c 0%, #2c3232 25%, #323939 50%, #383f3f 75%, #383f3f 100%) |
--accent-box--background-color-gradient-lilac | linear-gradient(to top right, #dcb1c2 0%, #d6b0d6 25%, #cdaef0 50%, #d2b9fb 75%, #ddcbfa 100%) | linear-gradient(to top right, #553a57 0%, #4f3f73 30%, #604f90 65%, #7c61b1 100%) |
--accent-box--background-color-gradient-salmon | linear-gradient(to top right, #e7a48b 0%, #e8b5a3 35%, #e3b8b5 50%, #dbbccf 75%, #d4c0e8 100%) | linear-gradient(to top right, #392d2a 0%, #6f5249 35%, #8a655f 50%, #8d6c84 75%, #806a9c 100%) |