# ing.opn.richtext.facet

> Formatting over part of a text, as Bluesky's facets do: a byte range and what applies to it.

- Kind: object
- Authority: richtext.opn.ing
- Lexicon: 1
- Published by [opn.ing](https://lexicon.garden/identity/did:plc:fd7yovynbzbli5i7m6tu76cl), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:fd7yovynbzbli5i7m6tu76cl/ing.opn.richtext.facet)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:fd7yovynbzbli5i7m6tu76cl/ing.opn.richtext.facet/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:fd7yovynbzbli5i7m6tu76cl/ing.opn.richtext.facet/analytics)

## Object (`ing.opn.richtext.facet`)

Type: object

### Properties

- `features` (array, required)
  - `items` (union)
    - One of: `#bold`, `#italic`, `#link`, `#mention`
- `index` (ref, required)
  - Reference: `#byteSlice`

## #bold (`ing.opn.richtext.facet#bold`)

Type: object

Bold text.

### Properties


## #byteSlice (`ing.opn.richtext.facet#byteSlice`)

Type: object

A range of the text by UTF-8 byte offset: the start inclusive, the end exclusive.

### Properties

- `byteEnd` (integer, required)
  - Constraints: minimum: 0
- `byteStart` (integer, required)
  - Constraints: minimum: 0

## #italic (`ing.opn.richtext.facet#italic`)

Type: object

Italic text.

### Properties


## #link (`ing.opn.richtext.facet#link`)

Type: object

A link.

### Properties

- `uri` (string · uri, required)

## #mention (`ing.opn.richtext.facet#mention`)

Type: object

A mention of an account, by its DID.

### Properties

- `did` (string · did, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "bold": {
      "description": "Bold text.",
      "properties": {},
      "type": "object"
    },
    "byteSlice": {
      "description": "A range of the text by UTF-8 byte offset: the start inclusive, the end exclusive.",
      "properties": {
        "byteEnd": {
          "minimum": 0,
          "type": "integer"
        },
        "byteStart": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "byteStart",
        "byteEnd"
      ],
      "type": "object"
    },
    "italic": {
      "description": "Italic text.",
      "properties": {},
      "type": "object"
    },
    "link": {
      "description": "A link.",
      "properties": {
        "uri": {
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "uri"
      ],
      "type": "object"
    },
    "main": {
      "description": "Formatting over part of a text, as Bluesky's facets do: a byte range and what applies to it.",
      "properties": {
        "features": {
          "items": {
            "refs": [
              "#bold",
              "#italic",
              "#link",
              "#mention"
            ],
            "type": "union"
          },
          "type": "array"
        },
        "index": {
          "ref": "#byteSlice",
          "type": "ref"
        }
      },
      "required": [
        "index",
        "features"
      ],
      "type": "object"
    },
    "mention": {
      "description": "A mention of an account, by its DID.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    }
  },
  "id": "ing.opn.richtext.facet",
  "lexicon": 1
}
```
