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

# Rotation

> A utility widget that provides smooth rotation animations with physics-based spring transitions. Perfect for loading indicators, refresh buttons, and interactive elements.

## Examples

<CodeGroup>
  ```dart Loading Spinner lines focus={1-3, 7-8} theme={null}
  NeoRotation(
    isRotating: isLoading.value, // Using hooks
    child: PhosphorIcon(
      PhosphorIconsRegular.spinner,
      color: theme.colors.fgBrand,
      size: 24,
    ),
  ),
  ```

  ```dart Refresh Button lines focus={1-3, 9-10} theme={null}
  NeoRotation(
    isRotating: isRefreshing.value, // Using hooks
    child: NeoButton(
      variant: .ghost,
      icon: PhosphorIconsRegular.arrowsClockwise,
      onPressed: () {
        // Handle refresh
      },
    ),
  ),
  ```
</CodeGroup>

## Properties

### Required

<ParamField path="isRotating" type="bool" required>
  Controls whether the rotation animation is active. When `true`, the child rotates continuously. When `false`, rotation stops with a smooth spring animation to the nearest complete rotation.
</ParamField>

<ParamField path="child" type="Widget" required>
  The widget to apply rotation animation to. This can be any widget including Icons, Containers, or complex widget trees.
</ParamField>

## Animation Behavior

### Continuous Rotation

When `isRotating` is `true`, the widget rotates continuously at a steady pace (360° per second).

### Spring Stop Animation

When `isRotating` changes from `true` to `false`, the rotation doesn't stop abruptly. Instead, it uses a physics-based spring animation to smoothly decelerate to the nearest complete rotation (0°, 90°, 180°, or 270°).

## Best Practices

* Can be combined nicely with loading indicators like `PhosphorIcons.spinner`, `PhosphorIcons.circleNotch`, `PhosphorIcons.arrowsClockwise` etc

## Integration Notes

* Works seamlessly with any widget, including complex widget trees
* The widget handles smooth transitions when `isRotating` state changes rapidly
