# @salmonui/layout/card API reference

> 14 exported symbols of @salmonui/layout/card: 8 functions, 5 interfaces and 1 type.

Canonical: https://salmonui.dev/docs/reference/layout/card

```ts
import { … } from '@salmonui/layout/card';
```

## Functions

### Card

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/Card

```ts
function Card(props: CardProps): ReactElement;

namespace Card {
    export { CardHeader as Header };
    export { CardTitle as Title };
    export { CardDescription as Description };
    export { CardMedia as Media };
    export { CardBody as Body };
    export { CardActions as Actions };
    export { CardSeparator as Separator };
}
```

Card root (`.salmon-card`).

### CardActions

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardActions

```ts
function CardActions(props: CardActionsProps): ReactElement;
```

Action area (`.salmon-card-actions`) for `Button` elements.

### CardBody

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardBody

```ts
function CardBody(props: HTMLAttributes<HTMLDivElement>): ReactElement;
```

Content (`.salmon-card-body`).

### CardDescription

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardDescription

```ts
function CardDescription(props: HTMLAttributes<HTMLParagraphElement>): ReactElement;
```

Subtitle / description (`.salmon-card-description`, a `<p>`).

### CardHeader

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardHeader

```ts
function CardHeader(props: CardHeaderProps): ReactElement;
```

Header (`.salmon-card-header`): optional `media` and a caption holding the title and description.

### CardMedia

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardMedia

```ts
function CardMedia(props: CardMediaProps): ReactElement;
```

Full-bleed media slot (`.salmon-card-media`): put an `<img>` or `<video>` inside; `title` overlays it.

### CardSeparator

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardSeparator

```ts
function CardSeparator(props: HTMLAttributes<HTMLHRElement>): ReactElement;
```

Separator (`.salmon-card-separator`, an `<hr>`).

### CardTitle

Kind: function

Page: https://salmonui.dev/docs/reference/layout/card/CardTitle

```ts
function CardTitle({ level, ...props }: CardTitleProps): ReactElement;
```

Title (`.salmon-card-title`), a heading (`<h3>` by default).

## Interfaces

### CardActionsProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/card/CardActionsProps

```ts
interface CardActionsProps extends HTMLAttributes<HTMLDivElement> {
    readonly orientation?: 'horizontal' | 'vertical' | undefined;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `orientation` | `readonly orientation?: 'horizontal' \| 'vertical' \| undefined;` | optional | `'horizontal'` (default) or `'vertical'` (stacked full-width actions). |

### CardHeaderProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/card/CardHeaderProps

```ts
interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
    readonly media?: ReactNode;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `media` | `readonly media?: ReactNode;` | optional | Leading media (an `Avatar`, an `<img>`, an icon) before the caption. |

### CardMediaProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/card/CardMediaProps

```ts
interface CardMediaProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
    readonly title?: ReactNode;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `title` | `readonly title?: ReactNode;` | optional | Text overlaid on the bottom of the media. |

### CardProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/card/CardProps

```ts
interface CardProps extends HTMLAttributes<HTMLElement> {
    readonly orientation?: 'vertical' | 'horizontal' | undefined;
    readonly render?: ((props: CardRenderProps) => ReactElement) | undefined;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `orientation` | `readonly orientation?: 'vertical' \| 'horizontal' \| undefined;` | optional | `'vertical'` (default) stacks the parts; `'horizontal'` puts media and content side by side. |
| `render` | `readonly render?: ((props: CardRenderProps) => ReactElement) \| undefined;` | optional | Renders another root element (`<article>`, a link) with the computed props. Default `<div>`. |

### CardTitleProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/card/CardTitleProps

```ts
interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
    readonly level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `level` | `readonly level?: 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| undefined;` | optional | Heading level. Default 3. |

## Types

### CardRenderProps

Kind: type

Page: https://salmonui.dev/docs/reference/layout/card/CardRenderProps

```ts
type CardRenderProps = HTMLAttributes<HTMLElement> & {
    readonly 'data-orientation': 'vertical' | 'horizontal';
};
```

Props `Card` computes for its root (spread them in `render`).

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data-orientation` | `data-orientation: "horizontal" \| "vertical";` | inherited |  |
