Lieferung in 2 bis 4 Werktagen, ab 29 € Bestellwert versandkostenfrei.
12
Divider (can be hidden)
Content (default slot)
LiveAnatomyHTML
<div class="anatomy" style="display:block;max-width:560px;margin:28px auto">
<oc-row-v2><p class="demo-copy">Lieferung in 2 bis 4 Werktagen, ab 29 € Bestellwert versandkostenfrei.</p></oc-row-v2>
<span class="anatomy-pin" style="left:-4%;top:0%">1</span><span class="anatomy-pin" style="left:-4%;top:50%">2</span>
<ol class="anatomy-key"><li data-n="1">Divider (can be hidden)</li><li data-n="2">Content (default slot)</li></ol>
Variants
The default variant of the row is the container variant. It can be filled with any content. However, there are several other predefined variants:
Label: This is for lightweight text content. It features an optional decorative icon on the left and an optional affordance icon on the right.
Image: This is combinations of images and text. The image variant also comes with a decorative icon on the left and an optional affordance icon on the right.
Headline: The headline variant may be used to introduce or divide a set of rows into sections.
Lieferung in 2 bis 4 Werktagen, ab 29 € Bestellwert versandkostenfrei.
By default, the row is not interactive and has no states. If you choose to make the row interactive or checkable, the row will have the following states. Note that the checked state of the row only switches the text to be bold.
The hitbox of the interactive or checkable row is 8px wider on each side, to create an optimal hitbox and smooth states. That does not affect the actual width of the row.
Filter zurücksetzen
Dashed: clickable area, 8 px wider on each side than the row in the layout
Place rows on a block inside the canvas. If you want to place one row below the other do not use any gaps, as they are already divided by the divider, which is part of the default component. Hide the divider for the first row, or if you are placing a row on its own.
The row component provides a flexible row layout with multiple variants, including label, image, headline, and two-columns.
It supports interactive features such as clickable rows, selectable states, and customizable icons and images.
The Row component offers a variety of styling variants such as ...
This component is highly configurable, allowing you to tailor its features and appearance to your specific needs.
To explore all the available options and adjust the component, use the component configurator and see the changes affect the component in real-time.
Usage guidelines
Before integrating the Row component into your project, make sure you have correctly installed the OTTO components package.
Look through the variations page for examples of possible component variations.
Here, you can discover both common and specific variations that address different use cases.
This component has visual overflow in certain states.
When the component is in the hover or active states, it extends beyond its bounding box and is clipped by parent containers with overflow: hidden.
Ensure the parent container has sufficient padding to accommodate the component's full visual area.
To make the row recognizable for screen readers, use the oc-aria-label attribute to provide clear and descriptive context information.
See the general accessibility documentation for guidance on using oc-aria-label, including how it works with link and masked link behavior.
Configuration (v2)
Row configuration
Configure the Row component with the controls below and see the changes live in the preview canvas.
Click the Show code button within the preview canvas to see the source code for the current component configuration.
Interactive configurator (Storybook controls); every option is listed in the API section of this file.
Migration (v2)
Migration from Row v1 to v2
The oc-row component has been updated from oc-row-v1 to oc-row-v2.
This migration guide provides a step-by-step guide to update your project to the latest version.
The new oc-row-v2 component supports many use cases out of the box, eliminating the need for custom styles that were necessary with the previous version.
Instead of using a div (or a different HTML element) with the oc-row-v1 class, use the
<oc-row-v2> tag.
Here's a table mapping deprecated CSS classes to their corresponding replacement attributes in the new version:
CSS class (v1)
Attribute (v2)
Notes
oc-row-v1--hide-divider
hide-divider
No change
oc-row-v1--selected
selected
No change
The oc-row-v1--interactive class does not need a corresponding attribute.
Use the as-button or href attributes as you would on any other component, and the row will become interactive automatically.
Refer to the section Migrate an interactive row for more details.
Migrate a basic row
To migrate a basic row, replace the container element <div> using the oc-link-v1 class with the new <oc-row-v2> element.
<!-- To: -->
<oc-row-v2>
<a href="#">My Link</a>
Label
</oc-row-v2>
For interactive rows using a click handler on a button tag <button>, replace the button tag by <oc-row-v2>, remove the deprecated CSS classes, and set the as-button attribute.
Consider migrating to the built-in positioning styles.
As shown below, place the label of the row in the default slot, and use the icon-left and icon-right to set your icons:
Consider migrating to the built-in positioning styles.
As shown below, set the variant attribute to the value image, place the image in the image slot, and use the icon-right attribute to set the icon:
The row component provides a flexible row layout with multiple variants, including label, image, headline, and two-columns.
It supports interactive features such as clickable rows, selectable states, and customizable icons and images.
When set, this row becomes interactive, and will redirect to the contained link on click.
base64-href
string
undefined
no
The same as href, except base64-encoded. This is used to mask links in the markup.
target
"_blank" | "_self" | "_parent" | "_top"
undefined
no
Determines the target of the link when the row is clicked.
Note Only applies when href or base64-href is set.
rel
string
undefined
no
Sets the rel attribute to determine the relationship between the current document and the linked document.
Note Only applies when href or base64-href is set.
as-button
boolean
undefined
no
When set, this row becomes interactive, and clicking it will trigger a listenable event.
oc-aria-label
string
undefined
no
Sets the ARIA label when the row is interactive. This property should be used when the text content of the row is not enough to deduce its interaction, and should contain a description of that interaction.
oc-aria-expanded
boolean
undefined
no
Sets the ARIA expanded property for usage as a header in an Accordion for example. This should only be used if the row works as a button and reveals more content on interaction.
Slots
Slot
Required
Description
default
no
Sets the main content of the row. Only applicable to variants container, image, and headline.
column-label
no
Sets the content of the label column on the left. Only applicable to variant two-columns. Example: <span slot="column-label">Label</span>
column-text
no
Sets the content of the text column on the right. Only applicable to variant two-columns. Example: <span slot="column-text">Label</span>
image
no
Sets the image that is shown on the left side of the row. Only applicable to variant image. Example: <img slot="column-text" src="https://example.com" alt="Some image">
primary-action
no
Add an empty tag to change the default behavior of the row component.
- empty a tag: the card component behaves as a link (SEO relevant)
Events
Event
Detail type
Description
oc-property-change
OcRowV2Events["oc-property-change"]
Whenever a property value changes, this event triggers. Use this event to track all property changes within the component.
Fired when the component is mounted to the DOM. The event is fired when the onMount hook of the component is called by the runtime.
oc-unmount
{ component: string; }
Fired when the component is unmounted from the DOM. The event is fired when the function returned by the onMount hook of the component is called by the runtime.
CSS custom properties
Custom property
Default
Description
--custom-spacing-x
undefined
Sets the custom horizontal spacing of the row content.
--custom-spacing-y
undefined
Sets the custom vertical spacing of the row content.
--align-items
flex-start
Changes the item alignment in the row. Use center (vertical aligned) or flex-end (aligned to bottom) to overwrite the default
Variations (v2)
Variations
Listed below are the most common variations of the Row component as well as specific component variations for different use cases.
You can explore all available options using the component configurator, adjust the component to your needs, and see the changes live in a preview canvas.
The row component with a link as primary action. Search engines will detect the href.
Args: primaryActionSlot=(see snippet)
<oc-row-v2>
<!--The <a> tag should be placed inside the light DOM to improve SEO.--><a href="#" slot="primary-action" aria-label="placeholder link"></a>
<oc-placeholder-v1>PLACEHOLDER</oc-placeholder-v1>
</oc-row-v2>
<oc-row-v2 base64-href="Iz92YXJpYW50PWZvbw==">
<!--Search engines will detect the href, while users receive the Base64-encoded version.--><a href='#' slot="primary-action" aria-label='Row'></a>
<oc-placeholder-v1>PLACEHOLDER</oc-placeholder-v1>
</oc-row-v2>