<!--
{
  "availability" : [
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabletopKit",
  "identifier" : "/documentation/TabletopKit/Tabletop",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "TabletopKit"
    ],
    "preciseIdentifier" : "s:11TabletopKit0A0P"
  },
  "title" : "Tabletop"
}
-->

# Tabletop

A protocol for the table surface in your game.

```
protocol Tabletop : Identifiable where Self.ID == EquipmentIdentifier
```

## Overview

To create a [`TableSetup`](/documentation/TabletopKit/TableSetup) object that configures your game table, pass an object that conforms to either the `Tabletop` or `EntityTabletop`` protocol to the `TableSetup`initializer. Implement your`Tabletop`structure to set the protocol properties, such as the`shape`and`id` properties.

```swift
struct Table: Tabletop {
    var shape = .rectangular(width: 100, height: 60, thickness: 5, in: .centimeters)
    var id = .table
}
```

To create a round table, use one of the [`TabletopShape`](/documentation/TabletopKit/TabletopShape) round initializers.

To render the table surface using RealityKit, conform to the [`EntityTabletop`](/documentation/TabletopKit/EntityTabletop) protocol instead.

## Topics

### Creating a round or rectangular table

[`var shape: TabletopShape`](/documentation/TabletopKit/Tabletop/shape)

The shape of the table.

### Displaying the equipment

[`func layoutChildren(for: TableSnapshot, visualState: TableVisualState) -> any EquipmentLayout`](/documentation/TabletopKit/Tabletop/layoutChildren(for:visualState:))

This function provides the layout of the direct children of this equipment and is called whenever the snapshot changes.
Override it to provide a custom layout.
The output of this function is considered to be only a function of its inputs. Reaching out to data outside what is provided might result in undefined behavior.

## Relationships

### Inherits From

[`Identifiable`](/documentation/Swift/Identifiable)

### Inherited By

[`EntityTabletop`](/documentation/TabletopKit/EntityTabletop)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)