> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-sdk/react-native/document-detector/ui-customizations.md).

# UI Customizations

Customize Document Detector UI for React Native. Configure capture messages, preview, upload, retry screens, and document selection copy.

{% hint style="warning" %}
This guide covers **@caf.io/react-native-sdk 5.4.0** and above (Certta DevX). For the previous sequential `useCafSdk` flow, see the [legacy documentation](https://docs.caf.io/caf-sdk/react-native/getting-started-with-the-sdk).
{% endhint %}

Certta Document Detector supports customizing in-flow messages, preview screens, upload dialogs, and retry copy. Pass customization objects on `CerttaDocumentDetectorConfiguration` or `CerttaDocumentDetectorUIConfiguration` when calling `open()`.

## Capture messages

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  messageCustomization: {
    title: 'Capture your document',
    subtitle: 'Fit the document inside the frame',
  },
});
```

## Preview screen

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  showPreview: true,
  previewCustomization: {
    title: 'Review your photo',
    confirmButton: 'Use this photo',
    retakeButton: 'Take again',
  },
});
```

## Upload mode

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  uploadSettings: {
    enable: true,
    fileFormats: [CafFileFormat.JPEG, CafFileFormat.PDF],
  },
  uploadCustomization: {
    title: 'Upload document',
    description: 'Select a file from your device',
  },
  uploadMessagesCustomization: {
    uploading: 'Sending document...',
    processing: 'Processing document...',
  },
});
```

## Retry screen

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  maxRetryAttempts: 3,
  retryCustomization: {
    title: 'Try again',
    description: 'We could not read your document clearly',
    retryButton: 'Retry capture',
  },
});
```

## Document Detector UI — selection and instructions

Use `useCafDocumentDetectorUI` for the built-in picker and instruction screens:

```typescript
await open({
  flow: [
    { document: CafDocument.RG_FRONT },
    { document: CafDocument.RG_BACK },
  ],
  instructionScreen: {
    title: 'Document verification',
    description: 'Prepare your ID document before continuing',
  },
  documentSelectionScreen: {
    title: 'Choose a document',
    description: 'Select the document type you want to submit',
  },
});
```

{% hint style="info" %}
For the full list of customization fields, see the TypeScript types `CafDocumentDetectorMessageCustomization`, `CafDocumentDetectorPreviewCustomization`, `CafDocumentDetectorUploadCustomization`, `CafDocumentDetectorUploadMessagesCustomization`, and `CafDocumentDetectorRetryCustomization` exported from `@caf.io/react-native-sdk`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.caf.io/caf-sdk/react-native/document-detector/ui-customizations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
