Item
Item lays out a row with media, a title, a description and actions. Use it for file lists, settings rows and search results. For tabular data, use Table.
2.4 MB · edited 3 days ago
This example also needs: Button.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Examples
Variants
Pick a transparent, bordered or filled surface for the row.
Transparent, borderless.
Bordered surface.
Filled surface.
Sizes
Use the sm size for a denser row.
Media
Lead the row with an icon tile or an image thumbnail.
This example also needs:
Grouped
Stack related rows in an ItemGroup with separators between them.
As child
Render the whole row as a link with asChild.
This example also needs:
Props
Item
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Renders the child element, such as a link, with the item styling. A link child gets hover styles with no extra classes. |
size | "default" | "sm" | null | "default" | No description |
variant | "default" | "outline" | "muted" | null | "default" | No description |
ItemActions
ItemActions adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemContent
ItemContent adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemDescription
ItemDescription adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemFooter
ItemFooter adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemGroup
ItemGroup adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemHeader
ItemHeader adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemMedia
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "icon" | "image" | null | "default" | No description |
ItemSeparator
ItemSeparator adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemTitle
ItemTitle adds no props of its own; it accepts the props of the element or primitive it wraps.
Item lays out a row with media, a title, a description and actions. Use it for file lists, settings rows and search results. For tabular data, use Table.
This example also needs: Button.
Installation
Install these components first:
Install the following dependencies:
Copy and paste the following code into your project.
components/item/Item.vue components/item/ItemActions.vue components/item/ItemContent.vue components/item/ItemDescription.vue components/item/ItemFooter.vue components/item/ItemGroup.vue components/item/ItemHeader.vue components/item/ItemMedia.vue components/item/ItemSeparator.vue components/item/ItemTitle.vue components/item/index.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Examples
Variants
Pick a transparent, bordered or filled surface for the row.
Sizes
Use the sm size for a denser row.
Media
Lead the row with an icon tile or an image thumbnail.
Grouped
Stack related rows in an ItemGroup with separators between them.
As child
Render the whole row as a link with as-child.
Props
Item
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | null | "default" | No description |
variant | "default" | "outline" | "muted" | null | "default" | No description |
ItemActions
ItemActions adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemContent
ItemContent adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemDescription
ItemDescription adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemFooter
ItemFooter adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemGroup
ItemGroup adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemHeader
ItemHeader adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemMedia
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "icon" | "image" | null | "default" | No description |
ItemSeparator
ItemSeparator adds no props of its own; it accepts the props of the element or primitive it wraps.
ItemTitle
ItemTitle adds no props of its own; it accepts the props of the element or primitive it wraps.