[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › minSize

```ts
function minSize<Min extends number>(
  min: ValidateBrandFactoryCount<Min>,
): BrandFactory<`MinSize${Min}`, ValueWithSize, MinSizeError<Min>>;
```

Defined in: [packages/common/src/Type.ts:14663](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L14663)

Minimum-size [Brand](https://evolu.dev/docs/api-reference/common/Brand/interfaces/Brand) for values whose `size` is at least `min`.

Applies to [set](https://evolu.dev/docs/api-reference/common/Type/functions/set) and [map](https://evolu.dev/docs/api-reference/common/Type/functions/map) Outputs, whose size counts elements or
entries, and to a Blob or File from [instanceOf](https://evolu.dev/docs/api-reference/common/Type/functions/instanceOf), whose size counts
bytes. Use [minLength](https://evolu.dev/docs/api-reference/common/Type/functions/minLength) for strings and arrays. For an exact size,
combine `minSize` with [maxSize](https://evolu.dev/docs/api-reference/common/Type/functions/maxSize).

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  minSize,
  set,
  String,
} from "@evolu/common";

const Tags = minSize(1)(set(String));
const tags = new Set(["local-first"]);

assertOk(Tags.fromUnknown(tags), tags);

const empty = new Set<string>();
const invalid = Tags.fromUnknown(empty);
assertErr(invalid, { type: "MinSize1", value: empty, min: 1 });
assertEqual(
  Tags.formatError(invalid.error),
  "The size 0 does not meet the minimum size of 1.",
);
```