# salla-metadata (https://docs.salla.dev/twilight/react/web-components/salla-metadata)



{/* Generated by scripts/sync-web-components.mjs from the components docs.json. Do not edit by hand. */}

Shows the custom fields (metadata) a merchant has filled in for a product, grouped into titled sections.
Use it on a product page to list extra specifications. It renders nothing unless the store has the
`custom-fields` feature enabled and there is data to show. Field types `file` render a download link,
`url` a link, `date` is formatted as `DD/MM/YYYY`; other types are shown as plain text.
On the single product page, `entity-id` is taken from the page automatically when not set.

## Use it [#use-it]

In HTML or JSX, use the tag `<salla-metadata>` with the **Attribute** names below. In React, the wrapper takes the **Property** names (camelCase).

```tsx
import { SallaMetadata } from '@salla.sa/twilight-components-react/metadata';
```

**Client-only.** On the server this wrapper renders a placeholder (a skeleton, or nothing), and the real component mounts in the browser. Do not rely on it for content that search engines must see.

## Example [#example]

```tsx
import { SallaMetadata } from '@salla.sa/twilight-components-react/metadata';

export function Example() {
  return (
    <SallaMetadata entity="product" entityId="123456" />
  );
}
```

```html
<salla-metadata entity="product" entity-id="123456"></salla-metadata>
```

## Properties [#properties]

| Property   | Attribute   | Description                                                                                                                                                                                                                                                                                          | Type                           | Default     |
| ---------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ----------- |
| `entity`   | `entity`    | The entity type to fetch custom-field values for. Defaults to `"product"`.                                                                                                                                                                                                                           | `string`                       | `'product'` |
| `entityId` | `entity-id` | The id of the entity (for a product, the product id) whose custom fields are fetched. Accepts a number, a string, or an array of numbers (a JSON string such as `"[1,2]"` is parsed into an array). If omitted on a single product page, the current page id is used; elsewhere nothing is rendered. | `number \| number[] \| string` |             |
