> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.knapsack.cloud/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.knapsack.cloud/_mcp/server.

# Using Multiple Prop Types

**Note:** This section assumes you've already read and understood the section in the [previous document](/code-sources/advanced-prop-configurations) around how to add and edit the "Prop Spec".

## Overview

A design system component's prop may need to accept multiple types to provide flexibility and accommodate various use cases. This section will cover the implementation and validation of props that can handle various data types, ensuring robust and adaptable components.

**For instance:**

* A "size" prop might accept different formats such as a string or number to cater to diverse design requirements.
  * A string value like "caption" could correspond to a predefined font size, ensuring quick and consistent styling across components.
  * A numeric value from 1 to 6 might offer more granular control over heading sizes.

By accepting multiple types, props become more versatile and enhance the adaptability of the design system to various design needs and developer preferences.

#### Step 1: Add new prop OR edit an existing

The first step in the process involves adding or editing an existing prop within the components spec.

#### Step 2: Click the "additional settings" arrow to further configure the prop

Clicking the "additional settings" arrow will allow for further configuration of prop types. If adding a new prop — use the "Custom" prop type.

#### Step 3: Update the prop spec definition to contain "anyOf"

From within the additional settings area, click "Prop Spec" and add an "anyOf" key like the below example:

```json
{
  "title": "label",
  "anyOf": [
    {
      "title": "String Options",
      "type": "string",
      "enum": [
        "emphasize",
        "caption",
        "body"
      ]
    },
    {
      "title": "Number Options",
      "type": "number",
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6,
        7
      ]
    }
  ],
  "description": "Use a string or a number from a set"
}
```

#### Step 4: Click the "Save Changes" button and begin using multiple prop types!

The last step is to save the changes. Click the blue "Save Changes" button and begin using multiple prop types.

***

## Conclusion

Pulling it all together we can now use multiple prop types 🎉

![Screenshot 2024-07-25 at 1.48.20 PM.png](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/knapsack-docs.docs.buildwithfern.com/87dc9f659cef927727cc056fed37687188859259568dca388de3721f93da6b5b/docs/assets/images/601eb399-screenshot-2024-07-25-at-14820-pm-eteahyi4qpng.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260724%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260724T211406Z&X-Amz-Expires=604800&X-Amz-Signature=95cef05bf5b212f51578e0d6bca210d0b6e267596570b62c955eeb5a3053affa&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

![Screenshot 2024-07-25 at 1.47.14 PM.png](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/knapsack-docs.docs.buildwithfern.com/59d1d532d439864b68bc8f212c3009872dc149b30df457802a6a2b863c0b6c8b/docs/assets/images/df0364cd-screenshot-2024-07-25-at-14714-pm-bpzwcgrijhpng.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260724%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260724T211406Z&X-Amz-Expires=604800&X-Amz-Signature=0ffa3ed51a8938ea2f8c81d112731af3a432a2c18f954955da303aa09da83878&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

![Screenshot 2024-07-25 at 1.47.23 PM.png](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/knapsack-docs.docs.buildwithfern.com/e7bcf62250b7482c35e11516090b7faa80c160fc3affcbdc42dd3d644091f33c/docs/assets/images/d9460b68-screenshot-2024-07-25-at-14723-pm-ihu7tf7o1ypng.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260724%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260724T211406Z&X-Amz-Expires=604800&X-Amz-Signature=a20cfa5506118e50625b1c15233bc1b31706f5856e6e73211e86d32ac4215168&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)