> For the complete documentation index, see [llms.txt](https://jsf.gitbook.io/jsf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jsf.gitbook.io/jsf/schema/property-types/string.md).

# String

Represents JS primitive type `string`.

```javascript
{
    "type": "string"
}
```

#### Format

The `format` keyword allows for basic semantic validation on certain kinds of string values that are commonly used. This allows values to be constrained beyond what [Regular Expressions](https://json-schema.org/understanding-json-schema/reference/regular_expressions.html#regular-expressions) can do.

Possible values:

date, email, hostname, uri, uri-reference, ipv4, ipv6, mac, date-time, time, egex, color, credit-card, phone.&#x20;

```
{
  "$theme": "rounded/blue",
  "schema": {
    "type": "object",
    "properties": {
      "email": {
         "type": "string",
         "format": "email"
      }
    }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "email"
    }]
  }
}
```

#### Minimum Length

&#x20;The keyword for setting minimal length on string prop is `minLength`. The value of this keyword MUST be a non-negative integer.&#x20;

A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 \[RFC7159].

Omitting this keyword has the same behavior as a value of 0.

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "minLength": "5"
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Maximum Length

&#x20;The keyword for setting maximal length on string prop is `maxLength`. The value of this keyword MUST be a non-negative integer.&#x20;

A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 \[RFC7159].

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "maxLength": "5"
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Pattern

The keyword for setting pattern is `pattern`.

The value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "pattern": "[A-Z][1-9][a-z]"
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Secret

The keyword for setting secret is `secret`.

The value of this keyword MUST be a boolean - true or false.&#x20;

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "secret": true
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Multiline

The keyword for setting multiline is `multiline`.

The value of this keyword can be either boolean or number. Number value controls quantity of rows to be displayed.

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "multiline": 6
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```
