---
title: "graphicStyle.addFromLibrary: Add to Graphic Styles — Vector kit command — Kition"
description: "Adds graphic styles from a library to the document, optionally applying the first to the selection."
canonical: "https://developer.kition.ai/docs/kits/vector/commands/graphicStyle.addFromLibrary"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/vector/commands/graphicStyle.addFromLibrary](https://developer.kition.ai/docs/kits/vector/commands/graphicStyle.addFromLibrary)

# graphicStyle.addFromLibrary

**Add to Graphic Styles.** Adds graphic styles from a library to the document, optionally applying the first to the selection.

- Kit: Vector 0.1.0 (.kvector); reference: [Vector kit commands](https://developer.kition.ai/docs/kits/vector.md)
- Changes the document: yes
- Acts on: `ids` (a list of ids), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `add` | `boolean` | no | with apply: add its appearance on top, as Alt-click |
| `apply` | `boolean` | no | also apply the first one to `ids` or the selection, if any, as graphicStyle.apply |
| `contents` | `any` | no | with apply, as graphicStyle.apply; one of several alternative parameters |
| `id` | `integer` | no | object ID |
| `ids` | `integer[]` | no | object IDs |
| `library` | `string` | no |  |
| `name` | `any[]` | no | [style names in the library] (default: all of it); default: all of it; one of several alternative parameters |
| `names` | `any[]` | no | [style names in the library] (default: all of it); default: all of it; one of several alternative parameters |
| `target` | `string` | no | like object; one of several alternative parameters |

## Call through vector_run

```text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "graphicStyle.addFromLibrary" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `add`, `apply`, `contents`, `id`, `ids`, `library`, `name`, `names`, `target`. vector_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "add": {
      "default": false,
      "description": "with apply: add its appearance on top, as Alt-click",
      "type": "boolean"
    },
    "apply": {
      "default": false,
      "description": "also apply the first one to `ids` or the selection, if any, as graphicStyle.apply",
      "type": "boolean"
    },
    "contents": {
      "description": "with apply, as graphicStyle.apply; one of several alternative parameters"
    },
    "id": {
      "description": "object ID",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "ids": {
      "description": "object IDs",
      "items": {
        "type": "integer"
      },
      "type": "array",
      "x-khp-types": [
        "Node"
      ]
    },
    "library": {
      "type": "string"
    },
    "name": {
      "description": "[style names in the library] (default: all of it); default: all of it; one of several alternative parameters",
      "items": {},
      "type": "array",
      "x-khp-name": "name",
      "x-khp-types": [
        "GraphicStyle"
      ]
    },
    "names": {
      "description": "[style names in the library] (default: all of it); default: all of it; one of several alternative parameters",
      "items": {},
      "type": "array",
      "x-khp-name": "name",
      "x-khp-types": [
        "GraphicStyle"
      ]
    },
    "target": {
      "description": "like object; one of several alternative parameters",
      "type": "string"
    }
  },
  "returns": "{library, added: [names in the document], existing: [names already there], applied?: name}",
  "type": "object"
}
```

Generated from the command list of @kition/vector-darwin-arm64@0.1.0 and the kit itself (vector_commands through @kition/cli@0.1.1, built from KitionAI/kition-vector@7cf908f).
