---
title: "theme-aware"
description: "Blocks shown in light mode, and others in dark mode."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# theme-aware

## Where it sits

| Body | In the body | Inside its texts |
| --- | --- | --- |
| The store's home | Yes | Yes |
| A custom page | Yes | Yes |
| A product's page | Yes | Yes |
| An event's page | Yes | Yes |
| A portfolio's page | Yes | Yes |
| A lesson | Yes | Yes |
| An article | Yes | Yes |

A text holds it as a `<block type="theme-aware" props="…"></block>` element: its props are those below but `type`, which the element's own `type` names.

See [Bodies](/overview/blocks#bodies) for how a body holds its blocks.

It holds other blocks: each nested block is one of the types this reference lists that its body takes, as the whole block schema reads it.

## Props

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The block's id, unique within its body. |
| `type` | `"theme-aware"` | Yes | The block's type. |
| `light` | `array of block` | Yes | The blocks shown in light mode. |
| `dark` | `array of block` | Yes | The blocks shown in dark mode. |
| `hidden` | `boolean` | No | Whether the block is hidden: it, and every block it holds, doesn't show. |

## JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The block's id, unique within its body."
    },
    "type": {
      "type": "string",
      "const": "theme-aware",
      "description": "The block's type."
    },
    "light": {
      "type": "array",
      "items": {
        "$ref": "https://docs.sherpo.io/overview/blocks/schema.json"
      },
      "description": "The blocks shown in light mode."
    },
    "dark": {
      "type": "array",
      "items": {
        "$ref": "https://docs.sherpo.io/overview/blocks/schema.json"
      },
      "description": "The blocks shown in dark mode."
    },
    "hidden": {
      "type": "boolean",
      "description": "Whether the block is hidden: it, and every block it holds, doesn't show."
    }
  },
  "required": [
    "id",
    "type",
    "light",
    "dark"
  ],
  "description": "Blocks shown in light mode, and others in dark mode.",
  "additionalProperties": false
}
```

Source: https://docs.sherpo.io/overview/blocks/theme-aware/index.mdx
