# page.corvus.facets

> Published by [corvus.page](https://lexicon.garden/identity/did:plc:3qc4cbzcriye72qqqodeda26)

✓ This is the authoritative definition for this NSID.

## Description

A facet, facets are features that apply to a range of text, they're immutable. So changing a facet requires dropping the old facet and inserting a new one.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:3qc4cbzcriye72qqqodeda26/page.corvus.facets)
- [Documentation](https://lexicon.garden/lexicon/did:plc:3qc4cbzcriye72qqqodeda26/page.corvus.facets/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:3qc4cbzcriye72qqqodeda26/page.corvus.facets/examples)

## Definitions

### `page.corvus.facets#bold`

**Type**: `object`

A bold facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `page.corvus.facets#link`

**Type**: `object`

A link facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `url` | `string` (uri) | No | The URL of the linked resource |

### `page.corvus.facets`

**Type**: `object`

A facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `index` | `ref` → `#index` | Yes | The atom range this facet covers |
| `features` | `array` | No | The features applied to the facet |

### `page.corvus.facets#index`

**Type**: `object`

An atom range of a facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `atomEnd` | `string` | Yes | The end atom id of the facet (inclusive) - formatted as `operationId.atomIdx` |
| `atomStart` | `string` | Yes | The start atom id of the facet (inclusive) - formatted as `operationId.atomIdx` |

### `page.corvus.facets#italic`

**Type**: `object`

An italic facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `page.corvus.facets#mention`

**Type**: `object`

A mention facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | No | The did of the mentioned user |

### `page.corvus.facets#dateTime`

**Type**: `object`

A date/time facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `value` | `string` (datetime) | No | The date/time value |
| `dateOnly` | `boolean` | No | True if the time component should be ignored - defaults to false |

### `page.corvus.facets#highlight`

**Type**: `object`

A highlight facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `color` | `string` | No | The color of the highlight |

### `page.corvus.facets#underline`

**Type**: `object`

An underline facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|

### `page.corvus.facets#strikethrough`

**Type**: `object`

A strikethrough facet

| Property | Type | Required | Description |
|----------|------|----------|-------------|

## Raw Schema

```json
{
  "id": "page.corvus.facets",
  "defs": {
    "bold": {
      "type": "object",
      "properties": {},
      "description": "A bold facet"
    },
    "link": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The URL of the linked resource"
        }
      },
      "description": "A link facet"
    },
    "main": {
      "type": "object",
      "required": [
        "index"
      ],
      "properties": {
        "index": {
          "ref": "#index",
          "type": "ref",
          "description": "The atom range this facet covers"
        },
        "features": {
          "type": "array",
          "items": {
            "refs": [
              "#bold",
              "#italic",
              "#underline",
              "#strikethrough",
              "#link",
              "#highlight"
            ],
            "type": "union",
            "closed": false
          },
          "description": "The features applied to the facet"
        }
      },
      "description": "A facet"
    },
    "index": {
      "type": "object",
      "required": [
        "atomStart",
        "atomEnd"
      ],
      "properties": {
        "atomEnd": {
          "type": "string",
          "description": "The end atom id of the facet (inclusive) - formatted as `operationId.atomIdx`"
        },
        "atomStart": {
          "type": "string",
          "description": "The start atom id of the facet (inclusive) - formatted as `operationId.atomIdx`"
        }
      },
      "description": "An atom range of a facet"
    },
    "italic": {
      "type": "object",
      "properties": {},
      "description": "An italic facet"
    },
    "mention": {
      "type": "object",
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "The did of the mentioned user"
        }
      },
      "description": "A mention facet"
    },
    "dateTime": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "format": "datetime",
          "description": "The date/time value"
        },
        "dateOnly": {
          "type": "boolean",
          "default": false,
          "description": "True if the time component should be ignored - defaults to false"
        }
      },
      "description": "A date/time facet"
    },
    "highlight": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string",
          "description": "The color of the highlight"
        }
      },
      "description": "A highlight facet"
    },
    "underline": {
      "type": "object",
      "properties": {},
      "description": "An underline facet"
    },
    "strikethrough": {
      "type": "object",
      "properties": {},
      "description": "A strikethrough facet"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "A facet, facets are features that apply to a range of text, they're immutable. So changing a facet requires dropping the old facet and inserting a new one."
}
```
