# JSFrameworkTextSplitter

> **Class** in `langchain_text_splitters`

📖 [View in docs](https://reference.langchain.com/python/langchain-text-splitters/jsx/JSFrameworkTextSplitter)

Text splitter that handles React (JSX), Vue, and Svelte code.

This splitter extends `RecursiveCharacterTextSplitter` to handle React (JSX), Vue,
and Svelte code by:

1. Detecting and extracting custom component tags from the text
2. Using those tags as additional separators along with standard JS syntax

The splitter combines:

* Custom component tags as separators (e.g. `<Component`, `<div`)
* JavaScript syntax elements (function, const, if, etc)
* Standard text splitting on newlines

This allows chunks to break at natural boundaries in React, Vue, and Svelte
component code.

## Signature

```python
JSFrameworkTextSplitter(
    self,
    separators: list[str] | None = None,
    chunk_size: int = 2000,
    chunk_overlap: int = 0,
    **kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `separators` | `list[str] \| None` | No | Optional list of custom separator strings to use (default: `None`) |
| `chunk_size` | `int` | No | Maximum size of chunks to return (default: `2000`) |
| `chunk_overlap` | `int` | No | Overlap in characters between chunks (default: `0`) |
| `**kwargs` | `Any` | No | Additional arguments to pass to parent class (default: `{}`) |

## Extends

- `RecursiveCharacterTextSplitter`

## Constructors

```python
__init__(
    self,
    separators: list[str] | None = None,
    chunk_size: int = 2000,
    chunk_overlap: int = 0,
    **kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `separators` | `list[str] \| None` |
| `chunk_size` | `int` |
| `chunk_overlap` | `int` |


## Methods

- [`split_text()`](https://reference.langchain.com/python/langchain-text-splitters/jsx/JSFrameworkTextSplitter/split_text)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/fb6ab993a73180538f6cca876b3c85d46c08845f/libs/text-splitters/langchain_text_splitters/jsx.py#L9)