> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stac.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# BoxFit

> Documentation for BoxFit

# BoxFit

The `fit` property supports the following values:

| Value       | Description                                                                         |
| ----------- | ----------------------------------------------------------------------------------- |
| `fill`      | Stretches the child to fill the box, distorting the aspect ratio if necessary.      |
| `contain`   | Scales the child to fit within the box while maintaining its aspect ratio.          |
| `cover`     | Scales the child to completely cover the box, possibly cropping parts of it.        |
| `fitWidth`  | Scales the child to match the width of the box, possibly overflowing vertically.    |
| `fitHeight` | Scales the child to match the height of the box, possibly overflowing horizontally. |
| `none`      | Positions the child without scaling, potentially allowing it to overflow the box.   |
| `scaleDown` | Scales the child down to fit within the box only if it is larger than the box.      |

## Example

<CodeGroup>
  ```dart Dart theme={null}
  StacFittedBox(fit: StacBoxFit.contain)
  ```

  ```json JSON theme={null}
  {
    "type": "fittedBox",
    "fit": "contain"
  }
  ```
</CodeGroup>
