# Split symbols

> A winning symbol breaks into two or more copies, and its reel makes room for them.

Source: https://pixi-reels.schmooky.dev/mechanics/split-symbols/

When a symbol splits, the cell it stands on becomes two or more cells. The
server says what the symbol splits into. Pass that list to `splitSymbol` with
the symbol's reel and cell, and each id gets its own cell. The cells above and
below keep their symbols. Any symbol one reel wide can split, either a 1x1 or
a stacked big symbol in full view. The call returns the new cells, so the
game can animate them.

```ts
const { reelIndex, from, count } = reelSet.splitSymbol(reel, cell, ids, { height: 'grow' });
```

The `height` option sets what happens to the reel when it gains cells:

- `'grow'` is the default. The cells keep their size and the reel gets
  taller. The board re-anchors around it as the builder's `reelAnchor` says.
- `'keep'` keeps the reel's height, and every cell on it shrinks to share
  that height, as cells on a MultiWays reel do. Nothing else moves. This is
  the default on MultiWays, where a reel's height is fixed.

`resetColumns()` puts every reel back to the cells it was built with, at
their original size. Both calls are built on `setColumn`, which shows a
column of any length on one reel. The
[infinity reels page](/mechanics/infinity-reels/#stacked-symbols-that-split)
covers splits of stacked symbols on a board that grows.

## Demos

`splitSymbol()` places the cells of a split. The animation in these demos is each demo's own code. The first demo compares the two `height` modes, the second lets you split cells yourself, and the third splits on MultiWays.

## Grow or keep

Both boards land the same result and split the same cells, one copy at a time. On the left the reel grows. On the right the reel keeps its height and its cells shrink. The titles show each reel's cell count and height, read from the engine.

Under `'keep'` every symbol on the reel is resized, so its art has to draw at any cell height, as MultiWays art already does. These boards anchor their reels at the top with `reelAnchor('start')`, so a reel grows downward. With the default `'center'` a reel grows in both directions and the board re-centres.

Live demo (split-modes): https://pixi-reels.schmooky.dev/mechanics/split-symbols/#split-modes

## Tap a cell to split it

Tap any cell to split it in two, and the readout prints the call the tap made. Choose `grow` or `keep` above the board. Spin to start over, which calls `resetColumns()` first.

Live demo (split-tap): https://pixi-reels.schmooky.dev/mechanics/split-symbols/#split-tap

## Splits on MultiWays

On MultiWays a reel's height is fixed, so a split makes room inside the reel and the ways go up with the cell count. The server names the winning symbol and which of its cells split, into two or three copies each. `WinLines` draws the ways after every split.

The cell count stays within the set's `[minCells, maxCells]`, as it would after a `setShape()`. Raise `multiways({ maxCells })` to allow more splits. The next spin's `setShape()` reshapes every reel from the cell count its split left it with.

Live demo (split-in-place): https://pixi-reels.schmooky.dev/mechanics/split-symbols/#split-in-place

## Stacked symbols on infinity reels

The [infinity reels page](/mechanics/infinity-reels/#infinity-reels-split) has a demo where a stack two to four cells tall splits into more single symbols than it had cells. Its reel grows past the frame in both directions while `expand()` adds reels.

A reel that a block wider than one reel covers cannot change on its own, or the block's reels would no longer line up, so `splitSymbol()` and `setColumn()` throw there. Every demo on this page splits a symbol one reel wide.
