# AttachmentRuntime
URL: /docs/api-reference/runtimes/attachment-runtime
Hooks for accessing attachment state in composer and messages.
`useAuiState` (Attachment State) \[#useauistate-attachment-state]
Access the current attachment state reactively:
```tsx
import { useAuiState } from "@assistant-ui/react";
const name = useAuiState((s) => s.attachment.name);
const type = useAuiState((s) => s.attachment.type);
```
For imperative access and actions, use `useAui`:
```tsx
import { useAui } from "@assistant-ui/react";
const aui = useAui();
aui.attachment().remove();
const state = aui.attachment().getState();
```
Attachment Runtime \[#attachment-runtime]
Attachment State \[#attachment-state]