---
title: "Boxes2D"
---
<!-- DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/docs/website.rs -->

2D boxes with half-extents and optional center, colors etc.

## Fields
### Required
* `half_sizes`: [`HalfSize2D`](../components/half_size2d.md)

### Recommended
* `centers`: [`Position2D`](../components/position2d.md)
* `colors`: [`Color`](../components/color.md)

### Optional
* `radii`: [`Radius`](../components/radius.md)
* `labels`: [`Text`](../components/text.md)
* `show_labels`: [`ShowLabels`](../components/show_labels.md)
* `draw_order`: [`DrawOrder`](../components/draw_order.md)
* `class_ids`: [`ClassId`](../components/class_id.md)


## Can be shown in
* [Spatial2DView](../views/spatial2d_view.md)
* [Spatial3DView](../views/spatial3d_view.md) (if logged under a projection)
* [DataframeView](../views/dataframe_view.md)

## API reference links
 * 🌊 [C++ API docs for `Boxes2D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1Boxes2D.html)
 * 🐍 [Python API docs for `Boxes2D`](https://ref.rerun.io/docs/python/stable/common/archetypes#rerun.archetypes.Boxes2D)
 * 🦀 [Rust API docs for `Boxes2D`](https://docs.rs/rerun/latest/rerun/archetypes/struct.Boxes2D.html)

## Example

### Simple 2D boxes

snippet: archetypes/boxes2d_simple

<picture data-inline-viewer="snippets/archetypes/boxes2d_simple">
  <source media="(max-width: 480px)" srcset="https://static.rerun.io/box2d_simple/ac4424f3cf747382867649610cbd749c45b2020b/480w.png">
  <source media="(max-width: 768px)" srcset="https://static.rerun.io/box2d_simple/ac4424f3cf747382867649610cbd749c45b2020b/768w.png">
  <source media="(max-width: 1024px)" srcset="https://static.rerun.io/box2d_simple/ac4424f3cf747382867649610cbd749c45b2020b/1024w.png">
  <source media="(max-width: 1200px)" srcset="https://static.rerun.io/box2d_simple/ac4424f3cf747382867649610cbd749c45b2020b/1200w.png">
  <img src="https://static.rerun.io/box2d_simple/ac4424f3cf747382867649610cbd749c45b2020b/full.png">
</picture>

