Skip to content

Resource item

Resource items represent specific objects within a collection, such as products or orders. They provide contextual information on the resource type and link to the object’s detail page.

Props

No props found for this component, run `yarn gen:docs` to generate component meta first.

Slots

No slots found for this component, run `yarn gen:docs` to generate component meta first.

Required components

The resource item component must be wrapped in the resource list component.


Accessibility

Resource items function as links to the full-page representations of the items. Each item should have a unique name prop. For each ResourceItem, the accessibilityLabel prop should be used to give the link a unique aria-label value. The aria-label value should convey the link’s purpose, using the name value. Merchants who use screen readers or other text to speech tools should be able to easily distinguish each link from the others.

When adding custom content to resource items, ensure that all text is available to all users and that all custom controls have a unique accessible name to help users understand what will happen when the control is activated.

Keyboard

Links can be activated with the enter/return key by default.

If you add custom controls to resource items, then make sure that the controls:

  • Can be used with the keyboard
  • Receive keyboard focus in a logical order
  • Display a visible focus indicator

Best practices

Resource items should:

  • Be tailored to the specific type of context being displayed.
  • Perform an action when clicked. The action should navigate to the resource’s details page or provide more detail about the item.

Resource items can optionally:

  • Provide shortcut actions for quick access to frequent actions from the resource’s details page.

Content guidelines

Resource items should:

  • Present the information that merchants need to find the items that they’re looking for.
  • Support merchant tasks for the particular type of resource.
  • Avoid colons.
  • Shortcut actions don’t need to follow the full verb + noun formula for buttons.

To display a simple list of related content, use the list component.

Released under the MIT License.