---
title: "group"
description: "A node that is itself typed and also carries per-child overrides. `self` applies to that node and to every descendant without its own entry; each key in `children` overrides it from there down."
url: "https://pitlane.tools/package/theme/schema/function/group"
---

# group

```ts
import { group } from "@pitlane/theme/schema";
```

```ts
function group<self, children>(self, children): children & object;
```

A node that is itself typed and also carries per-child overrides. `self` applies to that node and to every descendant without its own entry; each key in `children` overrides it from there down.

The self schema rides on a symbol key, so no token name is reserved: a token named `default` can carry its own type.

## Type Parameters

### self

`self` _extends_ [`TokenSchema`](https://pitlane.tools/package/theme/schema/interface/TokenSchema.md)\<`SchemaTag`>

The schema for this node and its unlabelled descendants

### children

`children` _extends_ `Record`\<`string`, [`SchemaNode`](https://pitlane.tools/package/theme/schema/type/SchemaNode.md)>

Per-child schema overrides

## Parameters

### self

`self`

### children

`children`

## Returns

`children` \& `object`

A schema group

## Example

```ts
let schema = {
    control: s.group(s.dimension(), { color: s.color(), opacity: s.number() }),
};
// control.height.sm is a dimension; control.color.border is a color.
```
