# Item

A versatile component for displaying content with media, title, description, and actions.

Section: Components / Data display
Page: https://ui.heyramzi.com/components/item
Import path: `@heyramzi/ui/shadcn/item`

## Import

```ts
import * as Item from "@heyramzi/ui/shadcn/item";
import { Button } from "@heyramzi/ui/shadcn/button";
```

## Usage

```svelte
<Item.Root variant="outline">
  <Item.Content>
    <Item.Title>Two-factor sign-in</Item.Title>
    <Item.Description>A code from your phone at each new sign-in.</Item.Description>
  </Item.Content>
</Item.Root>
```

## Demo

```svelte
<script lang="ts">
	import { CaretRight, SealCheck } from "phosphor-svelte";
	import * as Item from "@heyramzi/ui/shadcn/item";
	import { Button } from "@heyramzi/ui/shadcn/button";
</script>

<div class="flex w-full max-w-md flex-col gap-6">
	<Item.Root variant="outline">
		<Item.Content>
			<Item.Title>Basic Item</Item.Title>
			<Item.Description>A simple item with title and description.</Item.Description>
		</Item.Content>
		<Item.Actions>
			<Button variant="outline" size="sm">Action</Button>
		</Item.Actions>
	</Item.Root>
	<Item.Root variant="outline" size="sm">
		{#snippet child({ props })}
			<a href="/components/avatar" {...props}>
				<Item.Media>
					<SealCheck aria-hidden="true" class="size-5" />
				</Item.Media>
				<Item.Content>
					<Item.Title>Your profile has been verified.</Item.Title>
				</Item.Content>
				<Item.Actions>
					<CaretRight aria-hidden="true" class="size-4" />
				</Item.Actions>
			</a>
		{/snippet}
	</Item.Root>
</div>
```

## API

### Item.Root

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `child` | `Snippet<[{ props: Record<string, unknown> }]>` |  |  |
| `variant` | `"default"` \| `"outline"` \| `"muted"` |  |  |
| `size` | `"default"` \| `"sm"` \| `"xs"` |  |  |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Content

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Title

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Description

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLParagraphElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLParagraphElement>` from `svelte/elements`.

### Item.Actions

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Media

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `variant` | `"default"` \| `"icon"` \| `"image"` | `"default"` |  |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Group

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Separator

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` |  | `null` | bindable |
| `class` | `string` |  |  |

Every prop of `Separator`.

### Item.Header

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.

### Item.Footer

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `ref` | `HTMLDivElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `children` | `Snippet` |  |  |

Every prop of `HTMLAttributes<HTMLDivElement>` from `svelte/elements`.
