> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Format to URL encoded

> Converts the context into a URL encoded string.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Takes a single piece of text and makes it safe to drop into a URL, encoding any characters that have a special meaning, such as spaces, ampersands, and slashes. Use this when you need to place a value inside a web address, for example a search term in a query string. It works on one text value at a time and has no settings. To encode a whole set of `key=value` pairs at once, use the form URL encoded formatter instead.

This documentation describes: [Schema](/schemas/serializer/url-encode)

## Sample data

Input:

```json theme={null}
"color=blue & size=large/medium"
```

Output:

```json theme={null}
"color%3Dblue+%26+size%3Dlarge%2Fmedium"
```

Each special character was replaced with its URL-safe code: spaces became `+`, `=` became `%3D`, `&` became `%26`, and `/` became `%2F`.

```json Configuration theme={null}
{
  "prototype": "url-encode",
  "parameters": {}
}
```
