> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components.md).

# Components

Widgets are based on a layout and this layout is built with **components**.

Components are any part of a widget you can customize. They are defined and created as a consequence of a widget creation.

The scope of components created is defined by `template_id`. You can find a summary of combinations below.

| Template                 | auth | dsar\_form | footer | header | preference | preference\_value | save | section | sections |
| ------------------------ | ---- | ---------- | ------ | ------ | ---------- | ----------------- | ---- | ------- | -------- |
| `sections`               | ✅    | ❌          | ❌      | ❌      | ✅          | ✅                 | ❌    | ✅       | ✅        |
| `sections_and_save`      | ✅    | ❌          | ❌      | ❌      | ✅          | ✅                 | ✅    | ✅       | ✅        |
| `full_preference_center` | ✅    | ❌          | ✅      | ✅      | ✅          | ✅                 | ✅    | ✅       | ✅        |
| `dsar_form`              | ❌    | ✅          | ❌      | ❌      | ❌          | ❌                 | ❌    | ❌       | ❌        |

Components available are following:

* [auth](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/auth.md)
* [dsar\_form](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/dsar_form.md)
* [footer](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/footer.md)
* [header](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/header.md)
* [preference](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/preference.md)
* [preference\_value](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/preference_value.md)
* [save](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/save.md)
* [section](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/section.md)
* [sections](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/sections.md)

Please be aware of the following exceptions.

* [auth](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/auth.md) component is not a `layout-component` and is editable at widget level.
* In addition of `options`, [sections](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/sections.md) `layout-component` provides a simplified configuration with `theme` property.
* Privacy request widgets benefit from design and UI content edition only in `layout-component` [dsar\_form](/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components/dsar_form.md). User rights content is not editable.

### Edit a **component**

To edit a layout-component, send a **PATCH** request on `/widgets/layout-components/{id}`.

{% hint style="warning" %}
Be careful when you are editing the `options` property. This is a JSONB and by design, you need to fill in every property already added every time you edit this object.
{% endhint %}

```json
PATCH https://api.didomi.io/widgets/layout-components/{id}?organization_id=YOUR_ORG_ID

{
    "type": "header || save || footer || section || preference || preference_value || dsar_form",
    "options": {},
    "organization_id": "YOUR_ORGANIZATION_ID"
}
```

### Edit multiple components

To edit multiple layout-components, send a **PATCH** request on `/widgets/layout-components`.

```json
PATCH https://api.didomi.io/widgets/preferences-centers/layout-components?organization_id=YOUR_ORG_ID

[
    {
        "id": "String",
        "type": "header || save || footer || section || preference || preference_value",
        "options": {},
        "organization_id": "YOUR_ORGANIZATION_ID"
    }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.didomi.io/api-and-platform/widgets/privacy-widgets/edit-a-widget/content-and-design/components.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
