# symbol

> This document is the Markdown version of [valibot.dev/api/symbol/](https://valibot.dev/api/symbol/). For the complete documentation index, see [llms.txt](https://valibot.dev/llms.txt).

Creates a symbol schema.

```ts
const Schema = v.symbol<TMessage>(message);
```

## Generics

- `TMessage` `extends ErrorMessage<SymbolIssue> | undefined`

## Parameters

- `message` `TMessage`

### Explanation

With `symbol` you can validate the data type of the input. If it is not a symbol, you can use `message` to customize the error message.

## Returns

- `Schema` `SymbolSchema<TMessage>`

## Examples

The following examples show how `symbol` can be used.

### Custom message

Symbol schema with a custom error message.

```ts
const schema = v.symbol('A symbol is required');
```

## Related

The following APIs can be combined with `symbol`.

### Schemas

[`array`](/api/array.md), [`exactOptional`](/api/exactOptional.md), [`intersect`](/api/intersect.md), [`lazy`](/api/lazy.md), [`looseObject`](/api/looseObject.md), [`looseTuple`](/api/looseTuple.md), [`map`](/api/map.md), [`nonNullable`](/api/nonNullable.md), [`nonNullish`](/api/nonNullish.md), [`nonOptional`](/api/nonOptional.md), [`nullable`](/api/nullable.md), [`nullish`](/api/nullish.md), [`object`](/api/object.md), [`objectWithRest`](/api/objectWithRest.md), [`optional`](/api/optional.md), [`record`](/api/record.md), [`set`](/api/set.md), [`strictObject`](/api/strictObject.md), [`strictTuple`](/api/strictTuple.md), [`tuple`](/api/tuple.md), [`tupleWithRest`](/api/tupleWithRest.md), [`undefinedable`](/api/undefinedable.md), [`union`](/api/union.md)

### Methods

[`assert`](/api/assert.md), [`config`](/api/config.md), [`fallback`](/api/fallback.md), [`getDefault`](/api/getDefault.md), [`getDefaults`](/api/getDefaults.md), [`getFallback`](/api/getFallback.md), [`getFallbacks`](/api/getFallbacks.md), [`is`](/api/is.md), [`message`](/api/message.md), [`parse`](/api/parse.md), [`parser`](/api/parser.md), [`pipe`](/api/pipe.md), [`safeParse`](/api/safeParse.md), [`safeParser`](/api/safeParser.md)

### Actions

[`check`](/api/check.md), [`brand`](/api/brand.md), [`description`](/api/description.md), [`flavor`](/api/flavor.md), [`guard`](/api/guard.md), [`metadata`](/api/metadata.md), [`rawCheck`](/api/rawCheck.md), [`rawTransform`](/api/rawTransform.md), [`readonly`](/api/readonly.md), [`title`](/api/title.md), [`transform`](/api/transform.md)

### Utils

[`entriesFromList`](/api/entriesFromList.md), [`isOfKind`](/api/isOfKind.md), [`isOfType`](/api/isOfType.md)
