# social.colibri.beta.richtext.facet

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.richtext.facet)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.richtext.facet/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.richtext.facet/examples)

## Definitions

### `social.colibri.beta.richtext.facet#bold`

**Type**: `object`

Bold text.

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

### `social.colibri.beta.richtext.facet#code`

**Type**: `object`

Inline code.

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

### `social.colibri.beta.richtext.facet#link`

**Type**: `object`

A hyperlink.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (uri) | Yes | Where the link points. |

### `social.colibri.beta.richtext.facet#list`

**Type**: `object`

A list item line.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ordered` | `boolean` | Yes | Whether the list is numbered. |

### `social.colibri.beta.richtext.facet`

**Type**: `object`

An annotation over a range of a message's text.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `index` | `ref` → `#byteSlice` | Yes | The range of the text this facet covers. |
| `features` | `array` | Yes | What the range means. A range may carry more than one feature. |

### `social.colibri.beta.richtext.facet#role`

**Type**: `object`

A role mention. Roles are only ever written by the community, and a channel space's authority is its community, so the role key alone is unambiguous.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `role` | `string` (record-key) | Yes | The mentioned role. |

### `social.colibri.beta.richtext.facet#time`

**Type**: `object`

A timestamp rendered in the reader's locale.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `style` | `string` | No | How to render it. |
| `datetime` | `string` (datetime) | Yes | The instant being referred to. |

### `social.colibri.beta.richtext.facet#quote`

**Type**: `object`

A block quote.

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

### `social.colibri.beta.richtext.facet#italic`

**Type**: `object`

Italic text.

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

### `social.colibri.beta.richtext.facet#channel`

**Type**: `object`

A channel reference, by the channel's space key within the same community.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `string` (record-key) | Yes | The referenced channel. |

### `social.colibri.beta.richtext.facet#heading`

**Type**: `object`

A heading line.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `level` | `integer` | Yes | Heading level, from 1 to 3. |

### `social.colibri.beta.richtext.facet#mention`

**Type**: `object`

A user mention.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | The mentioned user. |

### `social.colibri.beta.richtext.facet#spoiler`

**Type**: `object`

Text hidden until revealed.

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

### `social.colibri.beta.richtext.facet#subtext`

**Type**: `object`

Small, muted text.

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

### `social.colibri.beta.richtext.facet#byteSlice`

**Type**: `object`

The range a feature applies to, as zero-based byte offsets into the UTF-8 encoded text. Start is inclusive, end is exclusive.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `byteEnd` | `integer` | Yes | Byte after the range, exclusive. |
| `byteStart` | `integer` | Yes | First byte of the range, inclusive. |

### `social.colibri.beta.richtext.facet#codeblock`

**Type**: `object`

A multi-line code block.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `lang` | `string` | No | Language hint. |

### `social.colibri.beta.richtext.facet#underline`

**Type**: `object`

Underlined text.

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

### `social.colibri.beta.richtext.facet#strikethrough`

**Type**: `object`

Struck-through text.

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

## Raw Schema

```json
{
  "id": "social.colibri.beta.richtext.facet",
  "defs": {
    "bold": {
      "type": "object",
      "properties": {},
      "description": "Bold text."
    },
    "code": {
      "type": "object",
      "properties": {},
      "description": "Inline code."
    },
    "link": {
      "type": "object",
      "required": [
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "uri",
          "description": "Where the link points."
        }
      },
      "description": "A hyperlink."
    },
    "list": {
      "type": "object",
      "required": [
        "ordered"
      ],
      "properties": {
        "ordered": {
          "type": "boolean",
          "description": "Whether the list is numbered."
        }
      },
      "description": "A list item line."
    },
    "main": {
      "type": "object",
      "required": [
        "index",
        "features"
      ],
      "properties": {
        "index": {
          "ref": "#byteSlice",
          "type": "ref",
          "description": "The range of the text this facet covers."
        },
        "features": {
          "type": "array",
          "items": {
            "refs": [
              "#bold",
              "#italic",
              "#underline",
              "#strikethrough",
              "#code",
              "#codeblock",
              "#quote",
              "#heading",
              "#list",
              "#subtext",
              "#spoiler",
              "#mention",
              "#role",
              "#channel",
              "#link",
              "#time"
            ],
            "type": "union"
          },
          "description": "What the range means. A range may carry more than one feature."
        }
      },
      "description": "An annotation over a range of a message's text."
    },
    "role": {
      "type": "object",
      "required": [
        "role"
      ],
      "properties": {
        "role": {
          "type": "string",
          "format": "record-key",
          "description": "The mentioned role."
        }
      },
      "description": "A role mention. Roles are only ever written by the community, and a channel space's authority is its community, so the role key alone is unambiguous."
    },
    "time": {
      "type": "object",
      "required": [
        "datetime"
      ],
      "properties": {
        "style": {
          "type": "string",
          "description": "How to render it.",
          "knownValues": [
            "time-short",
            "time-long",
            "date-short",
            "date-long",
            "datetime-short",
            "datetime-long",
            "relative"
          ]
        },
        "datetime": {
          "type": "string",
          "format": "datetime",
          "description": "The instant being referred to."
        }
      },
      "description": "A timestamp rendered in the reader's locale."
    },
    "quote": {
      "type": "object",
      "properties": {},
      "description": "A block quote."
    },
    "italic": {
      "type": "object",
      "properties": {},
      "description": "Italic text."
    },
    "channel": {
      "type": "object",
      "required": [
        "channel"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "format": "record-key",
          "description": "The referenced channel."
        }
      },
      "description": "A channel reference, by the channel's space key within the same community."
    },
    "heading": {
      "type": "object",
      "required": [
        "level"
      ],
      "properties": {
        "level": {
          "type": "integer",
          "maximum": 3,
          "minimum": 1,
          "description": "Heading level, from 1 to 3."
        }
      },
      "description": "A heading line."
    },
    "mention": {
      "type": "object",
      "required": [
        "did"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "The mentioned user."
        }
      },
      "description": "A user mention."
    },
    "spoiler": {
      "type": "object",
      "properties": {},
      "description": "Text hidden until revealed."
    },
    "subtext": {
      "type": "object",
      "properties": {},
      "description": "Small, muted text."
    },
    "byteSlice": {
      "type": "object",
      "required": [
        "byteStart",
        "byteEnd"
      ],
      "properties": {
        "byteEnd": {
          "type": "integer",
          "minimum": 0,
          "description": "Byte after the range, exclusive."
        },
        "byteStart": {
          "type": "integer",
          "minimum": 0,
          "description": "First byte of the range, inclusive."
        }
      },
      "description": "The range a feature applies to, as zero-based byte offsets into the UTF-8 encoded text. Start is inclusive, end is exclusive."
    },
    "codeblock": {
      "type": "object",
      "properties": {
        "lang": {
          "type": "string",
          "maxLength": 32,
          "description": "Language hint."
        }
      },
      "description": "A multi-line code block."
    },
    "underline": {
      "type": "object",
      "properties": {},
      "description": "Underlined text."
    },
    "strikethrough": {
      "type": "object",
      "properties": {},
      "description": "Struck-through text."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
