> 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/caf-sdk-pt-br/react-native/document-detector/ui-customizations.md).

# Personalizações da UI

Personalize a UI do Document Detector para React Native. Configure mensagens de captura, pré-visualização, upload, telas de tentativa novamente e textos de seleção de documento.

{% hint style="warning" %}
Este guia aborda **@caf.io/react-native-sdk 5.4.0** e acima (Certta DevX). Para o sequencial anterior `useCafSdk` fluxo, veja o [documentação legada](https://docs.caf.io/caf-sdk/react-native/getting-started-with-the-sdk).
{% endhint %}

O Certta Document Detector oferece suporte à personalização das mensagens no fluxo, telas de pré-visualização, diálogos de upload e texto de retry. Passe objetos de personalização em `CerttaDocumentDetectorConfiguration` ou `CerttaDocumentDetectorUIConfiguration` ao chamar `open()`.

## Mensagens de captura

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  messageCustomization: {
    title: 'Capture seu documento',
    subtitle: 'Posicione o documento dentro da moldura',
  },
});
```

## Tela de pré-visualização

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  showPreview: true,
  previewCustomization: {
    title: 'Revise sua foto',
    confirmButton: 'Usar esta foto',
    retakeButton: 'Tirar novamente',
  },
});
```

## Modo de upload

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  uploadSettings: {
    enable: true,
    fileFormats: [CafFileFormat.JPEG, CafFileFormat.PDF],
  },
  uploadCustomization: {
    title: 'Enviar documento',
    description: 'Selecione um arquivo do seu dispositivo',
  },
  uploadMessagesCustomization: {
    uploading: 'Enviando documento...',
    processing: 'Processando documento...',
  },
});
```

## Tela de nova tentativa

```typescript
await open({
  flow: [{ document: CafDocument.RG_FRONT }],
  maxRetryAttempts: 3,
  retryCustomization: {
    title: 'Tentar novamente',
    description: 'Não foi possível ler seu documento com clareza',
    retryButton: 'Repetir captura',
  },
});
```

## UI do Detector de Documentos — seleção e instruções

Use `useCafDocumentDetectorUI` para as telas integradas de seleção e instruções:

```typescript
await open({
  flow: [
    { document: CafDocument.RG_FRONT },
    { document: CafDocument.RG_BACK },
  ],
  instructionScreen: {
    title: 'Verificação de documento',
    description: 'Prepare seu documento de identidade antes de continuar',
  },
  documentSelectionScreen: {
    title: 'Escolha um documento',
    description: 'Selecione o tipo de documento que você deseja enviar',
  },
});
```

{% hint style="info" %}
Para a lista completa de campos de personalização, consulte os tipos TypeScript `CafDocumentDetectorMessageCustomization`, `CafDocumentDetectorPreviewCustomization`, `CafDocumentDetectorUploadCustomization`, `CafDocumentDetectorUploadMessagesCustomization`e `CafDocumentDetectorRetryCustomization` exportados de `@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/caf-sdk-pt-br/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.
