跳至正文

Item

A list row that pairs leading media and content with metadata and an action.

浏览器
Chrome 123+Firefox 121+Safari 17.5+
层级
0
强制布局预算
0 ms
axe 预算
0
支持 SSR
是
公开契约
测试环境

交互示例

Item

  • Mina Chen
    Design · Updated today
  • Sam Rivera
    Engineering · Updated yesterday

示例

Recent projects

Omit media and actions when a plain project name and its metadata are enough; use links only when a real destination exists.

  • Project Atlas
    Private project · Updated 2 hours ago
  • Q3 launch
    Shared with 4 people · Updated yesterday
import { Item, ItemContent, ItemMetadata } from "@gunkin/uiify";

export default function Example() {
  return (
    <ul>
      <Item>
        <ItemContent>Project Atlas</ItemContent>
        <ItemMetadata>Private project · Updated 2 hours ago</ItemMetadata>
      </Item>
      <Item>
        <ItemContent>Q3 launch</ItemContent>
        <ItemMetadata>Shared with 4 people · Updated yesterday</ItemMetadata>
      </Item>
    </ul>
  );
}

API

Item

属性类型默认值说明
childrenReactNode—Media, primary content, metadata, and optional actions.
className / style / ref / native li propsnative li props—Native list-item props, styles, events, and ref are forwarded.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

ItemMedia

属性类型默认值说明
childrenReactNode—Content for this presentational item part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

ItemContent

属性类型默认值说明
childrenReactNode—Content for this presentational item part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

ItemMetadata

属性类型默认值说明
childrenReactNode—Content for this presentational item part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

ItemActions

属性类型默认值说明
childrenReactNode—Content for this presentational item part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

键盘

按键操作

无障碍

Item renders a list item; place it inside a native ul or ol. Parts are presentational. Keep links and buttons as separate controls; do not make the entire row one link or button. For ItemMedia, choose meaningful alt text or an empty alt when the media is decorative.

样式钩子

data-uiify-itemdata-uiify-item-mediadata-uiify-item-contentdata-uiify-item-metadatadata-uiify-item-actionsdata-part