Showing preview only (3,636K chars total). Download the full file or copy to clipboard to get everything.
Repository: reflex-dev/reflex
Branch: main
Commit: 7ee3026b8884
Files: 488
Total size: 3.4 MB
Directory structure:
gitextract_r7dp3u9n/
├── .devcontainer/
│ └── devcontainer.json
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── build_issue.md
│ │ ├── cloud_issue.md
│ │ ├── custom_component_request.md
│ │ ├── enhancement_request.md
│ │ ├── enterprise_issue.md
│ │ └── feature_request.md
│ ├── actions/
│ │ └── setup_build_env/
│ │ └── action.yml
│ ├── codeql-config.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── check_node_latest.yml
│ ├── check_outdated_dependencies.yml
│ ├── codeql.yml
│ ├── dependency-review.yml
│ ├── integration_app_harness.yml
│ ├── integration_tests.yml
│ ├── performance.yml
│ ├── pre-commit.yml
│ ├── publish.yml
│ ├── reflex_init_in_docker_test.yml
│ └── unit_tests.yml
├── .gitignore
├── .python-version
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── MCP_README.md
├── README.md
├── SECURITY.md
├── docker-example/
│ ├── README.md
│ ├── production-app-platform/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ └── README.md
│ ├── production-compose/
│ │ ├── .dockerignore
│ │ ├── Caddy.Dockerfile
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── compose.prod.yaml
│ │ ├── compose.tools.yaml
│ │ └── compose.yaml
│ ├── production-one-port/
│ │ ├── .dockerignore
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ └── README.md
│ ├── simple-one-port/
│ │ ├── .dockerignore
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ └── README.md
│ └── simple-two-port/
│ ├── .dockerignore
│ ├── Dockerfile
│ └── README.md
├── docs/
│ ├── DEBUGGING.md
│ ├── de/
│ │ └── README.md
│ ├── es/
│ │ └── README.md
│ ├── in/
│ │ └── README.md
│ ├── it/
│ │ └── README.md
│ ├── ja/
│ │ └── README.md
│ ├── kr/
│ │ └── README.md
│ ├── pe/
│ │ └── README.md
│ ├── pt/
│ │ └── pt_br/
│ │ └── README.md
│ ├── tr/
│ │ └── README.md
│ ├── vi/
│ │ └── README.md
│ └── zh/
│ ├── zh_cn/
│ │ └── README.md
│ └── zh_tw/
│ └── README.md
├── pyi_hashes.json
├── pyproject.toml
├── reflex/
│ ├── .templates/
│ │ ├── apps/
│ │ │ └── blank/
│ │ │ └── code/
│ │ │ ├── __init__.py
│ │ │ └── blank.py
│ │ └── web/
│ │ ├── .gitignore
│ │ ├── app/
│ │ │ ├── entry.client.js
│ │ │ └── routes.js
│ │ ├── components/
│ │ │ ├── reflex/
│ │ │ │ └── radix_themes_color_mode_provider.js
│ │ │ └── shiki/
│ │ │ └── code.js
│ │ ├── jsconfig.json
│ │ ├── postcss.config.js
│ │ ├── react-router.config.js
│ │ ├── styles/
│ │ │ └── __reflex_style_reset.css
│ │ ├── utils/
│ │ │ ├── helpers/
│ │ │ │ ├── dataeditor.js
│ │ │ │ ├── debounce.js
│ │ │ │ ├── paste.js
│ │ │ │ ├── range.js
│ │ │ │ ├── throttle.js
│ │ │ │ └── upload.js
│ │ │ ├── react-theme.js
│ │ │ └── state.js
│ │ └── vite-plugin-safari-cachebust.js
│ ├── __init__.py
│ ├── __main__.py
│ ├── admin.py
│ ├── app.py
│ ├── app_mixins/
│ │ ├── __init__.py
│ │ ├── lifespan.py
│ │ ├── middleware.py
│ │ └── mixin.py
│ ├── assets.py
│ ├── base.py
│ ├── compiler/
│ │ ├── __init__.py
│ │ ├── compiler.py
│ │ ├── templates.py
│ │ └── utils.py
│ ├── components/
│ │ ├── __init__.py
│ │ ├── base/
│ │ │ ├── __init__.py
│ │ │ ├── app_wrap.py
│ │ │ ├── bare.py
│ │ │ ├── body.py
│ │ │ ├── document.py
│ │ │ ├── error_boundary.py
│ │ │ ├── fragment.py
│ │ │ ├── link.py
│ │ │ ├── meta.py
│ │ │ ├── script.py
│ │ │ └── strict_mode.py
│ │ ├── component.py
│ │ ├── core/
│ │ │ ├── __init__.py
│ │ │ ├── auto_scroll.py
│ │ │ ├── banner.py
│ │ │ ├── breakpoints.py
│ │ │ ├── clipboard.py
│ │ │ ├── colors.py
│ │ │ ├── cond.py
│ │ │ ├── debounce.py
│ │ │ ├── foreach.py
│ │ │ ├── helmet.py
│ │ │ ├── html.py
│ │ │ ├── layout/
│ │ │ │ └── __init__.py
│ │ │ ├── match.py
│ │ │ ├── responsive.py
│ │ │ ├── sticky.py
│ │ │ ├── upload.py
│ │ │ └── window_events.py
│ │ ├── datadisplay/
│ │ │ ├── __init__.py
│ │ │ ├── code.py
│ │ │ ├── dataeditor.py
│ │ │ ├── logo.py
│ │ │ └── shiki_code_block.py
│ │ ├── dynamic.py
│ │ ├── el/
│ │ │ ├── __init__.py
│ │ │ ├── element.py
│ │ │ └── elements/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── forms.py
│ │ │ ├── inline.py
│ │ │ ├── media.py
│ │ │ ├── metadata.py
│ │ │ ├── other.py
│ │ │ ├── scripts.py
│ │ │ ├── sectioning.py
│ │ │ ├── tables.py
│ │ │ └── typography.py
│ │ ├── field.py
│ │ ├── gridjs/
│ │ │ ├── __init__.py
│ │ │ └── datatable.py
│ │ ├── literals.py
│ │ ├── lucide/
│ │ │ ├── __init__.py
│ │ │ └── icon.py
│ │ ├── markdown/
│ │ │ ├── __init__.py
│ │ │ └── markdown.py
│ │ ├── moment/
│ │ │ ├── __init__.py
│ │ │ └── moment.py
│ │ ├── plotly/
│ │ │ ├── __init__.py
│ │ │ └── plotly.py
│ │ ├── props.py
│ │ ├── radix/
│ │ │ ├── __init__.py
│ │ │ ├── primitives/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── accordion.py
│ │ │ │ ├── base.py
│ │ │ │ ├── dialog.py
│ │ │ │ ├── drawer.py
│ │ │ │ ├── form.py
│ │ │ │ ├── progress.py
│ │ │ │ └── slider.py
│ │ │ └── themes/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── color_mode.py
│ │ │ ├── components/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── alert_dialog.py
│ │ │ │ ├── aspect_ratio.py
│ │ │ │ ├── avatar.py
│ │ │ │ ├── badge.py
│ │ │ │ ├── button.py
│ │ │ │ ├── callout.py
│ │ │ │ ├── card.py
│ │ │ │ ├── checkbox.py
│ │ │ │ ├── checkbox_cards.py
│ │ │ │ ├── checkbox_group.py
│ │ │ │ ├── context_menu.py
│ │ │ │ ├── data_list.py
│ │ │ │ ├── dialog.py
│ │ │ │ ├── dropdown_menu.py
│ │ │ │ ├── hover_card.py
│ │ │ │ ├── icon_button.py
│ │ │ │ ├── inset.py
│ │ │ │ ├── popover.py
│ │ │ │ ├── progress.py
│ │ │ │ ├── radio.py
│ │ │ │ ├── radio_cards.py
│ │ │ │ ├── radio_group.py
│ │ │ │ ├── scroll_area.py
│ │ │ │ ├── segmented_control.py
│ │ │ │ ├── select.py
│ │ │ │ ├── separator.py
│ │ │ │ ├── skeleton.py
│ │ │ │ ├── slider.py
│ │ │ │ ├── spinner.py
│ │ │ │ ├── switch.py
│ │ │ │ ├── table.py
│ │ │ │ ├── tabs.py
│ │ │ │ ├── text_area.py
│ │ │ │ ├── text_field.py
│ │ │ │ └── tooltip.py
│ │ │ ├── layout/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base.py
│ │ │ │ ├── box.py
│ │ │ │ ├── center.py
│ │ │ │ ├── container.py
│ │ │ │ ├── flex.py
│ │ │ │ ├── grid.py
│ │ │ │ ├── list.py
│ │ │ │ ├── section.py
│ │ │ │ ├── spacer.py
│ │ │ │ └── stack.py
│ │ │ └── typography/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── blockquote.py
│ │ │ ├── code.py
│ │ │ ├── heading.py
│ │ │ ├── link.py
│ │ │ └── text.py
│ │ ├── react_player/
│ │ │ ├── __init__.py
│ │ │ ├── audio.py
│ │ │ ├── react_player.py
│ │ │ └── video.py
│ │ ├── react_router/
│ │ │ ├── __init__.py
│ │ │ └── dom.py
│ │ ├── recharts/
│ │ │ ├── __init__.py
│ │ │ ├── cartesian.py
│ │ │ ├── charts.py
│ │ │ ├── general.py
│ │ │ ├── polar.py
│ │ │ └── recharts.py
│ │ ├── sonner/
│ │ │ ├── __init__.py
│ │ │ └── toast.py
│ │ └── tags/
│ │ ├── __init__.py
│ │ ├── cond_tag.py
│ │ ├── iter_tag.py
│ │ ├── match_tag.py
│ │ ├── tag.py
│ │ └── tagless.py
│ ├── config.py
│ ├── constants/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── colors.py
│ │ ├── compiler.py
│ │ ├── config.py
│ │ ├── custom_components.py
│ │ ├── event.py
│ │ ├── installer.py
│ │ ├── route.py
│ │ ├── state.py
│ │ └── utils.py
│ ├── custom_components/
│ │ ├── __init__.py
│ │ └── custom_components.py
│ ├── environment.py
│ ├── event.py
│ ├── experimental/
│ │ ├── __init__.py
│ │ ├── client_state.py
│ │ └── hooks.py
│ ├── istate/
│ │ ├── __init__.py
│ │ ├── data.py
│ │ ├── dynamic.py
│ │ ├── manager/
│ │ │ ├── __init__.py
│ │ │ ├── disk.py
│ │ │ ├── memory.py
│ │ │ └── redis.py
│ │ ├── proxy.py
│ │ ├── shared.py
│ │ ├── storage.py
│ │ └── wrappers.py
│ ├── middleware/
│ │ ├── __init__.py
│ │ ├── hydrate_middleware.py
│ │ └── middleware.py
│ ├── model.py
│ ├── page.py
│ ├── plugins/
│ │ ├── __init__.py
│ │ ├── _screenshot.py
│ │ ├── base.py
│ │ ├── shared_tailwind.py
│ │ ├── sitemap.py
│ │ ├── tailwind_v3.py
│ │ └── tailwind_v4.py
│ ├── py.typed
│ ├── reflex.py
│ ├── route.py
│ ├── state.py
│ ├── style.py
│ ├── testing.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── build.py
│ │ ├── codespaces.py
│ │ ├── compat.py
│ │ ├── console.py
│ │ ├── decorator.py
│ │ ├── exceptions.py
│ │ ├── exec.py
│ │ ├── export.py
│ │ ├── format.py
│ │ ├── frontend_skeleton.py
│ │ ├── imports.py
│ │ ├── js_runtimes.py
│ │ ├── lazy_loader.py
│ │ ├── misc.py
│ │ ├── monitoring.py
│ │ ├── net.py
│ │ ├── path_ops.py
│ │ ├── prerequisites.py
│ │ ├── processes.py
│ │ ├── pyi_generator.py
│ │ ├── redir.py
│ │ ├── registry.py
│ │ ├── rename.py
│ │ ├── serializers.py
│ │ ├── tasks.py
│ │ ├── telemetry.py
│ │ ├── templates.py
│ │ ├── token_manager.py
│ │ └── types.py
│ └── vars/
│ ├── __init__.py
│ ├── base.py
│ ├── color.py
│ ├── datetime.py
│ ├── dep_tracking.py
│ ├── function.py
│ ├── number.py
│ ├── object.py
│ └── sequence.py
├── scripts/
│ ├── __init__.py
│ ├── bun_install.sh
│ ├── darglint_test.bat
│ ├── hatch_build.py
│ ├── install.ps1
│ ├── integration.sh
│ ├── make_pyi.py
│ └── wait_for_listening_port.py
└── tests/
├── __init__.py
├── benchmarks/
│ ├── __init__.py
│ ├── conftest.py
│ ├── fixtures.py
│ ├── test_compilation.py
│ └── test_evaluate.py
├── integration/
│ ├── __init__.py
│ ├── conftest.py
│ ├── init-test/
│ │ ├── Dockerfile
│ │ └── in_docker_test_script.sh
│ ├── shared/
│ │ └── state.py
│ ├── test_background_task.py
│ ├── test_call_script.py
│ ├── test_client_storage.py
│ ├── test_component_state.py
│ ├── test_computed_vars.py
│ ├── test_connection_banner.py
│ ├── test_deploy_url.py
│ ├── test_dynamic_components.py
│ ├── test_dynamic_routes.py
│ ├── test_event_actions.py
│ ├── test_event_chain.py
│ ├── test_exception_handlers.py
│ ├── test_extra_overlay_function.py
│ ├── test_form_submit.py
│ ├── test_icon.py
│ ├── test_input.py
│ ├── test_large_state.py
│ ├── test_lifespan.py
│ ├── test_linked_state.py
│ ├── test_login_flow.py
│ ├── test_media.py
│ ├── test_memo.py
│ ├── test_navigation.py
│ ├── test_server_side_event.py
│ ├── test_shared_state.py
│ ├── test_state_inheritance.py
│ ├── test_tailwind.py
│ ├── test_upload.py
│ ├── test_urls.py
│ ├── test_var_operations.py
│ ├── tests_playwright/
│ │ ├── test_appearance.py
│ │ ├── test_datetime_operations.py
│ │ ├── test_link_hover.py
│ │ ├── test_stateless_app.py
│ │ └── test_table.py
│ └── utils.py
├── test_node_version.py
└── units/
├── __init__.py
├── assets/
│ ├── custom_script.js
│ └── test_assets.py
├── compiler/
│ ├── __init__.py
│ ├── test_compiler.py
│ └── test_compiler_utils.py
├── components/
│ ├── __init__.py
│ ├── base/
│ │ ├── test_bare.py
│ │ ├── test_link.py
│ │ └── test_script.py
│ ├── core/
│ │ ├── __init__.py
│ │ ├── test_banner.py
│ │ ├── test_colors.py
│ │ ├── test_cond.py
│ │ ├── test_debounce.py
│ │ ├── test_foreach.py
│ │ ├── test_html.py
│ │ ├── test_match.py
│ │ ├── test_responsive.py
│ │ └── test_upload.py
│ ├── datadisplay/
│ │ ├── __init__.py
│ │ ├── conftest.py
│ │ ├── test_code.py
│ │ ├── test_dataeditor.py
│ │ ├── test_datatable.py
│ │ └── test_shiki_code.py
│ ├── el/
│ │ └── test_svg.py
│ ├── forms/
│ │ ├── __init__.py
│ │ └── test_form.py
│ ├── graphing/
│ │ ├── __init__.py
│ │ ├── test_plotly.py
│ │ └── test_recharts.py
│ ├── layout/
│ │ └── __init__.py
│ ├── lucide/
│ │ └── test_icon.py
│ ├── markdown/
│ │ ├── __init__.py
│ │ └── test_markdown.py
│ ├── media/
│ │ ├── __init__.py
│ │ └── test_image.py
│ ├── radix/
│ │ ├── test_icon_button.py
│ │ └── test_layout.py
│ ├── recharts/
│ │ ├── test_cartesian.py
│ │ └── test_polar.py
│ ├── test_component.py
│ ├── test_component_future_annotations.py
│ ├── test_component_state.py
│ ├── test_props.py
│ ├── test_tag.py
│ └── typography/
│ ├── __init__.py
│ └── test_markdown.py
├── conftest.py
├── istate/
│ ├── __init__.py
│ ├── manager/
│ │ ├── __init__.py
│ │ └── test_redis.py
│ └── test_proxy.py
├── middleware/
│ ├── __init__.py
│ ├── conftest.py
│ └── test_hydrate_middleware.py
├── mock_redis.py
├── plugins/
│ └── test_sitemap.py
├── states/
│ ├── __init__.py
│ ├── mutation.py
│ └── upload.py
├── test_app.py
├── test_attribute_access_type.py
├── test_base.py
├── test_config.py
├── test_db_config.py
├── test_environment.py
├── test_event.py
├── test_health_endpoint.py
├── test_model.py
├── test_page.py
├── test_prerequisites.py
├── test_route.py
├── test_sqlalchemy.py
├── test_state.py
├── test_state_tree.py
├── test_style.py
├── test_telemetry.py
├── test_testing.py
├── test_var.py
├── utils/
│ ├── __init__.py
│ ├── test_format.py
│ ├── test_imports.py
│ ├── test_processes.py
│ ├── test_serializers.py
│ ├── test_tasks.py
│ ├── test_token_manager.py
│ ├── test_types.py
│ └── test_utils.py
└── vars/
├── test_base.py
├── test_dep_tracking.py
├── test_dep_tracking_integration.py
└── test_object.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .devcontainer/devcontainer.json
================================================
{
"image": "mcr.microsoft.com/devcontainers/python:3.14-trixie",
"postCreateCommand": "/bin/bash -c 'python -m pip install uv && python -m uv sync & git clone https://github.com/reflex-dev/reflex-examples; wait'",
"forwardPorts": [3000, 8000],
"portsAttributes": {
"3000": {
"label": "Frontend",
"onAutoForward": "notify"
},
"8000": {
"label": "Backend"
}
}
}
================================================
FILE: .github/CODEOWNERS
================================================
@reflex-dev/reflex-team
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ""
assignees: ""
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
- Code/Link to Repo:
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Specifics (please complete the following information):**
- Python Version:
- Reflex Version:
- OS:
- Browser (Optional):
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/build_issue.md
================================================
---
name: Build Issue
about: Report an issue related to reflex.build
title: "[BUILD] " # This acts as a hint, but users can change it.
labels: build
assignees: ""
---
## Describe the issue
Provide details about the issue.
...
## Expected behavior
What should have happened?
...
## Steps to reproduce (if applicable)
1.
2.
3.
## Environment
- Reflex Version:
- Python Version:
- OS:
- Browser:
================================================
FILE: .github/ISSUE_TEMPLATE/cloud_issue.md
================================================
---
name: Cloud Issue
about: Report an issue related to Reflex Cloud
title: "[CLOUD] " # This acts as a hint, but users can change it.
labels: cloud
assignees: ""
---
## Describe the issue
Provide details about the issue.
...
## Expected behavior
What should have happened?
...
## Steps to reproduce (if applicable)
1.
2.
3.
## Environment
- Reflex Version:
- Python Version:
- OS:
- Browser:
================================================
FILE: .github/ISSUE_TEMPLATE/custom_component_request.md
================================================
---
name: Custom Component Request
about: Suggest a new custom component for Reflex
title: ""
labels: "custom component request"
assignees: ""
---
**Describe the Custom Component**
A clear and concise description of what the custom component does.
- What is the purpose of the custom component?
- What is the expected behavior of the custom component?
- What are the use cases for the custom component?
**Specifics (please complete the following information):**
- Do you have a specific react package in mind? (Optional):
**Additional context**
Add any other context about the custom component here.
================================================
FILE: .github/ISSUE_TEMPLATE/enhancement_request.md
================================================
---
name: Enhancement Request
about: Suggest an enhancement for an existing Reflex feature.
title: ""
labels: "enhancement"
assignees: ""
---
**Describe the Enhancement you want**
A clear and concise description of what the improvement does.
- Which feature do you want to improve? (and what problem does it have)
- What is the benefit of the enhancement?
- Show an example/usecase were the improvement are needed.
**Additional context**
Add any other context here.
================================================
FILE: .github/ISSUE_TEMPLATE/enterprise_issue.md
================================================
---
name: Enterprise Issue
about: Report an issue related to Reflex Enterprise
title: "[ENTERPRISE] " # This acts as a hint, but users can change it.
labels: enterprise
assignees: ""
---
## Describe the issue
Provide details about the issue.
...
## Expected behavior
What should have happened?
...
## Steps to reproduce (if applicable)
1.
2.
3.
## Environment
- Reflex Version:
- Python Version:
- OS:
- Browser:
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature Request
about: Suggest a new feature for Reflex
title: ""
labels: "feature request"
assignees: ""
---
**Describe the Features**
A clear and concise description of what the features does.
- What is the purpose of the feature?
- Show an example / use cases for the new feature.
**Additional context**
Add any other context here.
================================================
FILE: .github/actions/setup_build_env/action.yml
================================================
# Entry conditions:
# - `setup/checkout` has already happened
# - working dir is the root directory of your project (e.g. `reflex/`).
# - You have a `uv.lock` file in the root directory of your project
# - You have a `pyproject.toml` file in the root directory of your project
#
# Exit conditions:
# - Python of version `python-version` is ready to be invoked as `python`.
# - If `run-uv-sync` is true, deps as defined in `pyproject.toml` will have been installed into the venv at `create-venv-at-path`.
name: "Setup Reflex build environment"
description: "Sets up Python, install uv (cached), install project deps (cached)"
inputs:
python-version:
description: "Python version setup"
required: true
run-uv-sync:
description: "Whether to run uv sync on current dir"
required: false
default: false
create-venv-at-path:
description: "Path to venv (if uv sync is enabled)"
required: false
default: ".venv"
runs:
using: "composite"
steps:
- name: Install UV
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ inputs.python-version }}
enable-cache: true
prune-cache: false
activate-environment: true
cache-dependency-glob: "uv.lock"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
if: inputs.run-uv-sync == 'true'
run: uv sync
shell: bash
================================================
FILE: .github/codeql-config.yml
================================================
paths:
- .github
- reflex
- reflex/.templates
paths-ignore:
- "**/tests/**"
================================================
FILE: .github/pull_request_template.md
================================================
### All Submissions:
- [ ] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) file?
- [ ] Have you checked to ensure there aren't any other open [Pull Requests](https://github.com/reflex-dev/reflex/pulls) for the desired changed?
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
### New Feature Submission:
- [ ] Does your submission pass the tests?
- [ ] Have you linted your code locally prior to submission?
### Changes To Core Features:
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your core changes, as applicable?
- [ ] Have you successfully ran tests with your changes locally?
### **After** these steps, you're ready to open a pull request.
a. Give a descriptive title to your PR.
b. Describe your changes.
c. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).
================================================
FILE: .github/workflows/check_node_latest.yml
================================================
name: integration-node-latest
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
REFLEX_TELEMETRY_ENABLED: false
jobs:
check_latest_node:
runs-on: ubuntu-22.04
strategy:
matrix:
split_index: [1, 2]
node-version: ["node"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: 3.13
run-uv-sync: true
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: uv run playwright install --with-deps
- run: |
uv run pytest tests/test_node_version.py -v
uv run pytest tests/integration --splits 2 -v --group ${{matrix.split_index}}
================================================
FILE: .github/workflows/check_outdated_dependencies.yml
================================================
name: check-outdated-dependencies
permissions:
contents: read
on:
push: # This will trigger the action when a pull request is opened or updated.
branches:
- "release/**" # This will trigger the action when any branch starting with "release/" is created.
workflow_dispatch: # Allow manual triggering if needed.
jobs:
backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: ./.github/actions/setup_build_env
with:
python-version: 3.13
run-uv-sync: true
- name: Check outdated backend dependencies
run: |
outdated=$(uv pip list --outdated)
echo "Outdated:"
echo "$outdated"
filtered_outdated=$(echo "$outdated" | grep -vE 'pyright|ruff' || true)
if [ ! -z "$filtered_outdated" ]; then
echo "Outdated dependencies found:"
echo "$filtered_outdated"
exit 1
else
echo "All dependencies are up to date. (pyright and ruff are ignored)"
fi
frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: 3.13
run-uv-sync: true
- name: Clone Reflex Website Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-web
ref: main
path: reflex-web
- name: Compile pyproject.toml into requirements.txt
working-directory: ./reflex-web
run: |
uv pip compile pyproject.toml --no-annotate --no-header --no-deps --output-file requirements.txt
grep -ivE "reflex " requirements.txt > requirements.txt.tmp && mv requirements.txt.tmp requirements.txt
- name: Install Requirements for reflex-web
working-directory: ./reflex-web
run: uv pip install -r requirements.txt
- name: Init Website for reflex-web
working-directory: ./reflex-web
run: uv run reflex init
- name: Run Website and Check for errors
run: |
uv run bash scripts/integration.sh ./reflex-web dev
- name: Check outdated frontend dependencies
working-directory: ./reflex-web/.web
run: |
raw_outdated=$(/home/runner/.local/share/reflex/bun/bin/bun outdated)
outdated=$(echo "$raw_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\|' || true)
echo "Outdated:"
echo "$outdated"
# Ignore 3rd party dependencies that are not updated.
filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|ag-grid' || true)
no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true)
if [ ! -z "$no_extra" ]; then
echo "Outdated dependencies found:"
echo "$filtered_outdated"
exit 1
else
echo "All dependencies are up to date. (3rd party packages are ignored)"
fi
================================================
FILE: .github/workflows/codeql.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "36 7 * * 4"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: actions
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
config-file: .github/codeql-config.yml
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
================================================
FILE: .github/workflows/dependency-review.yml
================================================
name: "Dependency Review"
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Dependency Review"
uses: actions/dependency-review-action@v4
with:
allow-licenses: Apache-2.0, BSD-2-Clause, BSD-3-Clause, HPND, ISC, MIT, MPL-2.0, Unlicense, Python-2.0, Python-2.0.1, Apache-2.0 AND MIT, BSD-2-Clause AND BSD-3-Clause, Apache-2.0 AND BSD-3-Clause
allow-dependencies-licenses: "pkg:pypi/lazy-loader"
================================================
FILE: .github/workflows/integration_app_harness.yml
================================================
name: integration-app-harness
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
on:
push:
branches: ["main"]
paths-ignore:
- "**/*.md"
pull_request:
branches: ["main"]
paths-ignore:
- "**/*.md"
env:
APP_HARNESS_HEADLESS: 1
PYTHONUNBUFFERED: 1
permissions:
contents: read
jobs:
integration-app-harness:
timeout-minutes: 30
strategy:
matrix:
state_manager: ["redis", "memory"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
split_index: [1, 2]
fail-fast: false
runs-on: ubuntu-22.04
services:
# Label used to access the service container
redis:
image: ${{ matrix.state_manager == 'redis' && 'redis' || '' }}
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Install playwright
run: uv run playwright install chromium --only-shell
- name: Run app harness tests
env:
REFLEX_REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }}
run: uv run pytest tests/integration --reruns 3 -v --maxfail=5 --splits 2 --group ${{matrix.split_index}}
================================================
FILE: .github/workflows/integration_tests.yml
================================================
name: integration-tests
on:
push:
branches: ["main"]
paths-ignore:
- "**/*.md"
pull_request:
branches: ["main"]
paths-ignore:
- "**/*.md"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash
env:
# Windows CI would fail without this.
# Ref: https://gist.github.com/NodeJSmith/e7e37f2d3f162456869f015f842bcf15
# TODO: can we fix windows encoding natively within reflex? Bug above can hit real users too (less common, but possible)
# - Catch encoding errors when printing logs
# - Best effort print lines that contain illegal chars (map to some default char, etc.)
PYTHONIOENCODING: "utf8"
REFLEX_TELEMETRY_ENABLED: false
NODE_OPTIONS: "--max_old_space_size=8192"
PR_TITLE: ${{ github.event.pull_request.title }}
jobs:
example-counter-and-nba-proxy:
env:
OUTPUT_FILE: import_benchmark.json
timeout-minutes: 30
strategy:
# Prioritize getting more information out of the workflow (even if something fails)
fail-fast: false
matrix:
# Show OS combos first in GUI
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Clone Reflex Examples Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-examples
path: reflex-examples
- name: Install requirements for counter example
working-directory: ./reflex-examples/counter
run: |
uv pip install -r requirements.txt
- name: Check export --backend-only before init for counter example
working-directory: ./reflex-examples/counter
run: |
uv run reflex export --backend-only
- name: Check run --backend-only before init for counter example
run: |
uv run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
- name: Init Website for counter example
working-directory: ./reflex-examples/counter
run: |
uv run reflex init --loglevel debug
- name: Check export for counter example
working-directory: ./reflex-examples/counter
run: |
uv run reflex export
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run bash scripts/integration.sh ./reflex-examples/counter dev
- name: Install requirements for nba proxy example
working-directory: ./reflex-examples/nba-proxy
run: |
uv pip install -r requirements.txt
- name: Check export --backend-only before init for nba-proxy example
working-directory: ./reflex-examples/nba-proxy
run: |
uv run reflex export --backend-only
- name: Init Website for nba-proxy example
working-directory: ./reflex-examples/nba-proxy
run: |
uv run reflex init --loglevel debug
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run bash scripts/integration.sh ./reflex-examples/nba-proxy dev
reflex-web:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
env:
REFLEX_WEB_WINDOWS_OVERRIDE: "1"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Clone Reflex Website Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-web
ref: main
path: reflex-web
submodules: recursive
- name: Compile pyproject.toml into requirements.txt
working-directory: ./reflex-web
run: |
uv pip compile pyproject.toml --no-annotate --no-header --no-deps --output-file requirements.txt
grep -ivE "reflex " requirements.txt > requirements.txt.tmp && mv requirements.txt.tmp requirements.txt
- name: Install Requirements for reflex-web
working-directory: ./reflex-web
run: uv pip install -r requirements.txt
- name: Init Website for reflex-web
working-directory: ./reflex-web
run: uv run --active --no-sync reflex init
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run --active --no-sync bash scripts/integration.sh ./reflex-web prod
rx-shout-from-template:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: 3.14
run-uv-sync: true
- name: Create app directory
run: mkdir rx-shout-from-template
- name: Init reflex-web from template
run: uv run reflex init --template https://github.com/masenf/rx_shout
working-directory: ./rx-shout-from-template
- name: ignore reflex pin in requirements
run: sed -i -e '/reflex==/d' requirements.txt
working-directory: ./rx-shout-from-template
- name: Install additional dependencies
run: uv pip install -r requirements.txt
working-directory: ./rx-shout-from-template
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run bash scripts/integration.sh ./rx-shout-from-template prod
reflex-web-macos:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
# Note: py311 version chosen due to available arm64 darwin builds.
python-version: ["3.11", "3.12"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Clone Reflex Website Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-web
ref: main
path: reflex-web
submodules: recursive
- name: Compile pyproject.toml into requirements.txt
working-directory: ./reflex-web
run: |
uv pip compile pyproject.toml --no-annotate --no-header --no-deps --output-file requirements.txt
grep -ivE "reflex " requirements.txt > requirements.txt.tmp && mv requirements.txt.tmp requirements.txt
- name: Install Requirements for reflex-web
working-directory: ./reflex-web
run: uv pip install -r requirements.txt
- name: Init Website for reflex-web
working-directory: ./reflex-web
run: uv run --active --no-sync reflex init
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run --active --no-sync bash scripts/integration.sh ./reflex-web prod
================================================
FILE: .github/workflows/performance.yml
================================================
name: performance-tests
permissions:
contents: read
on:
push:
branches:
- "main" # or "master"
paths-ignore:
- "**/*.md"
pull_request:
workflow_dispatch:
env:
REFLEX_TELEMETRY_ENABLED: false
NODE_OPTIONS: "--max_old_space_size=8192"
PR_TITLE: ${{ github.event.pull_request.title }}
APP_HARNESS_HEADLESS: 1
PYTHONUNBUFFERED: 1
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: instrumentation
run: uv run pytest -v tests/benchmarks --codspeed
================================================
FILE: .github/workflows/pre-commit.yml
================================================
name: pre-commit
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
on:
pull_request:
branches: ["main"]
push:
# Note even though this job is called "pre-commit" and runs "pre-commit", this job will run
# also POST-commit on main also! In case there are mishandled merge conflicts / bad auto-resolves
# when merging into main branch.
branches: ["main"]
jobs:
pre-commit:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: 3.14
run-uv-sync: true
- uses: actions/checkout@v4
with:
clean: false
- run: uv run pre-commit run --all-files --show-diff-on-failure
================================================
FILE: .github/workflows/publish.yml
================================================
name: Publish to PyPI
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build
run: uv build
- name: Verify .pyi files in wheel
run: |
if unzip -l dist/*.whl | grep '\.pyi$'; then
echo "✓ .pyi files found in distribution"
else
echo "Error: No .pyi files found in wheel"
exit 1
fi
- name: Publish
run: uv publish
================================================
FILE: .github/workflows/reflex_init_in_docker_test.yml
================================================
name: reflex-init-in-docker-test
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
on:
push:
branches: ["main"]
paths-ignore:
- "**/*.md"
pull_request:
branches: ["main"]
paths-ignore:
- "**/*.md"
jobs:
# TODO we can extend to various starting points (e.g. Ubuntu with node, without node, with unzip, without unzip, etc.)
# Currently starting point is: Ubuntu + unzip, xz-utils, Python suite. No node.
reflex-install-and-init:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- shell: bash
run: |
# Run reflex init in a docker container
# cwd is repo root
docker build -f tests/integration/init-test/Dockerfile -t reflex-init-test tests/integration/init-test
docker run --rm -v $(pwd):/reflex-repo/ reflex-init-test /reflex-repo/tests/integration/init-test/in_docker_test_script.sh
================================================
FILE: .github/workflows/unit_tests.yml
================================================
name: unit-tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
on:
push:
branches: ["main"]
paths-ignore:
- "**/*.md"
pull_request:
branches: ["main"]
paths-ignore:
- "**/*.md"
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
unit-tests:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.os }}
# Service containers to run with `runner-job`
services:
# Label used to access the service container
redis:
image: ${{ matrix.os == 'ubuntu-latest' && 'redis' || '' }}
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Run unit tests
run: |
export PYTHONUNBUFFERED=1
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
- name: Run unit tests w/ redis
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
export PYTHONUNBUFFERED=1
export REFLEX_REDIS_URL=redis://localhost:6379
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
- name: Run unit tests w/ redis and OPLOCK_ENABLED
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
export PYTHONUNBUFFERED=1
export REFLEX_REDIS_URL=redis://localhost:6379
export REFLEX_OPLOCK_ENABLED=true
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
# Change to explicitly install v1 when reflex-hosting-cli is compatible with v2
- name: Run unit tests w/ pydantic v1
run: |
export PYTHONUNBUFFERED=1
uv pip install "pydantic~=1.10"
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
- name: Generate coverage report
run: uv run coverage html
unit-tests-macos:
timeout-minutes: 30
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Run unit tests
run: |
export PYTHONUNBUFFERED=1
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
- name: Run unit tests w/ pydantic v1
run: |
export PYTHONUNBUFFERED=1
uv pip install "pydantic~=1.10"
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
================================================
FILE: .gitignore
================================================
**/.DS_Store
**/*.pyc
assets/external/*
dist/*
examples/
.web
.states
.idea
.vscode
.coverage
.coverage.*
.venv
venv
requirements.txt
.pyi_generator_last_run
.pyi_generator_diff
reflex.db
.codspeed
.env
.env.*
node_modules
package-lock.json
*.pyi
.pre-commit-config.yaml
================================================
FILE: .python-version
================================================
3.14
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
opensource@reflex.dev.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community as well as any sort of private interaction with the people.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: CONTRIBUTING.md
================================================
# Reflex Contributing Guidelines
For an extensive guide on the different ways to contribute to Reflex see our [Contributing Guide on Notion](https://www.notion.so/reflex-dev/2107ab2bc166497db951b8d742748284?v=f0eaff78fa984b5ab15d204af58907d7).
## Running a Local Build of Reflex
Here is a quick guide on how to run Reflex repo locally so you can start contributing to the project.
**Prerequisites:**
- uv version >= 0.6.0 and add it to your path (see [UV Docs](https://docs.astral.sh/uv/getting-started/installation/) for more info).
**1. Fork this repository:**
Fork this repository by clicking on the `Fork` button on the top right.
**2. Clone Reflex and navigate into the repo:**
```bash
git clone https://github.com/<YOUR-USERNAME>/reflex.git
cd reflex
```
**3. Install your local Reflex build:**
```bash
uv sync
```
**4. Now create an examples folder so you can test the local Python build in this repository.**
- We have the `examples` folder in the `.gitignore`, so your changes in `reflex/examples` won't be reflected in your commit.
```bash
mkdir examples
cd examples
```
**5. Init and Run**
```bash
uv run reflex init
uv run reflex run
```
All the changes you make to the repository will be reflected in your running app.
- We have the examples folder in the .gitignore, so your changes in reflex/examples won't be reflected in your commit.
## 🧪 Testing and QA
Any feature or significant change added should be accompanied with unit tests.
Within the 'test' directory of Reflex you can add to a test file already there or create a new test python file if it doesn't fit into the existing layout.
#### What to unit test?
- Any feature or significant change that has been added.
- Any edge cases or potential problem areas.
- Any interactions between different parts of the code.
## ✅ Making a PR
Once you solve a current issue or improvement to Reflex, you can make a PR, and we will review the changes.
Before submitting, a pull request, ensure the following steps are taken and test passing.
In your `reflex` directory run make sure all the unit tests are still passing using the following command.
This will fail if code coverage is below 70%.
```bash
uv run pytest tests/units --cov --no-cov-on-fail --cov-report=
```
Next make sure all the following tests pass. This ensures that every new change has proper documentation and type checking.
```bash
uv run ruff check .
uv run pyright reflex tests
find reflex tests -name "*.py" -not -path reflex/reflex.py | xargs uv run darglint
```
Finally, run `ruff` to format your code.
```bash
uv run ruff format .
```
Consider installing git pre-commit hooks so Ruff, Pyright, Darglint and `make_pyi` will run automatically before each commit.
```bash
uv run pre-commit install
```
That's it you can now submit your PR. Thanks for contributing to Reflex!
## Editing Templates
To edit the templates in Reflex you can do so in two way.
Change to the basic `blank` template can be done in the `reflex/.templates/apps/blank` directory.
Others templates can be edited in their own repository. For example the `sidebar` template can be found in the [`reflex-sidebar`](https://github.com/reflex-dev/sidebar-template) repository.
## Other Notes
For some pull requests when adding new components you will have to generate a pyi file for the new component. This is done by running the following command in the `reflex` directory.
(Please check in with the team before adding a new component to Reflex we are cautious about adding new components to Reflex's core.)
```bash
uv run python -m reflex.utils.pyi_generator
```
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/LICENSE-2.0
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2023, Pynecone, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: MCP_README.md
================================================
# Reflex MCP Server
The Reflex MCP Server provides comprehensive access to Reflex framework documentation and component information through the Model Context Protocol (MCP). This server is deployed and ready to use with your MCP-compatible AI tools.
Check the documentation at https://reflex.dev/docs/ai-builder/integrations/mcp-overview
================================================
FILE: README.md
================================================
<div align="center">
<img src="https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
[](https://x.com/getreflex)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
> [!NOTE]
> 🚀 **Try [Reflex Build](https://build.reflex.dev/)** – our AI-powered app builder that generates full-stack Reflex applications in seconds.
---
# Introduction
Reflex is a library to build full-stack web apps in pure Python.
Key features:
- **Pure Python** - Write your app's frontend and backend all in Python, no need to learn Javascript.
- **Full Flexibility** - Reflex is easy to get started with, but can also scale to complex apps.
- **Deploy Instantly** - After building, deploy your app with a [single command](https://reflex.dev/docs/hosting/deploy-quick-start/) or host it on your own server.
See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) to learn how Reflex works under the hood.
## ⚙️ Installation
**Important:** We strongly recommend using a virtual environment to ensure the `reflex` command is available in your PATH.
## 🥳 Create your first app
### 1. Create the project directory
Replace `my_app_name` with your project name:
```bash
mkdir my_app_name
cd my_app_name
```
### 2. Set up a virtual environment
Create and activate virtual environment
```bash
# On Windows:
python -m venv .venv
.venv\Scripts\activate
# On macOS/Linux:
python3 -m venv .venv
source .venv/bin/activate
```
### 3. Install Reflex
Reflex is available as a pip package (Requires Python 3.10+):
```bash
pip install reflex
```
### 4. Initialize the project
This command initializes a template app in your new directory:
```bash
reflex init
```
### 5. Run the app
You can run this app in development mode:
```bash
reflex run
```
You should see your app running at http://localhost:3000.
Now you can modify the source code in `my_app_name/my_app_name.py`. Reflex has fast refreshes so you can see your changes instantly when you save your code.
### Troubleshooting
If you installed Reflex without a virtual environment and the `reflex` command is not found, you can run commands using: `python3 -m reflex init` and `python3 -m reflex run`
## 🫧 Example App
Let's go over an example: creating an image generation UI around [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). For simplicity, we just call the [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), but you could replace this with an ML model run locally.
<div align="center">
<img src="https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/dalle.gif" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="550" />
</div>
Here is the complete code to create this. This is all done in one Python file!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Let's break this down.
<div align="center">
<img src="https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/dalle_colored_code_example.png" alt="Explaining the differences between backend and frontend parts of the DALL-E app." width="900" />
</div>
### **Reflex UI**
Let's start with the UI.
```python
def index():
return rx.center(
...
)
```
This `index` function defines the frontend of the app.
We use different components such as `center`, `vstack`, `input`, and `button` to build the frontend. Components can be nested within each other
to create complex layouts. And you can use keyword args to style them with the full power of CSS.
Reflex comes with [60+ built-in components](https://reflex.dev/docs/library) to help you get started. We are actively adding more components, and it's easy to [create your own components](https://reflex.dev/docs/wrapping-react/overview/).
### **State**
Reflex represents your UI as a function of your state.
```python
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
```
The state defines all the variables (called vars) in an app that can change and the functions that change them.
Here the state is comprised of a `prompt` and `image_url`. There are also the booleans `processing` and `complete` to indicate when to disable the button (during image generation) and when to show the resulting image.
### **Event Handlers**
```python
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Within the state, we define functions called event handlers that change the state vars. Event handlers are the way that we can modify the state in Reflex. They can be called in response to user actions, such as clicking a button or typing in a text box. These actions are called events.
Our DALL·E app has an event handler, `get_image` which gets this image from the OpenAI API. Using `yield` in the middle of an event handler will cause the UI to update. Otherwise the UI will update at the end of the event handler.
### **Routing**
Finally, we define our app.
```python
app = rx.App()
```
We add a page from the root of the app to the index component. We also add a title that will show up in the page preview/browser tab.
```python
app.add_page(index, title="DALL-E")
```
You can create a multi-page app by adding more pages.
## 📑 Resources
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Component Library](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Status
Reflex launched in December 2022 with the name Pynecone.
🚀 Introducing [Reflex Build](https://build.reflex.dev/) — Our AI-Powered Builder
Reflex Build uses AI to generate complete full-stack Python applications. It helps you quickly create, customize, and refine your Reflex apps — from frontend components to backend logic — so you can focus on your ideas instead of boilerplate code. Whether you’re prototyping or scaling, Reflex Build accelerates development by intelligently scaffolding and optimizing your app’s entire stack.
Alongside this, [Reflex Cloud](https://cloud.reflex.dev) launched in 2025 to offer the best hosting experience for your Reflex apps. We’re continuously improving the platform with new features and capabilities.
Reflex has new releases and features coming every week! Make sure to :star: star and :eyes: watch this repository to stay up to date.
## Contributing
We welcome contributions of any size! Below are some good ways to get started in the Reflex community.
- **Join Our Discord**: Our [Discord](https://discord.gg/T5WSbC2YtQ) is the best place to get help on your Reflex project and to discuss how you can contribute.
- **GitHub Discussions**: A great way to talk about features you want added or things that are confusing/need clarification.
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) are an excellent way to report bugs. Additionally, you can try and solve an existing issue and submit a PR.
We are actively looking for contributors, no matter your skill level or experience. To contribute check out [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)
## All Thanks To Our Contributors:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## License
Reflex is open-source and licensed under the [Apache License 2.0](https://raw.githubusercontent.com/reflex-dev/reflex/main/LICENSE).
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
| Version | Supported |
| -------- | ------------------ |
| >= 0.7.0 | :white_check_mark: |
## Reporting a Vulnerability
Please report any security vulnerabilities by using: https://github.com/reflex-dev/reflex/security/advisories/new
================================================
FILE: docker-example/README.md
================================================
# Reflex Docker Examples
This directory contains several examples of how to deploy Reflex apps using docker.
In all cases, ensure that your `requirements.txt` file is up to date and
includes the `reflex` package.
## `simple-two-port`
The most basic production deployment exposes two HTTP ports and relies on an
existing load balancer to forward the traffic appropriately.
## `simple-one-port`
This deployment exports the frontend statically and serves it via a single HTTP
port using Caddy. This is useful for platforms that only support a single port
or where running a node server in the container is undesirable.
## `production-compose`
This deployment is intended for use with a standalone VPS that is only hosting a
single Reflex app. It provides the entire stack in a single `compose.yaml`
including a webserver, one or more backend instances, redis, and a postgres
database.
## `production-app-platform`
This example deployment is intended for use with App hosting platforms, like
Azure, AWS, or Google Cloud Run. It is the backend of the deployment, which
depends on a separately hosted redis instance and static frontend deployment.
================================================
FILE: docker-example/production-app-platform/.dockerignore
================================================
.web
.git
__pycache__/*
Dockerfile
uploaded_files
================================================
FILE: docker-example/production-app-platform/Dockerfile
================================================
# This docker file is intended to be used with container hosting services
#
# After deploying this image, get the URL pointing to the backend service
# and run API_URL=https://path-to-my-container.example.com reflex export frontend
# then copy the contents of `frontend.zip` to your static file server (github pages, s3, etc).
#
# Azure Static Web App example:
# npx @azure/static-web-apps-cli deploy --env production --app-location .web/build/client
#
# For dynamic routes to function properly, ensure that 404s are redirected to /404 on the
# static file host (for github pages, this works out of the box; remember to create .nojekyll).
#
# For azure static web apps, add `staticwebapp.config.json` to to `.web/build/client` with the following:
# {
# "responseOverrides": {
# "404": {
# "rewrite": "/404.html"
# }
# }
# }
#
# Note: many container hosting platforms require amd64 images, so when building on an M1 Mac
# for example, pass `docker build --platform=linux/amd64 ...`
# Stage 1: init
FROM python:3.13 as init
ARG uv=/root/.local/bin/uv
# Install `uv` for faster package bootstrapping
ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
RUN /install.sh && rm /install.sh
# Copy local context to `/app` inside container (see .dockerignore)
WORKDIR /app
COPY . .
RUN mkdir -p /app/data /app/uploaded_files
# Create virtualenv which will be copied into final container
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN $uv venv
# Install app requirements and reflex inside virtualenv
RUN $uv pip install -r requirements.txt
# Deploy templates and prepare app
RUN reflex init
# Stage 2: copy artifacts into slim image
FROM python:3.13-slim
WORKDIR /app
RUN adduser --disabled-password --home /app reflex
COPY --chown=reflex --from=init /app /app
# Install libpq-dev for psycopg (skip if not using postgres).
RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*
USER reflex
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
# Needed until Reflex properly passes SIGTERM on backend.
STOPSIGNAL SIGKILL
# Always apply migrations before starting the backend.
CMD [ -d alembic ] && reflex db migrate; \
exec reflex run --env prod --backend-only --backend-port ${PORT:-8000}
================================================
FILE: docker-example/production-app-platform/README.md
================================================
# production-app-platform
This example deployment is intended for use with App hosting platforms, like
Azure, AWS, or Google Cloud Run.
## Architecture
The production deployment consists of a few pieces:
- Backend container - built by `Dockerfile` Runs the Reflex backend
service on port 8000 and is scalable to multiple instances.
- Redis container - A single instance the standard `redis` docker image should
share private networking with the backend
- Static frontend - HTML/CSS/JS files that are hosted via a CDN or static file
server. This is not included in the docker image.
## Deployment
These general steps do not cover the specifics of each platform, but all platforms should
support the concepts described here.
### Vnet
All containers in the deployment should be hooked up to the same virtual private
network so they can access the redis service and optionally the database server.
The vnet should not be exposed to the internet, use an ingress rule to terminate
TLS at the load balancer and forward the traffic to a backend service replica.
### Redis
Deploy a `redis` instance on the vnet.
### Backend
The backend is built by the `Dockerfile` in this directory. When deploying the
backend, be sure to set REFLEX_REDIS_URL=redis://internal-redis-hostname to connect to
the redis service.
### Ingress
Configure the load balancer for the app to forward traffic to port 8000 on the
backend service replicas. Most platforms will generate an ingress hostname
automatically. Make sure when you access the ingress endpoint on `/ping` that it
returns "pong", indicating that the backend is up an available.
### Frontend
The frontend should be hosted on a static file server or CDN.
**Important**: when exporting the frontend, set the API_URL environment variable
to the ingress hostname of the backend service.
If you will host the frontend from a path other than the root, set the
`REFLEX_FRONTEND_PATH` environment variable appropriately when exporting the frontend.
Most static hosts will automatically use the `/404.html` file to handle 404
errors. _This is essential for dynamic routes to work correctly._ Ensure that
missing routes return the `/404.html` content to the user if this is not the
default behavior.
_For Github Pages_: ensure the file `.nojekyll` is present in the root of the repo
to avoid special processing of underscore-prefix directories, like `_next`.
## Platform Notes
The following sections are currently a work in progress and may be incomplete.
### Azure
In the Azure load balancer, per-message deflate is not supported. Add the following
to your `rxconfig.py` to workaround this issue.
```python
import uvicorn.workers
import reflex as rx
class NoWSPerMessageDeflate(uvicorn.workers.UvicornH11Worker):
CONFIG_KWARGS = {
**uvicorn.workers.UvicornH11Worker.CONFIG_KWARGS,
"ws_per_message_deflate": False,
}
config = rx.Config(
app_name="my_app",
gunicorn_worker_class="rxconfig.NoWSPerMessageDeflate",
)
```
#### Persistent Storage
If you need to use a database or upload files, you cannot save them to the
container volume. Use Azure Files and mount it into the container at /app/uploaded_files.
#### Resource Types
- Create a new vnet with 10.0.0.0/16
- Create a new subnet for redis, database, and containers
- Deploy redis as a Container Instances
- Deploy database server as "Azure Database for PostgreSQL"
- Create a new database for the app
- Set db-url as a secret containing the db user/password connection string
- Deploy Storage account for uploaded files
- Enable access from the vnet and container subnet
- Create a new file share
- In the environment, create a new files share (get the storage key)
- Deploy the backend as a Container App
- Create a custom Container App Environment linked up to the same vnet as the redis container.
- Set REFLEX_REDIS_URL and REFLEX_DB_URL environment variables
- Add the volume from the environment
- Add the volume mount to the container
- Deploy the frontend as a Static Web App
================================================
FILE: docker-example/production-compose/.dockerignore
================================================
.web
.git
__pycache__/*
Dockerfile
Caddy.Dockerfile
compose.yaml
compose.*.yaml
uploaded_files
================================================
FILE: docker-example/production-compose/Caddy.Dockerfile
================================================
FROM library/caddy
COPY --from=local/reflex-app /app/.web/build/client /srv
ADD Caddyfile /etc/caddy/Caddyfile
================================================
FILE: docker-example/production-compose/Caddyfile
================================================
{$DOMAIN}
encode gzip
@backend_routes path /_event/* /ping /_upload /_upload/*
handle @backend_routes {
reverse_proxy app:8000
}
root * /srv
route {
try_files {path} {path}/ /404.html
file_server
}
================================================
FILE: docker-example/production-compose/Dockerfile
================================================
# This docker file is intended to be used with docker compose to deploy a production
# instance of a Reflex app.
# Stage 1: init
FROM python:3.13 as init
ARG uv=/root/.local/bin/uv
# Install `uv` for faster package bootstrapping
ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
RUN /install.sh && rm /install.sh
# Copy local context to `/app` inside container (see .dockerignore)
WORKDIR /app
COPY . .
RUN mkdir -p /app/data /app/uploaded_files
# Create virtualenv which will be copied into final container
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN $uv venv
# Install app requirements and reflex inside virtualenv
RUN $uv pip install -r requirements.txt
# Deploy templates and prepare app
RUN reflex init
# Export static copy of frontend to /app/.web/build/client
RUN reflex export --frontend-only --no-zip
# Copy static files out of /app to save space in backend image
RUN mv .web/build/client /tmp/client
RUN rm -rf .web && mkdir -p .web/build
RUN mv /tmp/client .web/build/client
# Stage 2: copy artifacts into slim image
FROM python:3.13-slim
WORKDIR /app
RUN adduser --disabled-password --home /app reflex
COPY --chown=reflex --from=init /app /app
# Install libpq-dev for psycopg (skip if not using postgres).
RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*
USER reflex
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
# Needed until Reflex properly passes SIGTERM on backend.
STOPSIGNAL SIGKILL
# Always apply migrations before starting the backend.
CMD [ -d alembic ] && reflex db migrate; \
exec reflex run --env prod --backend-only
================================================
FILE: docker-example/production-compose/README.md
================================================
# production-compose
This example production deployment uses automatic TLS with Caddy serving static
files for the frontend and proxying requests to both the frontend and backend.
It is intended for use with a standalone VPS that is only hosting a single
Reflex app.
The production app container (`Dockerfile`), builds and exports the frontend
statically (to be served by Caddy). The resulting image only runs the backend
service.
The `webserver` service, based on `Caddy.Dockerfile`, copies the static frontend
and `Caddyfile` into the container to configure the reverse proxy routes that will
forward requests to the backend service. Caddy will automatically provision TLS
for localhost or the domain specified in the environment variable `DOMAIN`.
This type of deployment should use less memory and be more performant since
nodejs is not required at runtime.
## Customize `Caddyfile` (optional)
If the app uses additional backend API routes, those should be added to the
`@backend_routes` path matcher to ensure they are forwarded to the backend.
## Build Reflex Production Service
During build, set `DOMAIN` environment variable to the domain where the app will
be hosted! (Do not include http or https, it will always use https).
**If `DOMAIN` is not provided, the service will default to `localhost`.**
```bash
DOMAIN=example.com docker compose build
```
This will build both the `app` service from the `prod.Dockerfile` and the `webserver`
service via `Caddy.Dockerfile`.
## Run Reflex Production Service
```bash
DOMAIN=example.com docker compose up
```
The app should be available at the specified domain via HTTPS. Certificate
provisioning will occur automatically and may take a few minutes.
### Data Persistence
Named docker volumes are used to persist the app database (`db-data`),
uploaded_files (`upload-data`), and caddy TLS keys and certificates
(`caddy-data`).
## More Robust Deployment
For a more robust deployment, consider bringing the service up with
`compose.prod.yaml` which includes postgres database and redis cache, allowing
the backend to run with multiple workers and service more requests.
```bash
DOMAIN=example.com docker compose -f compose.yaml -f compose.prod.yaml up -d
```
Postgres uses its own named docker volume for data persistence.
## Admin Tools
When needed, the services in `compose.tools.yaml` can be brought up, providing
graphical database administration (Adminer on http://localhost:8080) and a
redis cache browser (redis-commander on http://localhost:8081). It is not recommended
to deploy these services if they are not in active use.
```bash
DOMAIN=example.com docker compose -f compose.yaml -f compose.prod.yaml -f compose.tools.yaml up -d
```
================================================
FILE: docker-example/production-compose/compose.prod.yaml
================================================
# Use this override file to run the app in prod mode with postgres and redis
# docker compose -f compose.yaml -f compose.prod.yaml up -d
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: secret
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis
restart: always
app:
environment:
REFLEX_DB_URL: postgresql+psycopg://postgres:secret@db/postgres
REFLEX_REDIS_URL: redis://redis:6379
depends_on:
- db
- redis
volumes:
postgres-data:
================================================
FILE: docker-example/production-compose/compose.tools.yaml
================================================
# Use this override file with `compose.prod.yaml` to run admin tools
# for production services.
# docker compose -f compose.yaml -f compose.prod.yaml -f compose.tools.yaml up -d
services:
adminer:
image: adminer
ports:
- 8080:8080
redis-commander:
image: ghcr.io/joeferner/redis-commander:latest
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"
volumes:
redis-ui-settings:
================================================
FILE: docker-example/production-compose/compose.yaml
================================================
# Base compose file production deployment of reflex app with Caddy webserver
# providing TLS termination and reverse proxying.
#
# See `compose.prod.yaml` for more robust and performant deployment option.
#
# During build and run, set environment DOMAIN pointing
# to publicly accessible domain where app will be hosted
services:
app:
image: local/reflex-app
environment:
REFLEX_DB_URL: sqlite:///data/reflex.db
build:
context: .
volumes:
- db-data:/app/data
- upload-data:/app/uploaded_files
restart: always
webserver:
environment:
DOMAIN: ${DOMAIN:-localhost}
ports:
- 443:443
- 80:80 # For acme-challenge via HTTP.
build:
context: .
dockerfile: Caddy.Dockerfile
volumes:
- caddy-data:/root/.caddy
restart: always
depends_on:
- app
volumes:
# SQLite data
db-data:
# Uploaded files
upload-data:
# TLS keys and certificates
caddy-data:
================================================
FILE: docker-example/production-one-port/.dockerignore
================================================
.web
!.web/bun.lockb
!.web/package.json
================================================
FILE: docker-example/production-one-port/Caddyfile
================================================
:{$PORT}
encode gzip
@backend_routes path /_event/* /ping /_upload /_upload/*
handle @backend_routes {
reverse_proxy localhost:8000
}
root * /srv
route {
try_files {path} {path}/ /404.html
file_server
}
================================================
FILE: docker-example/production-one-port/Dockerfile
================================================
# This Dockerfile is used to deploy a single-container Reflex app instance
# to services like Render, Railway, Heroku, GCP, and others.
# If the service expects a different port, provide it here (f.e Render expects port 10000)
ARG PORT=8080
# Only set for local/direct access. When TLS is used, the API_URL is assumed to be the same as the frontend.
ARG API_URL
# It uses a reverse proxy to serve the frontend statically and proxy to backend
# from a single exposed port, expecting TLS termination to be handled at the
# edge by the given platform.
FROM python:3.13 as builder
RUN mkdir -p /app/.web
RUN python -m venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
WORKDIR /app
# Install python app requirements and reflex in the container
COPY requirements.txt .
RUN pip install -r requirements.txt
# Install reflex helper utilities like bun/node
COPY rxconfig.py ./
RUN reflex init
# Install pre-cached frontend dependencies (if exist)
COPY *.web/bun.lockb *.web/package.json .web/
RUN if [ -f .web/bun.lockb ]; then cd .web && ~/.local/share/reflex/bun/bin/bun install --frozen-lockfile; fi
# Copy local context to `/app` inside container (see .dockerignore)
COPY . .
ARG PORT API_URL
# Download other npm dependencies and compile frontend
RUN REFLEX_API_URL=${API_URL:-http://localhost:$PORT} reflex export --loglevel debug --frontend-only --no-zip && mv .web/build/client/* /srv/ && rm -rf .web
# Final image with only necessary files
FROM python:3.13-slim
# Install Caddy and redis server inside image
RUN apt-get update -y && apt-get install -y caddy redis-server && rm -rf /var/lib/apt/lists/*
ARG PORT API_URL
ENV PATH="/app/.venv/bin:$PATH" PORT=$PORT REFLEX_API_URL=${API_URL:-http://localhost:$PORT} REFLEX_REDIS_URL=redis://localhost PYTHONUNBUFFERED=1
WORKDIR /app
COPY --from=builder /app /app
COPY --from=builder /srv /srv
# Needed until Reflex properly passes SIGTERM on backend.
STOPSIGNAL SIGKILL
EXPOSE $PORT
# Apply migrations before starting the backend.
CMD [ -d alembic ] && reflex db migrate; \
caddy start && \
redis-server --daemonize yes && \
exec reflex run --env prod --backend-only
================================================
FILE: docker-example/production-one-port/README.md
================================================
# production-one-port
This docker deployment runs Reflex in prod mode, exposing a single HTTP port:
- `8080` (`$PORT`) - Caddy server hosting the frontend statically and proxying requests to the backend.
The deployment also runs a local Redis server to store state for each user.
Conceptually it is similar to the `simple-one-port` example except it:
- has layer caching for python, reflex, and node dependencies
- uses multi-stage build to reduce the size of the final image
Using this method may be preferable for deploying in memory constrained
environments, because it serves a static frontend export, rather than running
the Vite server via node.
## Build
```console
docker build -t reflex-production-one-port .
```
## Run
```console
docker run -p 8080:8080 reflex-production-one-port
```
Note that this container has _no persistence_ and will lose all data when
stopped. You can use bind mounts or named volumes to persist the database and
uploaded_files directories as needed.
## Usage
This container should be used with an existing load balancer or reverse proxy to
terminate TLS.
It is also useful for deploying to simple app platforms, such as Render or Heroku.
================================================
FILE: docker-example/simple-one-port/.dockerignore
================================================
.web
.git
__pycache__/*
Dockerfile
uploaded_files
================================================
FILE: docker-example/simple-one-port/Caddyfile
================================================
:{$PORT}
encode gzip
@backend_routes path /_event/* /ping /_upload /_upload/*
handle @backend_routes {
reverse_proxy localhost:8000
}
root * /srv
route {
try_files {path} {path}/ /404.html
file_server
}
================================================
FILE: docker-example/simple-one-port/Dockerfile
================================================
# This Dockerfile is used to deploy a single-container Reflex app instance
# to services like Render, Railway, Heroku, GCP, and others.
# It uses a reverse proxy to serve the frontend statically and proxy to backend
# from a single exposed port, expecting TLS termination to be handled at the
# edge by the given platform.
FROM python:3.13
# If the service expects a different port, provide it here (f.e Render expects port 10000)
ARG PORT=8080
# Only set for local/direct access. When TLS is used, the API_URL is assumed to be the same as the frontend.
ARG API_URL
ENV PORT=$PORT REFLEX_API_URL=${API_URL:-http://localhost:$PORT} REFLEX_REDIS_URL=redis://localhost PYTHONUNBUFFERED=1
# Install Caddy and redis server inside image
RUN apt-get update -y && apt-get install -y caddy redis-server && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy local context to `/app` inside container (see .dockerignore)
COPY . .
# Install app requirements and reflex in the container
RUN pip install -r requirements.txt
# Deploy templates and prepare app
RUN reflex init
# Download all npm dependencies and compile frontend
RUN reflex export --frontend-only --no-zip && mv .web/build/client/* /srv/ && rm -rf .web
# Needed until Reflex properly passes SIGTERM on backend.
STOPSIGNAL SIGKILL
EXPOSE $PORT
# Apply migrations before starting the backend.
CMD [ -d alembic ] && reflex db migrate; \
caddy start && \
redis-server --daemonize yes && \
exec reflex run --env prod --backend-only
================================================
FILE: docker-example/simple-one-port/README.md
================================================
# simple-one-port
This docker deployment runs Reflex in prod mode, exposing a single HTTP port:
- `8080` (`$PORT`) - Caddy server hosting the frontend statically and proxying requests to the backend.
The deployment also runs a local Redis server to store state for each user.
Using this method may be preferable for deploying in memory constrained
environments, because it serves a static frontend export, rather than running
the Vite server via node.
For platforms which only terminate TLS to a single port, this container can be
deployed instead of the `simple-two-port` example.
## Build
```console
docker build -t reflex-simple-one-port .
```
## Run
```console
docker run -p 8080:8080 reflex-simple-one-port
```
Note that this container has _no persistence_ and will lose all data when
stopped. You can use bind mounts or named volumes to persist the database and
uploaded_files directories as needed.
## Usage
This container should be used with an existing load balancer or reverse proxy to
terminate TLS.
It is also useful for deploying to simple app platforms, such as Render or Heroku.
================================================
FILE: docker-example/simple-two-port/.dockerignore
================================================
.web
.git
__pycache__/*
Dockerfile
uploaded_files
================================================
FILE: docker-example/simple-two-port/Dockerfile
================================================
# This Dockerfile is used to deploy a simple single-container Reflex app instance.
FROM python:3.13
RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
ENV REFLEX_REDIS_URL=redis://localhost PYTHONUNBUFFERED=1
# Copy local context to `/app` inside container (see .dockerignore)
WORKDIR /app
COPY . .
# Install app requirements and reflex in the container
RUN pip install -r requirements.txt
# Deploy templates and prepare app
RUN reflex init
# Download all npm dependencies and compile frontend
RUN reflex export --frontend-only --no-zip
# Needed until Reflex properly passes SIGTERM on backend.
STOPSIGNAL SIGKILL
# Always apply migrations before starting the backend.
CMD [ -d alembic ] && reflex db migrate; \
redis-server --daemonize yes && \
exec reflex run --env prod
================================================
FILE: docker-example/simple-two-port/README.md
================================================
# simple-two-port
This docker deployment runs Reflex in prod mode, exposing two HTTP ports:
- `3000` - node server using optimized production build
- `8000` - python gunicorn server hosting the Reflex backend
The deployment also runs a local Redis server to store state for each user.
## Build
```console
docker build -t reflex-simple-two-port .
```
## Run
```console
docker run -p 3000:3000 -p 8000:8000 reflex-simple-two-port
```
Note that this container has _no persistence_ and will lose all data when
stopped. You can use bind mounts or named volumes to persist the database and
uploaded_files directories as needed.
## Usage
This container should be used with an existing load balancer or reverse proxy to
route traffic to the appropriate port inside the container.
For example, the following Caddyfile can be used to terminate TLS and forward
traffic to the frontend and backend from outside the container.
```
my-domain.com
encode gzip
@backend_routes path /_event/* /ping /_upload /_upload/*
handle @backend_routes {
reverse_proxy localhost:8000
}
reverse_proxy localhost:3000
```
================================================
FILE: docs/DEBUGGING.md
================================================
# Debugging
It is possible to run Reflex apps in dev mode under a debugger.
1. Run Reflex as a module: `python -m reflex run --env dev`
2. Set current working directory to the dir containing `rxconfig.py`
## VSCode
The following launch configuration can be used to interactively debug a Reflex
app with breakpoints.
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Reflex App",
"type": "python",
"request": "launch",
"module": "reflex",
"args": "run --env dev",
"justMyCode": true,
"cwd": "${fileDirname}/.."
}
]
}
```
================================================
FILE: docs/de/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ Performante, anpassbare Web-Apps in purem Python. Bereitstellung in Sekunden. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex ist eine Bibliothek, mit der man Full-Stack-Web-Applikationen in purem Python erstellen kann.
Wesentliche Merkmale:
- **Pures Python** - Schreibe dein Front- und Backend in Python, es gibt also keinen Grund, JavaScript zu lernen.
- **Volle Flexibilität** - Reflex ist einfach zu handhaben, kann aber auch für komplexe Anwendungen skaliert werden.
- **Sofortige Bereitstellung** - Nach dem Erstellen kannst du deine App mit einem [einzigen Befehl](https://reflex.dev/docs/hosting/deploy-quick-start/) bereitstellen oder auf deinem eigenen Server hosten.
Auf unserer [Architektur-Seite](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) erfahren Sie, wie Reflex unter der Haube funktioniert.
## ⚙️ Installation
Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.10+):
```bash
pip install reflex
```
## 🥳 Erstelle deine erste App
Die Installation von `reflex` installiert auch das `reflex`-Kommandozeilen-Tool.
Teste, ob die Installation erfolgreich war, indem du ein neues Projekt erstellst. (Ersetze `my_app_name` durch deinen Projektnamen):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
Dieser Befehl initialisiert eine Vorlage in deinem neuen Verzeichnis.
Du kannst diese App im Entwicklungsmodus ausführen:
```bash
reflex run
```
Du solltest deine App unter http://localhost:3000 laufen sehen.
Nun kannst du den Quellcode in `my_app_name/my_app_name.py` ändern. Reflex hat schnelle Aktualisierungen, sodass du deine Änderungen sofort siehst, wenn du deinen Code speicherst.
## 🫧 Beispiel-App
Lass uns ein Beispiel durchgehen: die Erstellung einer Benutzeroberfläche für die Bildgenerierung mit [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Zur Vereinfachung rufen wir einfach die [OpenAI-API](https://platform.openai.com/docs/api-reference/authentication) auf, aber du könntest dies auch durch ein lokal ausgeführtes ML-Modell ersetzen.
<div align="center">
<img src="/docs/images/dalle.gif" alt="Eine Benutzeroberfläche für DALL·E, die im Prozess der Bildgenerierung gezeigt wird." width="550" />
</div>
Hier ist der komplette Code, um dies zu erstellen. Das alles wird in einer Python-Datei gemacht!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""Der Zustand der App."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Hole das Bild aus dem Prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Füge Zustand und Seite zur App hinzu.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Schauen wir uns das mal genauer an.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="Erläuterung der Unterschiede zwischen Backend- und Frontend-Teilen der DALL-E-App." width="900" />
</div>
### **Reflex-UI**
Fangen wir mit der Benutzeroberfläche an.
```python
def index():
return rx.center(
...
)
```
Diese `index`-Funktion definiert das Frontend der App.
Wir verwenden verschiedene Komponenten wie `center`, `vstack`, `input` und `button`, um das Frontend zu erstellen. Komponenten können ineinander verschachtelt werden, um komplexe Layouts zu erstellen. Und du kannst Schlüsselwortargumente verwenden, um sie mit der vollen Kraft von CSS zu stylen.
Reflex wird mit [über 60 eingebauten Komponenten](https://reflex.dev/docs/library) geliefert, die dir den Einstieg erleichtern. Wir fügen aktiv weitere Komponenten hinzu, und es ist einfach, [eigene Komponenten zu erstellen](https://reflex.dev/docs/wrapping-react/overview/).
### **State**
Reflex stellt deine Benutzeroberfläche als Funktion deines Zustands dar.
```python
class State(rx.State):
"""Der Zustand der App."""
prompt = ""
image_url = ""
processing = False
complete = False
```
Der Zustand definiert alle Variablen (genannt Vars) in einer App, die sich ändern können, und die Funktionen, die sie ändern.
Hier besteht der Zustand aus einem `prompt` und einer `image_url`. Es gibt auch die Booleans `processing` und `complete`, um anzuzeigen, wann der Button deaktiviert werden soll (während der Bildgenerierung) und wann das resultierende Bild angezeigt werden soll.
### **Event-Handler**
```python
def get_image(self):
"""Hole das Bild aus dem Prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Innerhalb des Zustands definieren wir Funktionen, die als Event-Handler bezeichnet werden und die Zustand-Variablen ändern. Event-Handler sind die Art und Weise, wie wir den Zustand in Reflex ändern können. Sie können als Reaktion auf Benutzeraktionen aufgerufen werden, z.B. beim Klicken auf eine Schaltfläche oder bei der Eingabe in ein Textfeld. Diese Aktionen werden als Ereignisse bezeichnet.
Unsere DALL-E.-App hat einen Event-Handler, `get_image`, der dieses Bild von der OpenAI-API abruft. Die Verwendung von `yield` in der Mitte eines Event-Handlers führt zu einer Aktualisierung der Benutzeroberfläche. Andernfalls wird die Benutzeroberfläche am Ende des Ereignishandlers aktualisiert.
### **Routing**
Schließlich definieren wir unsere App.
```python
app = rx.App()
```
Wir fügen der Indexkomponente eine Seite aus dem Stammverzeichnis der Anwendung hinzu. Wir fügen auch einen Titel hinzu, der in der Seitenvorschau/Browser-Registerkarte angezeigt wird.
```python
app.add_page(index, title="DALL-E")
```
Du kannst eine mehrseitige App erstellen, indem du weitere Seiten hinzufügst.
## 📑 Ressourcen
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Komponentenbibliothek](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Bereitstellung](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Status
Reflex wurde im Dezember 2022 unter dem Namen Pynecone gestartet.
Ab 2025 wurde [Reflex Cloud](https://cloud.reflex.dev) gestartet, um die beste Hosting-Erfahrung für Reflex-Apps zu bieten. Wir werden es weiterhin entwickeln und mehr Funktionen implementieren.
Reflex hat wöchentliche Veröffentlichungen und neue Features! Stelle sicher, dass du dieses Repository mit einem :star: Stern markierst und :eyes: beobachtest, um auf dem Laufenden zu bleiben.
## Beitragende
Wir begrüßen Beiträge jeder Größe! Hier sind einige gute Möglichkeiten, um in der Reflex-Community zu starten.
- **Tritt unserem Discord bei**: Unser [Discord](https://discord.gg/T5WSbC2YtQ) ist der beste Ort, um Hilfe für dein Reflex-Projekt zu bekommen und zu besprechen, wie du beitragen kannst.
- **GitHub-Diskussionen**: Eine großartige Möglichkeit, über Funktionen zu sprechen, die du hinzugefügt haben möchtest oder Dinge, die verwirrend sind/geklärt werden müssen.
- **GitHub-Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) sind eine ausgezeichnete Möglichkeit, Bugs zu melden. Außerdem kannst du versuchen, ein bestehendes Problem zu lösen und eine PR einzureichen.
Wir suchen aktiv nach Mitwirkenden, unabhängig von deinem Erfahrungslevel oder deiner Erfahrung. Um beizutragen, sieh dir [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) an.
## Vielen Dank an unsere Mitwirkenden:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## Lizenz
Reflex ist Open-Source und lizenziert unter der [Apache License 2.0](/LICENSE).
================================================
FILE: docs/es/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ Aplicaciones web personalizables y eficaces en Python puro. Despliega tu aplicación en segundos. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex es una biblioteca para construir aplicaciones web full-stack en Python puro.
Características clave:
- **Python puro** - Escribe el frontend y backend de tu aplicación en Python, sin necesidad de aprender JavaScript.
- **Flexibilidad total** - Reflex es fácil para empezar, pero también puede escalar a aplicaciones complejas.
- **Despliegue instantáneo** - Después de construir, despliega tu aplicación con un [solo comando](https://reflex.dev/docs/hosting/deploy-quick-start/) u hospédala en tu propio servidor.
Consulta nuestra [página de arquitectura](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) para aprender cómo funciona Reflex en detalle.
## ⚙️ Instalación
Abra un terminal y ejecute (Requiere Python 3.10+):
```bash
pip install reflex
```
## 🥳 Crea tu primera aplicación
Al instalar `reflex` también se instala la herramienta de línea de comandos `reflex`.
Compruebe que la instalación se ha realizado correctamente creando un nuevo proyecto. (Sustituye `my_app_name` por el nombre de tu proyecto):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
Este comando inicializa una plantilla en tu nuevo directorio.
Puedes iniciar esta aplicación en modo de desarrollo:
```bash
reflex run
```
Debería ver su aplicación ejecutándose en http://localhost:3000.
Ahora puede modificar el código fuente en `my_app_name/my_app_name.py`. Reflex se actualiza rápidamente para que pueda ver los cambios al instante cuando guarde el código.
## 🫧 Ejemplo de una Aplicación
Veamos un ejemplo: crearemos una UI de generación de imágenes en torno a [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Para simplificar, solo llamamos a la [API de OpenAI](https://platform.openai.com/docs/api-reference/authentication), pero podrías reemplazar esto con un modelo ML ejecutado localmente.
<div align="center">
<img src="/docs/images/dalle.gif" alt="Un envoltorio frontend para DALL·E, mostrado en el proceso de generar una imagen." width="550" />
</div>
Aquí está el código completo para crear esto. ¡Todo esto se hace en un archivo de Python!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""El estado de la aplicación"""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Obtiene la imagen desde la consulta."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Agrega el estado y la pagina a la aplicación
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Vamos a analizarlo.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="Explicando las diferencias entre las partes del backend y frontend de la aplicación DALL-E." width="900" />
</div>
### **Reflex UI**
Empezemos por la interfaz de usuario (UI).
```python
def index():
return rx.center(
...
)
```
Esta función `index` define el frontend de la aplicación.
Utilizamos diferentes componentes como `center`, `vstack`, `input`, y `button` para construir el frontend. Los componentes pueden anidarse unos dentro de otros para crear diseños complejos. Además, puedes usar argumentos de tipo keyword para darles estilo con toda la potencia de CSS.
Reflex viene con [mas de 60 componentes incorporados](https://reflex.dev/docs/library) para ayudarle a empezar. Estamos añadiendo activamente más componentes y es fácil [crear sus propios componentes](https://reflex.dev/docs/wrapping-react/overview/).
### **Estado**
Reflex representa su UI como una función de su estado (State).
```python
class State(rx.State):
"""El estado de la aplicación"""
prompt = ""
image_url = ""
processing = False
complete = False
```
El estado (State) define todas las variables (llamadas vars) de una aplicación que pueden cambiar y las funciones que las modifican.
Aquí el estado se compone de `prompt` e `image_url`. También están los booleanos `processing` y `complete` para indicar cuando se deshabilite el botón (durante la generación de la imagen) y cuando se muestre la imagen resultante.
### **Manejadores de Evento**
```python
def get_image(self):
"""Obtiene la imagen desde la consulta."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Dentro del estado, definimos funciones llamadas manejadores de eventos que cambian las variables de estado. Los Manejadores de Evento son la manera que podemos modificar el estado en Reflex. Pueden ser activados en respuesta a las acciones del usuario, como hacer clic en un botón o escribir en un cuadro de texto. Estas acciones se llaman eventos.
Nuestra aplicación DALL·E tiene un manipulador de eventos, `get_image` que recibe esta imagen del OpenAI API. El uso de `yield` en medio de un manipulador de eventos hará que la UI se actualice. De lo contrario, la interfaz se actualizará al final del manejador de eventos.
### **Enrutamiento**
Por último, definimos nuestra app.
```python
app = rx.App()
```
Añadimos una página desde la raíz (root) de la aplicación al componente de índice (index). También agregamos un título que se mostrará en la vista previa de la página/pestaña del navegador.
```python
app.add_page(index, title="DALL-E")
```
Puedes crear una aplicación multipágina añadiendo más páginas.
## 📑 Recursos
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Librería de componentes](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Despliegue](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Estado
Reflex se lanzó en diciembre de 2022 con el nombre de Pynecone.
A partir de 2025, [Reflex Cloud](https://cloud.reflex.dev) se ha lanzado para proporcionar la mejor experiencia de alojamiento para aplicaciones Reflex. Continuaremos desarrollándolo e implementando más características.
¡Reflex tiene nuevas versiones y características cada semana! Asegúrate de :star: marcar como favorito y :eyes: seguir este repositorio para mantenerte actualizado.
## Contribuciones
¡Aceptamos contribuciones de cualquier tamaño! A continuación encontrará algunas buenas formas de iniciarse en la comunidad Reflex.
- **Únete a nuestro Discord**: Nuestro [Discord](https://discord.gg/T5WSbC2YtQ) es el mejor lugar para obtener ayuda en su proyecto Reflex y discutir cómo puedes contribuir.
- **Discusiones de GitHub**: Una excelente manera de hablar sobre las características que deseas agregar o las cosas que te resultan confusas o necesitan aclaración.
- **GitHub Issues**: Las incidencias son una forma excelente de informar de errores. Además, puedes intentar resolver un problema existente y enviar un PR.
Buscamos colaboradores, sin importar su nivel o experiencia. Para contribuir consulta [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)
## Todo Gracias A Nuestros Contribuidores:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## Licencia
Reflex es de código abierto y está licenciado bajo la [Apache License 2.0](/LICENSE).
================================================
FILE: docs/in/README.md
================================================
<div align="center">
<img src="/docs/images/reflex_dark.svg#gh-light-mode-only" alt="Reflex लोगो" width="300px">
<img src="/docs/images/reflex_light.svg#gh-dark-mode-only" alt="Reflex लोगो" width="300px">
<hr>
### **✨ प्रदर्शनकारी, अनुकूलित वेब ऐप्स, शुद्ध Python में। सेकंडों में तैनात करें। ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
# Reflex
Reflex शुद्ध पायथन में पूर्ण-स्टैक वेब ऐप्स बनाने के लिए एक लाइब्रेरी है।
मुख्य विशेषताएँ:
- **शुद्ध पायथन** - अपने ऐप के फ्रंटएंड और बैकएंड को पायथन में लिखें, जावास्क्रिप्ट सीखने की जरूरत नहीं है।
- **पूर्ण लचीलापन** - Reflex के साथ शुरुआत करना आसान है, लेकिन यह जटिल ऐप्स के लिए भी स्केल कर सकता है।
- **तुरंत तैनाती** - बिल्डिंग के बाद, अपने ऐप को [एकल कमांड](https://reflex.dev/docs/hosting/deploy-quick-start/) के साथ तैनात करें या इसे अपने सर्वर पर होस्ट करें।
Reflex के अंदर के कामकाज को जानने के लिए हमारे [आर्किटेक्चर पेज](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) को देखें।
## ⚙️ इंस्टॉलेशन (Installation)
एक टर्मिनल खोलें और चलाएं (Python 3.10+ की आवश्यकता है):
```bash
pip install reflex
```
## 🥳 अपना पहला ऐप बनाएं (Create your first App)
reflex को इंस्टॉल करने से ही reflex कमांड लाइन टूल भी इंस्टॉल हो जाता है।
सुनिश्चित करें कि इंस्टॉलेशन सफल थी, एक नया प्रोजेक्ट बनाकर इसे टेस्ट करें। ('my_app_name' की जगह अपने प्रोजेक्ट का नाम रखें):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
यह कमांड आपकी नयी डायरेक्टरी में एक टेम्पलेट ऐप को प्रारंभ करता है।
आप इस ऐप को development मोड में चला सकते हैं:
```bash
reflex run
```
आपको http://localhost:3000 पर अपने ऐप को चलते हुए देखना चाहिए।
अब आप my_app_name/my_app_name.py में source कोड को संशोधित कर सकते हैं। Reflex में तेज रिफ्रेश की सुविधा है, इसलिए जब आप अपनी कोड को सहेजते हैं, तो आप अपने बदलावों को तुरंत देख सकते हैं।
## 🫧 उदाहरण ऐप (Example App)
एक उदाहरण पर चलते हैं: [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node) से एक इमेज उत्पन्न करने के लिए UI। सरलता के लिए, हम सिर्फ [OpenAI API](https://platform.openai.com/docs/api-reference/authentication) को बुलाते हैं, लेकिन आप इसे ML मॉडल से बदल सकते हैं locally।
<div align="center">
<img src="/docs/images/dalle.gif" alt="DALL·E के लिए एक फ्रंटएंड रैपर, छवि उत्पन्न करने की प्रक्रिया में दिखाया गया।" width="550" />
</div>
यहाँ पर इसका पूरा कोड है जिससे यह बनाया जा सकता है। यह सब एक ही Python फ़ाइल में किया गया है!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## इसे समझते हैं।
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="DALL-E ऐप के बैकएंड और फ्रंटएंड भागों के बीच के अंतर की व्याख्या करता है।" width="900" />
</div>
### **Reflex UI**
हम UI के साथ शुरू करेंगे।
```python
def index():
return rx.center(
...
)
```
यह `index` फ़ंक्शन एप्लिकेशन की फ़्रंटएंड को परिभाषित करता है।
हम फ़्रंटएंड बनाने के लिए `center`, `vstack`, `input`, और `button` जैसे विभिन्न components का उपयोग करते हैं। Components को एक-दूसरे के भीतर डाल सकते हैं विस्तारित लेआउट बनाने के लिए। और आप CSS की पूरी ताक़त के साथ इन्हें स्टाइल करने के लिए कीवर्ड आर्ग्यूमेंट (keyword args) का उपयोग कर सकते हैं।
रिफ़्लेक्स के पास [60+ built-in components](https://reflex.dev/docs/library) हैं जो आपको शुरुआती मदद के लिए हैं। हम बहुत से components जोड़ रहे हैं, और अपने खुद के components बनाना भी आसान है। [create your own components](https://reflex.dev/docs/wrapping-react/overview/)
### **स्टेट (State)**
Reflex आपके UI को आपकी स्टेट (state) के एक फ़ंक्शन के रूप में प्रस्तुत करता है।
```python
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
```
स्टेट (state) ऐप में उन सभी वेरिएबल्स (vars) को परिभाषित करती है जो बदल सकती हैं और उन फ़ंक्शनों को जो उन्हें बदलते हैं।
यहां स्टेट (state) में `prompt` और `image_url` शामिल हैं। प्रगति और छवि दिखाने के लिए `processing` और `complete` बूलियन भी हैं।
### **इवेंट हैंडलर (Event Handlers)**
```python
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
स्टेट (state) के अंदर, हम इवेंट हैंडलर्स (event handlers) को परिभाषित करते हैं जो स्टेट वेरिएबल्स को बदलते हैं। इवेंट हैंडलर्स (event handlers) से reflex में स्टेट (state) को मॉडिफ़ाय किया जा सकता हैं। इन्हें उपयोगकर्ता क्रियाओं (user actions) के प्रति प्रतिक्रिया (response) के रूप में बुलाया जा सकता है, जैसे कि बटन को क्लिक करना या टेक्स्ट बॉक्स में टाइप करना। इन क्रियाओं को इवेंट्स (events) कहा जाता है।
हमारे DALL·E. ऐप में एक इवेंट हैंडलर `get_image` है जिससे यह OpenAI API से इमेज प्राप्त करता है। इवेंट हैंडलर में `yield` का उपयोग करने कि वजह से UI अपडेट हो जाएगा। अन्यथा UI इवेंट हैंडलर के अंत में अपडेट होगा।
### **रूटिंग (Routing)**
आखिरकार, हम अपने एप्लिकेशन को परिभाषित करते हैं।
```python
app = rx.App()
```
हम अपने एप्लिकेशन के रूट से इंडेक्स कॉम्पोनेंट तक एक पेज को जोड़ते हैं। हम एक शीर्षक भी जोड़ते हैं जो पेज प्रीव्यू/ब्राउज़र टैब में दिखाई देगा।
```python
app.add_page(index, title="DALL-E")
```
आप और पेज जोड़कर एक मल्टी-पेज एप्लिकेशन बना सकते हैं।
## 📑 संसाधन (Resources)
<div align="center">
📑 [दस्तावेज़](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [ब्लॉग](https://reflex.dev/blog) | 📱 [कॉम्पोनेंट लाइब्रेरी](https://reflex.dev/docs/library) | 🖼️ [टेम्पलेट्स](https://reflex.dev/templates/) | 🛸 [तैनाती](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ स्टेटस (Status)
Reflex दिसंबर 2022 में Pynecone नाम से शुरू हुआ।
2025 की शुरुआत से, [Reflex Cloud](https://cloud.reflex.dev) लॉन्च किया गया है जो Reflex ऐप्स के लिए सर्वोत्तम होस्टिंग अनुभव प्रदान करता है। हम इसे विकसित करना और अधिक सुविधाएँ लागू करना जारी रखेंगे।
Reflex में हर सप्ताह नए रिलीज़ और फीचर्स आ रहे हैं! सुनिश्चित करें कि :star: स्टार और :eyes: वॉच इस रेपोजिटरी को अपडेट रहने के लिए।
## (योगदान) Contributing
हम हर तरह के योगदान का स्वागत करते हैं! रिफ्लेक्स कम्यूनिटी में शुरुआत करने के कुछ अच्छे तरीके नीचे दिए गए हैं।
- **Join Our Discord** (डिस्कॉर्ड सर्वर से जुड़ें): हमारा [Discord](https://discord.gg/T5WSbC2YtQ) रिफ्लेक्स प्रोजेक्ट पर सहायता प्राप्त करने और आप कैसे योगदान दे सकते हैं, इस पर चर्चा करने के लिए सबसे अच्छी जगह है।
- **GitHub Discussions** (गिटहब चर्चाएँ): उन सुविधाओं के बारे में बात करने का एक शानदार तरीका जिन्हें आप जोड़ना चाहते हैं या ऐसी चीज़ें जो भ्रमित करने वाली हैं/स्पष्टीकरण की आवश्यकता है।
- **GitHub Issues** (गिटहब समस्याएं): [Issues](https://github.com/reflex-dev/reflex/issues) बग की रिपोर्ट करने का एक शानदार तरीका है। इसके अतिरिक्त, आप किसी मौजूदा समस्या को हल करने का प्रयास कर सकते हैं और एक पीआर सबमिट कर सकते हैं।
हम सक्रिय रूप से योगदानकर्ताओं की तलाश कर रहे हैं, चाहे आपका कौशल स्तर या अनुभव कुछ भी हो। योगदान करने के लिए [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) देखें।
## हमारे सभी योगदानकर्ताओं का धन्यवाद:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## लाइसेंस (License)
रिफ्लेक्स ओपन-सोर्स है और [अपाचे लाइसेंस 2.0](/LICENSE) के तहत लाइसेंस प्राप्त है।
================================================
FILE: docs/it/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ App web performanti e personalizzabili in puro Python. Distribuisci in pochi secondi. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex è una libreria per sviluppare applicazioni web full-stack in Python puro.
Caratteristiche principali:
- **Python Puro** - Scrivi il frontend e il backend della tua app interamente in Python, senza bisogno di imparare Javascript.
- **Flessibilità Totale** - Reflex è facile da iniziare, ma può anche gestire app complesse.
- **Distribuzione Istantanea** - Dopo lo sviluppo, distribuisci la tua app con un [singolo comando](https://reflex.dev/docs/hosting/deploy-quick-start/) o ospitala sul tuo server.
Consulta la nostra [pagina di architettura](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) per scoprire come funziona Reflex sotto il cofano.
## ⚙️ Installazione
Apri un terminale ed esegui (Richiede Python 3.10+):
```bash
pip install reflex
```
## 🥳 Crea la tua prima app
Installando `reflex` si installa anche lo strumento da riga di comando `reflex`.
Verifica che l'installazione sia stata eseguita correttamente creando un nuovo progetto. (Sostituisci `nome_app` con il nome del tuo progetto):
```bash
mkdir nome_app
cd nome_app
reflex init
```
Questo comando inizializza un'app template nella tua nuova directory.
Puoi eseguire questa app in modalità sviluppo con:
```bash
reflex run
```
Dovresti vedere la tua app in esecuzione su http://localhost:3000.
Ora puoi modificare il codice sorgente in `nome_app/nome_app.py`. Reflex offre aggiornamenti rapidi, così puoi vedere le tue modifiche istantaneamente quando salvi il tuo codice.
## 🫧 Esempio App
Esaminiamo un esempio: creare un'interfaccia utente per la generazione di immagini attorno a [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Per semplicità, chiamiamo semplicemente l'[API OpenAI](https://platform.openai.com/docs/api-reference/authentication), ma potresti sostituirla con un modello ML eseguito localmente.
<div align="center">
<img src="/docs/images/dalle.gif" alt="Un wrapper frontend per DALL·E, mostrato nel processo di generazione di un'immagine." width="550" />
</div>
Ecco il codice completo per crearlo. Tutto fatto in un unico file Python!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""Lo stato dell'app."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Ottieni l'immagine dal prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Vuoto")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Inserisci un prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Genera Immagine",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Aggiungi stato e pagina all'app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Analizziamolo.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="Spiegazione delle differenze tra le parti backend e frontend dell'app DALL-E." width="900" />
</div>
### **Reflex UI**
Cominciamo con l'UI.
```python
def index():
return rx.center(
...
)
```
Questa funzione `index` definisce il frontend dell'app.
Utilizziamo diversi componenti come `center`, `vstack`, `input`, e `button` per costruire il frontend. I componenti possono essere annidati gli uni negli altri per creare layout complessi. E puoi utilizzare argomenti chiave per stilizzarli con tutta la potenza di CSS.
Reflex offre [più di 60 componenti integrati](https://reflex.dev/docs/library) per aiutarti a iniziare. Stiamo attivamente aggiungendo più componenti ed è facile [creare i tuoi componenti](https://reflex.dev/docs/wrapping-react/overview/).
### **Stato (State)**
Reflex rappresenta la tua UI come una funzione del tuo stato.
```python
class State(rx.State):
"""Lo stato dell'app."""
prompt = ""
image_url = ""
processing = False
complete = False
```
Lo stato definisce tutte le variabili (chiamate vars) in un'app che possono cambiare e le funzioni che le cambiano.
Qui lo stato è composto da un `prompt` e `image_url`. Ci sono anche i booleani `processing` e `complete` per indicare quando disabilitare il pulsante (durante la generazione dell'immagine) e quando mostrare l'immagine risultante.
### **Gestori di Eventi (Event Handlers)**
```python
def get_image(self):
"""Ottieni l'immagine dal prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Vuoto")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Dentro lo stato, definiamo funzioni chiamate gestori di eventi che cambiano le vars dello stato. I gestori di eventi sono il modo in cui possiamo modificare lo stato in Reflex. Possono essere chiamati in risposta alle azioni dell'utente, come fare clic su un pulsante o digitare in una casella di testo. Queste azioni vengono chiamate eventi.
La nostra app DALL·E ha un gestore di eventi, `get_image` con cui ottiene questa immagine dall'API OpenAI. Utilizzando `yield` nel mezzo di un gestore di eventi farà sì che l'UI venga aggiornata. Altrimenti, l'UI verrà aggiornata alla fine del gestore di eventi.
### **Instradamento (Routing)**
Infine, definiamo la nostra app.
```python
app = rx.App()
```
Aggiungiamo una pagina dalla radice dell'app al componente dell'indice. Aggiungiamo anche un titolo che apparirà nell'anteprima della pagina/scheda del browser.
```python
app.add_page(index, title="DALL-E")
```
Puoi creare un'app multi-pagina aggiungendo altre pagine.
## 📑 Risorse
<div align="center">
📑 [Documentazione](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Libreria Componenti](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Distribuzione](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Stato
Reflex è stato lanciato nel dicembre 2022 con il nome Pynecone.
A partire dal 2025, [Reflex Cloud](https://cloud.reflex.dev) è stato lanciato per fornire la migliore esperienza di hosting per le app Reflex. Continueremo a svilupparlo e implementare più funzionalità.
Reflex ha nuove versioni e funzionalità in arrivo ogni settimana! Assicurati di :star: mettere una stella e :eyes: osservare questa repository per rimanere aggiornato.
## Contribuire
Diamo il benvenuto a contributi di qualsiasi dimensione! Di seguito sono alcuni modi per iniziare nella comunità Reflex.
- **Unisciti al nostro Discord**: Il nostro [Discord](https://discord.gg/T5WSbC2YtQ) è posto migliore per ottenere aiuto sul tuo progetto Reflex e per discutere come puoi contribuire.
- **Discussioni su GitHub**: Un ottimo modo per parlare delle funzionalità che desideri aggiungere o di cose che creano confusione o necessitano chiarimenti.
- **GitHub Issues**: Le [Issues](https://github.com/reflex-dev/reflex/issues) sono un ottimo modo per segnalare bug. Inoltre, puoi provare a risolvere un problema esistente e inviare un PR.
Stiamo attivamente cercando collaboratori, indipendentemente dal tuo livello di abilità o esperienza. Per contribuire, consulta [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)
## Un Grazie a Tutti i Nostri Contributori:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## Licenza
Reflex è open-source e rilasciato sotto la [Licenza Apache 2.0](/LICENSE).
================================================
FILE: docs/ja/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ 即時デプロイが可能な、Pure Python で作ったパフォーマンスと汎用性が高い Web アプリケーション ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex は Python のみでフルスタック Web アプリケーションを作成できるライブラリです。
主な特徴:
- **Pure Python** - Web アプリケーションのフロントエンドとバックエンドを Python のみで実装できるため、Javascript を学ぶ必要がありません。
- **高い柔軟性** - Reflex は簡単に始められて、複雑なアプリケーションまで作成できます。
- **即時デプロイ** - ビルド後、すぐにデプロイが可能です。[単純な CLI コマンド](https://reflex.dev/docs/hosting/deploy-quick-start/)を使ったアプリケーションのデプロイや、自身のサーバーへのホストができます。
Reflex がどのように動作しているかを知るには、[アーキテクチャページ](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture)をご覧ください。
## ⚙️ インストール
ターミナルを開いて以下のコマンドを実行してください。(Python 3.10 以上が必要です。):
```bash
pip install reflex
```
## 🥳 最初のアプリケーションを作ろう
`reflex`をインストールすると、`reflex`の CLI ツールが自動でインストールされます。
新しいプロジェクトを作成して、インストールが成功しているかを確認しましょう。(`my_app_name`を自身のプロジェクト名に書き換えて実行ください。):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
上記のコマンドを実行すると、新しいフォルダにテンプレートアプリを作成します。
下記のコマンドを実行すると、開発モードでアプリを開始します。
```bash
reflex run
```
http://localhost:3000 にアクセスしてアプリの動作を見ることができます。
`my_app_name/my_app_name.py`のソースコードを編集してみましょう!Reflex は fast refresh なので、ソースを保存した直後に変更が Web ページに反映されます。
## 🫧 実装例
実装例を見てみましょう: [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node)を中心とした画像生成 UI を作成しました。説明を簡単にするためにここでは[OpenAI API](https://platform.openai.com/docs/api-reference/authentication)を呼んでいますが、ローカルで動作している機械学習モデルに置き換えることも可能です。
<div align="center">
<img src="/docs/images/dalle.gif" alt="DALL·Eのフロントエンドラッパーです。画像を生成している過程を表示しています。" width="550" />
</div>
画像生成 UI のソースコードの全貌を見てみましょう。下記のように、単一の Python ファイルで作れます!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""アプリのステート"""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""プロンプトからイメージを取得する"""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# ステートとページをアプリに追加
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## それぞれの実装を見てみましょう
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="DALL-E appのフロントエンドとバックエンドのパーツの違いを説明しています。" width="900" />
</div>
### **Reflex UI**
UI から見てみましょう。
```python
def index():
return rx.center(
...
)
```
`index`関数において、アプリのフロントエンドを定義しています。
フロントエンドを実装するにあたり、`center`、`vstack`、`input`、`button`など異なるコンポーネントを使用しています。コンポーネントはお互いにネストが可能であり、複雑なレイアウトを作成できます。また、keyword args を使うことで、CSS の機能をすべて使ったスタイルが可能です。
Reflex は[60 を超える内臓コンポーネント](https://reflex.dev/docs/library)があるため、すぐに始められます。私たちは、積極的にコンポーネントを追加していますが、簡単に[自身のコンポーネントを追加](https://reflex.dev/docs/wrapping-react/overview/)することも可能です。
### **ステート**
Reflex はステートの関数を用いて UI を表示します。
```python
class State(rx.State):
"""アプリのステート"""
prompt = ""
image_url = ""
processing = False
complete = False
```
ステートでは、アプリで変更が可能な全ての変数(vars と呼びます)と、vars の変更が可能な関数を定義します。
この例では、ステートを`prompt`と`image_url`で構成しています。そして、ブール型の`processing`と`complete`を用いて、ボタンを無効にするタイミング(画像生成中)や生成された画像を表示するタイミングを示しています。
### **イベントハンドラ**
```python
def get_image(self):
"""プロンプトからイメージを取得する"""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
ステートにおいて、ステートの vars を変更できるイベントハンドラ関数を定義しています。イベントハンドラは Reflex において、ステートの vars を変更する方法です。ボタンクリックやテキストボックスの入力など、ユーザのアクションに応じてイベントハンドラが呼ばれます。
DALL·E.アプリには、OpenAI API からイメージを取得する`get_image`関数があります。イベントハンドラの最後で UI の更新がかかるため、関数の途中に`yield`を入れることで先に UI を更新しています。
### **ルーティング**
最後に、アプリを定義します。
```python
app = rx.App()
```
アプリにページを追加し、ドキュメントルートを index コンポーネントにルーティングしています。更に、ページのプレビューやブラウザタブに表示されるタイトルを記載しています。
```python
app.add_page(index, title="DALL-E")
```
ページを追加することで、マルチページアプリケーションを作成できます。
## 📑 リソース
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Component Library](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ ステータス
2022 年 12 月に、Reflex は Pynecone という名前でローンチしました。
2025 年から [Reflex Cloud](https://cloud.reflex.dev) がローンチされ、Reflex アプリケーションの最高のホスティング体験を提供しています。私たちは引き続き開発を続け、より多くの機能を実装していきます。
Reflex は毎週、新しいリリースや機能追加を行っています!最新情報を逃さないために、 :star: Star や :eyes: Watch をお願いします。
## コントリビュート
様々なサイズのコントリビュートを歓迎しています!Reflex コミュニティに入るための方法を、いくつかリストアップします。
- **Discord に参加**: [Discord](https://discord.gg/T5WSbC2YtQ)は、Reflex プロジェクトの相談や、コントリビュートについての話し合いをするための、最適な場所です。
- **GitHub Discussions**: GitHub Discussions では、追加したい機能や、複雑で解明が必要な事柄についての議論に適している場所です。
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues)はバグの報告に適している場所です。また、課題を解決した PR のサブミットにチャレンジしていただくことも、可能です。
スキルや経験に関わらず、私たちはコントリビュータを積極的に探しています。コントリビュートするために、[CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)をご覧ください。
## 私たちのコントリビュータに感謝!:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## ライセンス
Reflex はオープンソースであり、[Apache License 2.0](/LICENSE)に基づいてライセンス供与されます。
================================================
FILE: docs/kr/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ 순수 Python으로 고성능 사용자 정의 웹앱을 만들어 보세요. 몇 초만에 배포 가능합니다. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex는 순수 Python으로 풀스택 웹 앱을 구축하기 위한 라이브러리입니다.
주요 기능:
- **순수 Python** - 앱의 프론트엔드와 백엔드를 모두 Python으로 작성하며, Javascript를 배울 필요가 없습니다.
- **완전한 유연성** - Reflex는 시작하기 쉽지만, 복잡한 앱으로도 확장할 수 있습니다.
- **즉시 배포** - 앱을 빌드한 후 [단일 명령어](https://reflex.dev/docs/hosting/deploy-quick-start/)로 배포하거나 자체 서버에서 호스팅할 수 있습니다.
Reflex가 내부적으로 어떻게 작동하는지 알아보려면 [아키텍처 페이지](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture)를 참조하세요.
## ⚙️ 설치
터미널을 열고 실행하세요. (Python 3.10+ 필요):
```bash
pip install reflex
```
## 🥳 첫 앱 만들기
`reflex`를 설치하면, `reflex` 명령어 라인 도구도 설치됩니다.
새 프로젝트를 생성하여 설치가 성공적인지 확인합니다. (`my_app_name`을 프로젝트 이름으로 변경합니다.):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
이 명령어는 새 디렉토리에 템플릿 앱을 초기화합니다.
개발 모드에서 이 앱을 실행할 수 있습니다:
```bash
reflex run
```
http://localhost:3000 에서 앱이 실행 됩니다.
이제 `my_app_name/my_app_name.py`에서 소스코드를 수정할 수 있습니다. Reflex는 빠른 새로고침을 지원하므로 코드를 저장할 때마다 즉시 변경 사항을 볼 수 있습니다.
## 🫧 예시 앱
예시를 살펴보겠습니다: [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node)를 중심으로 이미지 생성 UI를 만들어 보겠습니다. 간단하게 하기 위해 [OpenAI API](https://platform.openai.com/docs/api-reference/authentication)를 호출했지만, 이를 로컬에서 실행되는 ML 모델로 대체할 수 있습니다.
<div align="center">
<img src="/docs/images/dalle.gif" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="550" />
</div>
이것이 완성된 코드입니다. 이 모든 것은 하나의 Python 파일에서 이루어집니다!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## 하나씩 살펴보겠습니다.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="Explaining the differences between backend and frontend parts of the DALL-E app." width="900" />
</div>
### **Reflex UI**
UI부터 시작해봅시다.
```python
def index():
return rx.center(
...
)
```
`index` 함수는 앱의 프론트엔드를 정의합니다.
`center`, `vstack`, `input`, `button`과 같은 다양한 컴포넌트를 사용하여 프론트엔드를 구축합니다.
컴포넌트들은 복잡한 레이아웃을 만들기 위해 서로 중첩될 수 있습니다.
그리고 키워드 인자를 사용하여 CSS의 모든 기능을 사용하여 스타일을 지정할 수 있습니다.
Reflex는 시작하기 위한 [60개 이상의 기본 컴포넌트](https://reflex.dev/docs/library)를 제공하고 있습니다. 더 많은 컴포넌트를 추가하고 있으며, [자신만의 컴포넌트를 생성하는 것](https://reflex.dev/docs/wrapping-react/overview/)도 쉽습니다.
### **State**
Reflex는 UI를 State 함수로 표현합니다.
```python
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
```
state는 앱에서 변경될 수 있는 모든 변수(vars로 불림)와 이러한 변수를 변경하는 함수를 정의합니다.
여기서 state는 `prompt`와 `image_url`로 구성됩니다. 또한 `processing`과 `complete`라는 불리언 값이 있습니다. 이 값들은 이미지 생성 중 버튼을 비활성화할 때와, 결과 이미지를 표시할 때를 나타냅니다.
### **Event Handlers**
```python
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
State 내에서, state vars를 변경하는 이벤트 핸들러라고 불리는 함수를 정의합니다. 이벤트 핸들러는 Reflex에서 state를 변경하는 방법입니다. 버튼을 클릭하거나 텍스트 상자에 입력하는 것과 같이 사용자 동작에 응답하여 호출될 수 있습니다. 이러한 동작을 이벤트라고 합니다.
DALL·E. 앱에는 OpenAI API에서 이미지를 가져오는 `get_image` 이벤트 핸들러가 있습니다. 이벤트 핸들러의 중간에 `yield`를 사용하면 UI가 업데이트됩니다. 그렇지 않으면 UI는 이벤트 핸들러의 끝에서 업데이트됩니다.
### **Routing**
마지막으로, 앱을 정의합니다.
```python
app = rx.App()
```
앱의 루트에서 index 컴포넌트로 페이지를 추가합니다. 또한 페이지 미리보기/브라우저 탭에 표시될 제목도 추가합니다.
```python
app.add_page(index, title="DALL-E")
```
여러 페이지를 추가하여 멀티 페이지 앱을 만들 수 있습니다.
## 📑 자료
<div align="center">
📑 [문서](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [블로그](https://reflex.dev/blog) | 📱 [컴포넌트 라이브러리](https://reflex.dev/docs/library) | 🖼️ [템플릿](https://reflex.dev/templates/) | 🛸 [배포](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ 상태
Reflex는 2022년 12월 Pynecone이라는 이름으로 출시되었습니다.
2025년부터 [Reflex Cloud](https://cloud.reflex.dev)가 출시되어 Reflex 앱을 위한 최상의 호스팅 경험을 제공합니다. 우리는 계속해서 개발하고 더 많은 기능을 구현할 예정입니다.
Reflex는 매주 새로운 릴리즈와 기능을 제공합니다! 최신 정보를 확인하려면 :star: Star와 :eyes: Watch를 눌러 이 저장소를 확인하세요.
## 기여
우리는 모든 기여를 환영합니다! 아래는 Reflex 커뮤니티에 참여하는 좋은 방법입니다.
- **Discord 참여**: 우리의 [Discord](https://discord.gg/T5WSbC2YtQ)는 Reflex 프로젝트에 대한 도움을 받고 기여하는 방법을 논의하는 최고의 장소입니다.
- **GitHub Discussions**: 추가하고 싶은 기능이나 혼란스럽거나 해결이 필요한 것들에 대해 이야기하는 좋은 방법입니다.
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues)는 버그를 보고하는 훌륭한 방법입니다. 또한, 기존의 이슈를 해결하고 PR을 제출할 수 있습니다.
우리는 능력이나 경험에 상관없이 적극적으로 기여자를 찾고 있습니다. 기여하려면 [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)를 확인하세요.
## 모든 기여자들에게 감사드립니다:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## License
Reflex는 오픈소스이며 [Apache License 2.0](/LICENSE)로 라이선스가 부여됩니다.
================================================
FILE: docs/pe/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ برنامه های تحت وب قابل تنظیم، کارآمد تماما پایتونی که در چند ثانیه مستقر(دپلوی) میشود. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex - رفلکس
رفلکس(Reflex) یک کتابخانه برای ساخت برنامه های وب فول استک تماما پایتونی است.
ویژگی های کلیدی:
- **تماما پایتونی** - فرانت اند و بک اند برنامه خود را همه در پایتون بنویسید، بدون نیاز به یادگیری جاوا اسکریپت.
- **انعطاف پذیری کامل** - شروع به کار با Reflex آسان است، اما می تواند به برنامه های پیچیده نیز تبدیل شود.
- **دپلوی فوری** - پس از ساخت، برنامه خود را با [یک دستور](https://reflex.dev/docs/hosting/deploy-quick-start/) دپلوی کنید یا آن را روی سرور خود میزبانی کنید.
برای آشنایی با نحوه عملکرد Reflex [صفحه معماری](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) را ببینید.
## ⚙️ Installation - نصب و راه اندازی
یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.10+):
```bash
pip install reflex
```
## 🥳 اولین برنامه خود را ایجاد کنید
نصب `reflex` همچنین `reflex` در خط فرمان را نصب میکند.
با ایجاد یک پروژه جدید موفقیت آمیز بودن نصب را تست کنید. (`my_app_name` را با اسم پروژه خودتان جایگزین کنید):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
این دستور یک برنامه الگو(تمپلیت) را در فهرست(دایرکتوری) جدید شما مقداردهی اولیه می کند
می توانید این برنامه را در حالت توسعه(development) اجرا کنید:
```bash
reflex run
```
باید برنامه خود را در حال اجرا ببینید در http://localhost:3000.
اکنون میتوانید کد منبع را در «my_app_name/my_app_name.py» تغییر دهید. Reflex دارای تازهسازیهای سریعی است، بنابراین میتوانید تغییرات خود را بلافاصله پس از ذخیره کد خود مشاهده کنید.
## 🫧 Example App - برنامه نمونه
بیایید یک مثال بزنیم: ایجاد یک رابط کاربری برای تولید تصویر [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). برای سادگی، ما فراخوانی میکنیم [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), اما می توانید آن را با یک مدل ML که به صورت محلی اجرا می شود جایگزین کنید.
<div align="center">
<img src="/docs/images/dalle.gif" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="550" />
</div>
در اینجا کد کامل برای ایجاد این پروژه آمده است. همه اینها در یک فایل پایتون انجام می شود!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## بیاید سادش کنیم
<div align="center">
<img src="docs/images/dalle_colored_code_example.png" alt="Explaining the differences between backend and frontend parts of the DALL-E app." width="900" />
</div>
### **Reflex UI - رابط کاربری رفلکس**
بیایید با رابط کاربری شروع کنیم.
```python
def index():
return rx.center(
...
)
```
تابع `index` قسمت فرانت اند برنامه را تعریف می کند.
ما از اجزای مختلفی مثل `center`, `vstack`, `input` و `button` استفاده میکنیم تا فرانت اند را بسازیم. اجزاء را می توان درون یکدیگر قرار داد
برای ایجاد طرح بندی های پیچیده می توانید از args کلمات کلیدی برای استایل دادن به آنها از CSS استفاده کنید.
رفلکس دارای [بیش از 60 جزء](https://reflex.dev/docs/library) برای کمک به شما برای شروع. ما به طور فعال اجزای بیشتری را اضافه می کنیم, و این خیلی آسان است که [اجزا خود را بسازید](https://reflex.dev/docs/wrapping-react/overview/).
### **State - حالت**
رفلکس رابط کاربری شما را به عنوان تابعی از وضعیت شما نشان می دهد.
```python
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
```
حالت تمام متغیرها(variables) (به نام vars) را در یک برنامه که می توانند تغییر دهند و توابعی که آنها را تغییر می دهند تعریف می کند..
در اینجا حالت از یک `prompt` و `image_url` تشکیل شده است. همچنین دو بولی `processing` و `complete` برای نشان دادن زمان غیرفعال کردن دکمه (در طول تولید تصویر) و زمان نمایش تصویر نتیجه وجود دارد.
### **Event Handlers - کنترل کنندگان رویداد**
```python
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
در داخل حالت، توابعی به نام کنترل کننده رویداد تعریف می کنیم که متغیرهای حالت را تغییر می دهند. کنترل کننده های رویداد راهی هستند که می توانیم وضعیت را در Reflex تغییر دهیم. آنها را می توان در پاسخ به اقدامات کاربر، مانند کلیک کردن روی یک دکمه یا تایپ کردن در یک متن، فراخوانی کرد. به این اعمال وقایع می گویند.
برنامه DALL·E ما دارای یک کنترل کننده رویداد، `get_image` است که این تصویر را از OpenAI API دریافت می کند. استفاده از `yield` در وسط کنترلکننده رویداد باعث بهروزرسانی رابط کاربری میشود. در غیر این صورت رابط کاربری در پایان کنترل کننده رویداد به روز می شود.
### **Routing - مسیریابی**
بالاخره اپلیکیشن خود را تعریف می کنیم.
```python
app = rx.App()
```
ما یک صفحه از root برنامه را به جزء index اضافه می کنیم. ما همچنین عنوانی را اضافه می کنیم که در برگه پیش نمایش/مرورگر صفحه نمایش داده می شود.
```python
app.add_page(index, title="DALL-E")
```
با افزودن صفحات بیشتر می توانید یک برنامه چند صفحه ای ایجاد کنید.
## 📑 Resources - منابع
<div align="center">
📑 [اسناد](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [وبلاگ](https://reflex.dev/blog) | 📱 [کتابخانه جزء](https://reflex.dev/docs/library) | 🖼️ [قالب ها](https://reflex.dev/templates/) | 🛸 [استقرار](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Status - وضعیت
رفلکس(reflex) در دسامبر 2022 با نام Pynecone راه اندازی شد.
از سال 2025، [Reflex Cloud](https://cloud.reflex.dev) برای فراهم کردن بهترین تجربه میزبانی برای برنامه های Reflex راهاندازی شده است. ما به توسعه آن ادامه خواهیم داد و ویژگیهای بیشتری را پیادهسازی خواهیم کرد.
رفلکس(reflex) هر هفته نسخه ها و ویژگی های جدیدی دارد! مطمئن شوید که :star: ستاره و :eyes: این مخزن را تماشا کنید تا به روز بمانید.
## Contributing - مشارکت کردن
ما از مشارکت در هر اندازه استقبال می کنیم! در زیر چند راه خوب برای شروع در انجمن رفلکس آورده شده است.
- **به Discord ما بپیوندید**: [Discord](https://discord.gg/T5WSbC2YtQ) ما بهترین مکان برای دریافت کمک در مورد پروژه Reflex و بحث در مورد اینکه چگونه می توانید کمک کنید است.
- **بحث های GitHub**: راهی عالی برای صحبت در مورد ویژگی هایی که می خواهید اضافه کنید یا چیزهایی که گیج کننده هستند/نیاز به توضیح دارند.
- **قسمت مشکلات GitHub**: [قسمت مشکلات](https://github.com/reflex-dev/reflex/issues) یک راه عالی برای گزارش اشکال هستند. علاوه بر این، می توانید یک مشکل موجود را حل کنید و یک PR(pull request) ارسال کنید.
ما فعالانه به دنبال مشارکت کنندگان هستیم، فارغ از سطح مهارت یا تجربه شما. برای مشارکت [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md) را بررسی کنید.
## All Thanks To Our Contributors - با تشکر از همکاران ما:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## License - مجوز
رفلکس متن باز و تحت مجوز [Apache License 2.0](/LICENSE) است.
================================================
FILE: docs/pt/pt_br/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ Web apps customizáveis, performáticos, em Python puro. Faça deploy em segundos. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex é uma biblioteca para construir aplicações web full-stack em Python puro.
Principais características:
- **Python Puro** - Escreva o frontend e o backend da sua aplicação inteiramente em Python, sem necessidade de aprender Javascript.
- **Flexibilidade Total** - O Reflex é fácil de começar a usar, mas também pode escalar para aplicações complexas.
- **Deploy Instantâneo** - Após a construção, faça o deploy da sua aplicação com um [único comando](https://reflex.dev/docs/hosting/deploy-quick-start/) ou hospede-a em seu próprio servidor.
Veja nossa [página de arquitetura](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) para aprender como o Reflex funciona internamente.
## ⚙️ Instalação
Abra um terminal e execute (Requer Python 3.10+):
```bash
pip install reflex
```
## 🥳 Crie o seu primeiro app
Instalar `reflex` também instala a ferramenta de linha de comando `reflex`.
Crie um novo projeto para verificar se a instalação foi bem sucedida. (Mude `nome_do_meu_app` com o nome do seu projeto):
```bash
mkdir nome_do_meu_app
cd nome_do_meu_app
reflex init
```
Este comando inicializa um app base no seu novo diretório.
Você pode executar este app em modo desenvolvimento:
```bash
reflex run
```
Você deve conseguir verificar seu app sendo executado em http://localhost:3000.
Agora, você pode modificar o código fonte em `nome_do_meu_app/nome_do_meu_app.py`. O Reflex apresenta recarregamento rápido para que você possa ver suas mudanças instantaneamente quando você salva o seu código.
## 🫧 Exemplo de App
Veja o seguinte exemplo: criar uma interface de criação de imagens por meio do [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Para fins de simplicidade, vamos apenas chamar a [API da OpenAI](https://platform.openai.com/docs/api-reference/authentication), mas você pode substituir esta solução por um modelo de ML executado localmente.
<div align="center">
<img src="/docs/images/dalle.gif" alt="Um encapsulador frontend para o DALL-E, mostrado no processo de criação de uma imagem." width="550" />
</div>
Aqui está o código completo para criar este projeto. Isso tudo foi feito apenas em um arquivo Python!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""Estado da aplicação."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Obtenção da imagem a partir do prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Adição do estado e da página no app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Vamos por partes.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="Explicando as diferenças entre as partes de backend e frontend do app DALL-E." width="900" />
</div>
### **Reflex UI**
Vamos começar com a UI (Interface de Usuário)
```python
def index():
return rx.center(
...
)
```
Esta função `index` define o frontend do app.
Usamos diferentes componentes, como `center`, `vstack`, `input` e `button`, para construir o frontend. Componentes podem ser aninhados um no do outro
para criar layouts mais complexos. E você pode usar argumentos de chave-valor para estilizá-los com todo o poder do CSS.
O Reflex vem com [60+ componentes nativos](https://reflex.dev/docs/library) para te ajudar a começar. Estamos adicionando ativamente mais componentes, e é fácil [criar seus próprios componentes](https://reflex.dev/docs/wrapping-react/overview/).
### **Estado**
O Reflex representa a sua UI como uma função do seu estado.
```python
class State(rx.State):
"""Estado da aplicação."""
prompt = ""
image_url = ""
processing = False
complete = False
```
O estado define todas as variáveis (chamadas de vars) em um app que podem mudar e as funções que as alteram.
Aqui, o estado é composto por um `prompt` e uma `image_url`. Há também os booleanos `processing` e `complete` para indicar quando desabilitar o botão (durante a geração da imagem) e quando mostrar a imagem resultante.
### **Handlers de Eventos**
```python
def get_image(self):
"""Obtenção da imagem a partir do prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Dentro do estado, são definidas funções chamadas de Handlers de Eventos, que podem mudar as variáveis do estado. Handlers de Eventos são a forma com a qual podemos modificar o estado dentro do Reflex. Eles podem ser chamados como resposta a uma ação do usuário, como o clique de um botão ou a escrita em uma caixa de texto. Estas ações são chamadas de eventos.
Nosso app DALL-E possui um Handler de Evento chamado `get_image`, que obtêm a imagem da API da OpenAI. Usar `yield` no meio de um Handler de Evento causa a atualização da UI do seu app. Caso contrário, a UI seria atualizada no fim da execução de um Handler de Evento.
### **Rotas**
Finalmente, definimos nosso app.
```python
app = rx.App()
```
Adicionamos uma página na raíz do app, apontando para o componente index. Também adicionamos um título que irá aparecer na visualização da página/aba do navegador.
```python
app.add_page(index, title="DALL-E")
```
Você pode criar um app com múltiplas páginas adicionando mais páginas.
## 📑 Recursos
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Biblioteca de Componentes](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Status
O Reflex foi lançado em Dezembro de 2022 com o nome Pynecone.
A partir de 2025, o [Reflex Cloud](https://cloud.reflex.dev) foi lançado para fornecer a melhor experiência de hospedagem para apps Reflex. Continuaremos a desenvolvê-lo e implementar mais recursos.
O Reflex tem novas versões e recursos chegando toda semana! Certifique-se de marcar com :star: estrela e :eyes: observar este repositório para se manter atualizado.
## Contribuições
Nós somos abertos a contribuições de qualquer tamanho! Abaixo, seguem algumas boas formas de começar a contribuir para a comunidade do Reflex.
- **Entre no nosso Discord**: Nosso [Discord](https://discord.gg/T5WSbC2YtQ) é o melhor lugar para conseguir ajuda no seu projeto Reflex e para discutir como você pode contribuir.
- **Discussões no GitHub**: Uma boa forma de conversar sobre funcionalidades que você gostaria de ver ou coisas que ainda estão confusas/exigem ajuda.
- **Issues no GitHub**: [Issues](https://github.com/reflex-dev/reflex/issues) são uma excelente forma de reportar bugs. Além disso, você pode tentar resolver alguma issue existente e enviar um PR.
Estamos ativamente buscando novos contribuidores, não importa o seu nível de habilidade ou experiência. Para contribuir, confira [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md).
## Todo Agradecimento aos Nossos Contribuidores:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## Licença
O Reflex é de código aberto e licenciado sob a [Apache License 2.0](/LICENSE).
================================================
FILE: docs/tr/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ Saf Python'da performanslı, özelleştirilebilir web uygulamaları. Saniyeler içinde dağıtın. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex, saf Python'da tam yığın web uygulamaları oluşturmak için bir kütüphanedir.
Temel özellikler:
- **Saf Python** - Uygulamanızın ön uç ve arka uç kısımlarının tamamını Python'da yazın, Javascript öğrenmenize gerek yok.
- **Tam Esneklik** - Reflex ile başlamak kolaydır, ancak karmaşık uygulamalara da ölçeklenebilir.
- **Anında Dağıtım** - Oluşturduktan sonra, uygulamanızı [tek bir komutla](https://reflex.dev/docs/hosting/deploy-quick-start/) dağıtın veya kendi sunucunuzda barındırın.
Reflex'in perde arkasında nasıl çalıştığını öğrenmek için [mimari sayfamıza](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) göz atın.
## ⚙️ Kurulum
Bir terminal açın ve çalıştırın (Python 3.10+ gerekir):
```bash
pip install reflex
```
## 🥳 İlk Uygulamanı Oluştur
`reflex`'i kurduğunuzda `reflex` komut satırı aracınıda kurmuş olursunuz.
Kurulumun başarılı olduğunu test etmek için yeni bir proje oluşturun. (`my_app_name`'i proje ismiyle değiştirin.):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
Bu komut ile birlikte yeni oluşturduğunuz dizinde bir şablon uygulaması oluşturur.
Uygulamanızı geliştirme modunda başlatabilirsiniz:
```bash
reflex run
```
Uygulamanızın http://localhost:3000 adresinde çalıştığını görmelisiniz.
Şimdi `my_app_name/my_app_name.py` yolundaki kaynak kodu düzenleyebilirsiniz. Reflex'in hızlı yenileme özelliği vardır, böylece kodunuzu kaydettiğinizde değişikliklerinizi anında görebilirsiniz.
## 🫧 Örnek Uygulama
Bir örnek üzerinden gidelim: [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node) kullanarak bir görüntü oluşturma arayüzü oluşturalım. Basit olması açısından, yalnızca [OpenAI API](https://platform.openai.com/docs/api-reference/authentication)'ını kullanıyoruz, ancak bunu yerel olarak çalıştırılan bir ML modeliyle değiştirebilirsiniz.
<div align="center">
<img src="/docs/images/dalle.gif" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="550" />
</div>
İşte bunu oluşturmak için kodun tamamı. Her şey sadece bir Python dosyasıyla hazırlandı!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""Uygulama durumu."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Prompt'tan görüntüyü alın."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Sayfa ve durumu uygulamaya ekleyin.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Daha Detaylı İceleyelim
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="DALL-E uygulamasının arka uç ve ön uç kısımları arasındaki farkları açıklama." width="900" />
</div>
### **Reflex UI**
UI (Kullanıcı Arayüzü) ile başlayalım.
```python
def index():
return rx.center(
...
)
```
Bu `index` fonkisyonu uygulamanın frontend'ini tanımlar.
Frontend'i oluşturmak için `center`, `vstack`, `input`, ve `button` gibi farklı bileşenler kullanıyoruz. Karmaşık düzenler oluşturmak için bileşenleri birbirinin içine yerleştirilebiliriz. Ayrıca bunları CSS'nin tüm gücüyle şekillendirmek için anahtar kelime argümanları kullanabilirsiniz.
Reflex, işinizi kolaylaştırmak için [60'tan fazla dahili bileşen](https://reflex.dev/docs/library) içerir. Aktif olarak yeni bileşen ekliyoruz ve [kendi bileşenlerinizi oluşturmak](https://reflex.dev/docs/wrapping-react/overview/) oldukça kolay.
### **Durum (State)**
Reflex arayüzünüzü durumunuzun bir fonksiyonu olarak temsil eder.
```python
class State(rx.State):
"""Uygulama durumu."""
prompt = ""
image_url = ""
processing = False
complete = False
```
Durum (State), bir uygulamadaki değişebilen tüm değişkenleri (vars olarak adlandırılır) ve bunları değiştiren fonksiyonları tanımlar.
Burada durum `prompt` ve `image_url`inden oluşur. Ayrıca düğmenin ne zaman devre dışı bırakılacağını (görüntü oluşturma sırasında) ve görüntünün ne zaman gösterileceğini belirtmek için `processing` ve `complete` booleanları da vardır.
### **Olay İşleyicileri (Event Handlers)**
```python
def get_image(self):
"""Prompt'tan görüntüyü alın."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Durum içinde, durum değişkenlerini değiştiren olay işleyicileri adı verilen fonksiyonları tanımlarız. Olay işleyicileri, Reflex'te durumu değiştirebilmemizi sağlar. Bir düğmeye tıklamak veya bir metin kutusuna yazı yazmak gibi kullanıcı eylemlerine yanıt olarak çağrılabilirler. Bu eylemlere olay denir.
DALL·E uygulamamız OpenAI API'ından bu görüntüyü almak için `get_image` adlı bir olay işleyicisine sahiptir. Bir olay işleyicisinin ortasında `yield`ın kullanılması UI'ın güncellenmesini sağlar. Aksi takdirde UI olay işleyicisinin sonunda güncellenecektir.
### **Yönlendirme (Routing)**
En sonunda uygulamamızı tanımlıyoruz.
```python
app = rx.App()
```
Uygulamamızın kök dizinine index bileşeninden bir sayfa ekliyoruz. Ayrıca sayfa önizlemesinde/tarayıcı sekmesinde görünecek bir başlık ekliyoruz.
```python
app.add_page(index, title="DALL-E")
```
Daha fazla sayfa ekleyerek çok sayfalı bir uygulama oluşturabilirsiniz.
## 📑 Kaynaklar
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Component Library](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Durum
Reflex, Aralık 2022'de Pynecone adıyla piyasaya sürüldü.
2025'in başından itibaren, Reflex uygulamaları için en iyi barındırma deneyimini sunmak amacıyla [Reflex Cloud](https://cloud.reflex.dev) hizmete girmiştir. Bunu geliştirmeye ve daha fazla özellik eklemeye devam edeceğiz.
Reflex'in her hafta yeni sürümleri ve özellikleri geliyor! Güncel kalmak için bu depoyu :star: yıldızlamayı ve :eyes: izlediğinizden emin olun.
## Katkı
Her boyuttaki katkıları memnuniyetle karşılıyoruz! Aşağıda Reflex topluluğuna adım atmanın bazı yolları mevcut.
- **Discord Kanalımıza Katılın**: [Discord'umuz](https://discord.gg/T5WSbC2YtQ), Reflex projeniz hakkında yardım almak ve nasıl katkıda bulunabileceğinizi tartışmak için en iyi yerdir.
- **GitHub Discussions**: Eklemek istediğiniz özellikler veya kafa karıştırıcı, açıklığa kavuşturulması gereken şeyler hakkında konuşmanın harika bir yolu.
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) hataları bildirmenin mükemmel bir yoludur. Ayrıca mevcut bir sorunu deneyip çözebilir ve bir PR (Pull Requests) gönderebilirsiniz.
Beceri düzeyiniz veya deneyiminiz ne olursa olsun aktif olarak katkıda bulunacak kişiler arıyoruz. Katkı sağlamak için katkı sağlama rehberimize bakabilirsiniz: [CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)
## Hepsi Katkıda Bulunanlar Sayesinde:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## Lisans
Reflex açık kaynaklıdır ve [Apache License 2.0](/LICENSE) altında lisanslıdır.
================================================
FILE: docs/vi/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ Ứng dụng web hiệu suất cao, tùy chỉnh bằng Python thuần. Deploy trong vài giây. ✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex là một thư viện để xây dựng ứng dụng web toàn bộ bằng Python thuần.
Các tính năng chính:
- **Python thuần tuý** - Viết toàn bộ ứng dụng cả backend và frontend hoàn toàn bằng Python, không cần học JavaScript.
- **Full Flexibility** - Reflex dễ dàng để bắt đầu, nhưng cũng có thể mở rộng lên các ứng dụng phức tạp.
- **Deploy Instantly** - Sau khi xây dựng ứng dụng, bạn có thể triển khai bằng [một dòng lệnh](https://reflex.dev/docs/hosting/deploy-quick-start/) hoặc triển khai trên server của riêng bạn.
Đọc [bài viết về kiến trúc hệ thống](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) để hiểu rõ các hoạt động của Reflex.
## ⚙️ Cài đặt
Mở cửa sổ lệnh và chạy (Yêu cầu Python phiên bản 3.10+):
```bash
pip install reflex
```
## 🥳 Tạo ứng dụng đầu tiên
Cài đặt `reflex` cũng như cài đặt công cụ dòng lệnh `reflex`.
Kiểm tra việc cài đặt đã thành công hay chưa bằng cách tạo mới một ứng dụng. (Thay `my_app_name` bằng tên ứng dụng của bạn):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
Lệnh này tạo ra một ứng dụng mẫu trong một thư mục mới.
Bạn có thể chạy ứng dụng ở chế độ phát triển.
```bash
reflex run
```
Bạn có thể xem ứng dụng của bạn ở địa chỉ http://localhost:3000.
Bạn có thể thay đổi mã nguồn ở `my_app_name/my_app_name.py`. Reflex nhanh chóng làm mới và bạn có thể thấy thay đổi trên ứng dụng của bạn ngay lập tức khi bạn lưu file.
## 🫧 Ứng dụng ví dụ
Bắt đầu với ví dụ: tạo một ứng dụng tạo ảnh bằng [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Để cho đơn giản, chúng ta sẽ sử dụng [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), nhưng bạn có thể sử dụng model của chính bạn được triển khai trên local.
<div align="center">
<img src="/docs/images/dalle.gif" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="550" />
</div>
Đây là toàn bộ đoạn mã để xây dựng ứng dụng trên. Nó được viết hoàn toàn trong một file Python!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## Hãy phân tích chi tiết.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="Explaining the differences between backend and frontend parts of the DALL-E app." width="900" />
</div>
### **Reflex UI**
Bắt đầu với giao diện chính.
```python
def index():
return rx.center(
...
)
```
Hàm `index` định nghĩa phần giao diện chính của ứng dụng.
Chúng tôi sử dụng các component (thành phần) khác nhau như `center`, `vstack`, `input` và `button` để xây dựng giao diện phía trước.
Các component có thể được lồng vào nhau để tạo ra các bố cục phức tạp. Và bạn cũng có thể sử dụng từ khoá `args` để tận dụng đầy đủ sức mạnh của CSS.
Reflex có đến hơn [60 component được xây dựng sẵn](https://reflex.dev/docs/library) để giúp bạn bắt đầu. Chúng ta có thể tạo ra một component mới khá dễ dàng, thao khảo: [xây dựng component của riêng bạn](https://reflex.dev/docs/wrapping-react/overview/).
### **State**
Reflex biểu diễn giao diện bằng các hàm của state (trạng thái).
```python
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
```
Một state định nghĩa các biến (được gọi là vars) có thể thay đổi trong một ứng dụng và cho phép các hàm có thể thay đổi chúng.
Tại đây state được cấu thành từ một `prompt` và `image_url`.
Có cũng những biến boolean `processing` và `complete`
để chỉ ra khi nào tắt nút (trong quá trình tạo hình ảnh)
và khi nào hiển thị hình ảnh kết quả.
### **Event Handlers**
```python
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
Với các state, chúng ta định nghĩa các hàm có thể thay đổi state vars được gọi là event handlers. Event handler là cách chúng ta có thể thay đổi state trong Reflex. Chúng có thể là phản hồi khi người dùng thao tác, chằng hạn khi nhấn vào nút hoặc khi đang nhập trong text box. Các hành động này được gọi là event.
Ứng dụng DALL·E. của chúng ta có một event handler, `get_image` để lấy hình ảnh từ OpenAI API. Sử dụng từ khoá `yield` in ở giữa event handler để cập nhật giao diện. Hoặc giao diện có thể cập nhật ở cuối event handler.
### **Routing**
Cuối cùng, chúng ta định nghĩa một ứng dụng.
```python
app = rx.App()
```
Chúng ta thêm một trang ở đầu ứng dụng bằng index component. Chúng ta cũng thêm tiêu đề của ứng dụng để hiển thị lên trình duyệt.
```python
app.add_page(index, title="DALL-E")
```
Bạn có thể tạo một ứng dụng nhiều trang bằng cách thêm trang.
## 📑 Tài liệu
<div align="center">
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Component Library](https://reflex.dev/docs/library) | 🖼️ [Templates](https://reflex.dev/templates/) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)
</div>
## ✅ Status
Reflex phát hành vào tháng 12/2022 với tên là Pynecone.
Từ năm 2025, [Reflex Cloud](https://cloud.reflex.dev) đã ra mắt để cung cấp trải nghiệm lưu trữ tốt nhất cho các ứng dụng Reflex. Chúng tôi sẽ tiếp tục phát triển và triển khai thêm nhiều tính năng mới.
Reflex ra phiên bản mới với các tính năng mới hàng tuần! Hãy :star: star và :eyes: watch repo này để thấy các cập nhật mới nhất.
## Contributing
Chúng tôi chào đón mọi đóng góp dù lớn hay nhỏ. Dưới đây là các cách để bắt đầu với cộng đồng Reflex.
- **Discord**: [Discord](https://discord.gg/T5WSbC2YtQ) của chúng tôi là nơi tốt nhất để nhờ sự giúp đỡ và thảo luận các bạn có thể đóng góp.
- **GitHub Discussions**: Là cách tốt nhất để thảo luận về các tính năng mà bạn có thể đóng góp hoặc những điều bạn chưa rõ.
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) là nơi tốt nhất để thông báo. Ngoài ra bạn có thể sửa chữa các vấn đề bằng cách tạo PR.
Chúng tôi luôn sẵn sàng tìm kiếm các contributor, bất kể kinh nghiệm. Để tham gia đóng góp, xin mời xem
[CONTRIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)
## Xin cảm ơn các Contributors:
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
</a>
## License
Reflex là mã nguồn mở và sử dụng giấy phép [Apache License 2.0](/LICENSE).
================================================
FILE: docs/zh/zh_cn/README.md
================================================
<div align="center">
<img src="/docs/images/reflex.svg" alt="Reflex Logo" width="300px">
<hr>
### **✨ 使用 Python 创建高效且可自定义的网页应用程序,几秒钟内即可部署.✨**
[](https://badge.fury.io/py/reflex)

[](https://reflex.dev/docs/getting-started/introduction)
[](https://pepy.tech/projects/reflex)
[](https://discord.gg/T5WSbC2YtQ)
</div>
---
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
---
# Reflex
Reflex 是一个使用纯 Python 构建全栈 web 应用的库。
关键特性:
- **纯 Python** - 前端、后端开发全都使用 Python,不需要学习 Javascript。
- **完整的灵活性** - Reflex 很容易上手, 并且也可以扩展到复杂的应用程序。
- **立即部署** - 构建后,使用[单个命令](https://reflex.dev/docs/hosting/deploy-quick-start/)就能部署应用程序;或者也可以将其托管在您自己的服务器上。
请参阅我们的[架构页](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture)了解 Reflex 如何工作。
## ⚙️ 安装
打开一个终端并且运行(要求 Python3.10+):
```bash
pip install reflex
```
## 🥳 创建您的第一个应用程序
安装 Reflex 的同时也会安装 `reflex` 命令行工具.
通过创建一个新项目来测试是否安装成功(请把 my_app_name 替代为您的项目名字):
```bash
mkdir my_app_name
cd my_app_name
reflex init
```
这段命令会在新文件夹初始化一个应用程序模板.
您可以在开发者模式下运行这个应用程序:
```bash
reflex run
```
您可以看到您的应用程序运行在 http://localhost:3000.
现在您可以在以下位置修改代码 `my_app_name/my_app_name.py`,Reflex 拥有快速刷新(fast refresh),所以您可以在保存代码后马上看到更改.
## 🫧 范例
让我们来看一个例子: 创建一个使用 [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node) 进行图像生成的图形界面.为了保持范例简单,我们只使用 OpenAI API,但是您可以将其替换成本地端的 ML 模型.
<div align="center">
<img src="/docs/images/dalle.gif" alt="DALL·E的前端界面, 展示了图片生成的进程" width="550" />
</div>
这是这个范例的完整代码,只需要一个 Python 文件就可以完成!
```python
import reflex as rx
import openai
openai_client = openai.OpenAI()
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
def index():
return rx.center(
rx.vstack(
rx.heading("DALL-E", font_size="1.5em"),
rx.input(
placeholder="Enter a prompt..",
on_blur=State.set_prompt,
width="25em",
),
rx.button(
"Generate Image",
on_click=State.get_image,
width="25em",
loading=State.processing
),
rx.cond(
State.complete,
rx.image(src=State.image_url, width="20em"),
),
align="center",
),
width="100%",
height="100vh",
)
# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```
## 让我们分解以上步骤.
<div align="center">
<img src="/docs/images/dalle_colored_code_example.png" alt="解释 DALL-E app 的前端和后端部分的区别。" width="900" />
</div>
### **Reflex UI**
让我们从 UI 开始.
```python
def index():
return rx.center(
...
)
```
这个 `index` 函数定义了应用程序的前端.
我们用不同的组件比如 `center`, `vstack`, `input`, 和 `button` 来创建前端, 组件之间可以相互嵌入,来创建复杂的布局.
并且您可以使用关键字参数来使用 CSS 的全部功能.
Reflex 拥有 [60+ 个内置组件](https://reflex.dev/docs/library) 来帮助您开始创建应用程序. 我们正在积极添加组件, 但是您也可以容易的 [创建自己的组件](https://reflex.dev/docs/wrapping-react/overview/).
### **State**
Reflex 用 State 来渲染您的 UI.
```python
class State(rx.State):
"""The app state."""
prompt = ""
image_url = ""
processing = False
complete = False
```
State 定义了所有可能会发生变化的变量(称为 vars)以及能够改变这些变量的函数.
在这个范例中,State 由 `prompt` 和 `image_url` 组成.此外,State 还包含有两个布尔值 `processing` 和 `complete`,用于指示何时显示循环进度指示器和图像.
### **Event Handlers**
```python
def get_image(self):
"""Get the image from the prompt."""
if self.prompt == "":
return rx.window_alert("Prompt Empty")
self.processing, self.complete = True, False
yield
response = openai_client.images.generate(
prompt=self.prompt, n=1, size="1024x1024"
)
self.image_url = response.data[0].url
self.processing, self.complete = False, True
```
在 State 中,我们定义了称为事件处理器(event handlers)的函数,用于改变状态变量(state vars).在 Reflex 中,事件处理器是我们可以修改状态的方式.它们可以作为对用户操作的响应而被调用,例如点击一个按钮或在文本框中输入.这些操作被称为事件.
我们的 DALL·E 应用有一个事件处理器,名为 `get_image`,它用于从 OpenAI API 获取图像.在事件处理器中使用 `yield` 将导致 UI 进行更新.否则,UI 将在事件处理器结束时进行更新.
### **Routing**
最后,定义我们的应用程序.
```python
app = rx.App()
```
我们添加从应用程序根目录到 index 组件的路由.我们还添加了一个在页面预览或浏览器标签中显示的标题.
```python
gitextract_r7dp3u9n/
├── .devcontainer/
│ └── devcontainer.json
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── build_issue.md
│ │ ├── cloud_issue.md
│ │ ├── custom_component_request.md
│ │ ├── enhancement_request.md
│ │ ├── enterprise_issue.md
│ │ └── feature_request.md
│ ├── actions/
│ │ └── setup_build_env/
│ │ └── action.yml
│ ├── codeql-config.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── check_node_latest.yml
│ ├── check_outdated_dependencies.yml
│ ├── codeql.yml
│ ├── dependency-review.yml
│ ├── integration_app_harness.yml
│ ├── integration_tests.yml
│ ├── performance.yml
│ ├── pre-commit.yml
│ ├── publish.yml
│ ├── reflex_init_in_docker_test.yml
│ └── unit_tests.yml
├── .gitignore
├── .python-version
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── MCP_README.md
├── README.md
├── SECURITY.md
├── docker-example/
│ ├── README.md
│ ├── production-app-platform/
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ └── README.md
│ ├── production-compose/
│ │ ├── .dockerignore
│ │ ├── Caddy.Dockerfile
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── compose.prod.yaml
│ │ ├── compose.tools.yaml
│ │ └── compose.yaml
│ ├── production-one-port/
│ │ ├── .dockerignore
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ └── README.md
│ ├── simple-one-port/
│ │ ├── .dockerignore
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ └── README.md
│ └── simple-two-port/
│ ├── .dockerignore
│ ├── Dockerfile
│ └── README.md
├── docs/
│ ├── DEBUGGING.md
│ ├── de/
│ │ └── README.md
│ ├── es/
│ │ └── README.md
│ ├── in/
│ │ └── README.md
│ ├── it/
│ │ └── README.md
│ ├── ja/
│ │ └── README.md
│ ├── kr/
│ │ └── README.md
│ ├── pe/
│ │ └── README.md
│ ├── pt/
│ │ └── pt_br/
│ │ └── README.md
│ ├── tr/
│ │ └── README.md
│ ├── vi/
│ │ └── README.md
│ └── zh/
│ ├── zh_cn/
│ │ └── README.md
│ └── zh_tw/
│ └── README.md
├── pyi_hashes.json
├── pyproject.toml
├── reflex/
│ ├── .templates/
│ │ ├── apps/
│ │ │ └── blank/
│ │ │ └── code/
│ │ │ ├── __init__.py
│ │ │ └── blank.py
│ │ └── web/
│ │ ├── .gitignore
│ │ ├── app/
│ │ │ ├── entry.client.js
│ │ │ └── routes.js
│ │ ├── components/
│ │ │ ├── reflex/
│ │ │ │ └── radix_themes_color_mode_provider.js
│ │ │ └── shiki/
│ │ │ └── code.js
│ │ ├── jsconfig.json
│ │ ├── postcss.config.js
│ │ ├── react-router.config.js
│ │ ├── styles/
│ │ │ └── __reflex_style_reset.css
│ │ ├── utils/
│ │ │ ├── helpers/
│ │ │ │ ├── dataeditor.js
│ │ │ │ ├── debounce.js
│ │ │ │ ├── paste.js
│ │ │ │ ├── range.js
│ │ │ │ ├── throttle.js
│ │ │ │ └── upload.js
│ │ │ ├── react-theme.js
│ │ │ └── state.js
│ │ └── vite-plugin-safari-cachebust.js
│ ├── __init__.py
│ ├── __main__.py
│ ├── admin.py
│ ├── app.py
│ ├── app_mixins/
│ │ ├── __init__.py
│ │ ├── lifespan.py
│ │ ├── middleware.py
│ │ └── mixin.py
│ ├── assets.py
│ ├── base.py
│ ├── compiler/
│ │ ├── __init__.py
│ │ ├── compiler.py
│ │ ├── templates.py
│ │ └── utils.py
│ ├── components/
│ │ ├── __init__.py
│ │ ├── base/
│ │ │ ├── __init__.py
│ │ │ ├── app_wrap.py
│ │ │ ├── bare.py
│ │ │ ├── body.py
│ │ │ ├── document.py
│ │ │ ├── error_boundary.py
│ │ │ ├── fragment.py
│ │ │ ├── link.py
│ │ │ ├── meta.py
│ │ │ ├── script.py
│ │ │ └── strict_mode.py
│ │ ├── component.py
│ │ ├── core/
│ │ │ ├── __init__.py
│ │ │ ├── auto_scroll.py
│ │ │ ├── banner.py
│ │ │ ├── breakpoints.py
│ │ │ ├── clipboard.py
│ │ │ ├── colors.py
│ │ │ ├── cond.py
│ │ │ ├── debounce.py
│ │ │ ├── foreach.py
│ │ │ ├── helmet.py
│ │ │ ├── html.py
│ │ │ ├── layout/
│ │ │ │ └── __init__.py
│ │ │ ├── match.py
│ │ │ ├── responsive.py
│ │ │ ├── sticky.py
│ │ │ ├── upload.py
│ │ │ └── window_events.py
│ │ ├── datadisplay/
│ │ │ ├── __init__.py
│ │ │ ├── code.py
│ │ │ ├── dataeditor.py
│ │ │ ├── logo.py
│ │ │ └── shiki_code_block.py
│ │ ├── dynamic.py
│ │ ├── el/
│ │ │ ├── __init__.py
│ │ │ ├── element.py
│ │ │ └── elements/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── forms.py
│ │ │ ├── inline.py
│ │ │ ├── media.py
│ │ │ ├── metadata.py
│ │ │ ├── other.py
│ │ │ ├── scripts.py
│ │ │ ├── sectioning.py
│ │ │ ├── tables.py
│ │ │ └── typography.py
│ │ ├── field.py
│ │ ├── gridjs/
│ │ │ ├── __init__.py
│ │ │ └── datatable.py
│ │ ├── literals.py
│ │ ├── lucide/
│ │ │ ├── __init__.py
│ │ │ └── icon.py
│ │ ├── markdown/
│ │ │ ├── __init__.py
│ │ │ └── markdown.py
│ │ ├── moment/
│ │ │ ├── __init__.py
│ │ │ └── moment.py
│ │ ├── plotly/
│ │ │ ├── __init__.py
│ │ │ └── plotly.py
│ │ ├── props.py
│ │ ├── radix/
│ │ │ ├── __init__.py
│ │ │ ├── primitives/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── accordion.py
│ │ │ │ ├── base.py
│ │ │ │ ├── dialog.py
│ │ │ │ ├── drawer.py
│ │ │ │ ├── form.py
│ │ │ │ ├── progress.py
│ │ │ │ └── slider.py
│ │ │ └── themes/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── color_mode.py
│ │ │ ├── components/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── alert_dialog.py
│ │ │ │ ├── aspect_ratio.py
│ │ │ │ ├── avatar.py
│ │ │ │ ├── badge.py
│ │ │ │ ├── button.py
│ │ │ │ ├── callout.py
│ │ │ │ ├── card.py
│ │ │ │ ├── checkbox.py
│ │ │ │ ├── checkbox_cards.py
│ │ │ │ ├── checkbox_group.py
│ │ │ │ ├── context_menu.py
│ │ │ │ ├── data_list.py
│ │ │ │ ├── dialog.py
│ │ │ │ ├── dropdown_menu.py
│ │ │ │ ├── hover_card.py
│ │ │ │ ├── icon_button.py
│ │ │ │ ├── inset.py
│ │ │ │ ├── popover.py
│ │ │ │ ├── progress.py
│ │ │ │ ├── radio.py
│ │ │ │ ├── radio_cards.py
│ │ │ │ ├── radio_group.py
│ │ │ │ ├── scroll_area.py
│ │ │ │ ├── segmented_control.py
│ │ │ │ ├── select.py
│ │ │ │ ├── separator.py
│ │ │ │ ├── skeleton.py
│ │ │ │ ├── slider.py
│ │ │ │ ├── spinner.py
│ │ │ │ ├── switch.py
│ │ │ │ ├── table.py
│ │ │ │ ├── tabs.py
│ │ │ │ ├── text_area.py
│ │ │ │ ├── text_field.py
│ │ │ │ └── tooltip.py
│ │ │ ├── layout/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── base.py
│ │ │ │ ├── box.py
│ │ │ │ ├── center.py
│ │ │ │ ├── container.py
│ │ │ │ ├── flex.py
│ │ │ │ ├── grid.py
│ │ │ │ ├── list.py
│ │ │ │ ├── section.py
│ │ │ │ ├── spacer.py
│ │ │ │ └── stack.py
│ │ │ └── typography/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── blockquote.py
│ │ │ ├── code.py
│ │ │ ├── heading.py
│ │ │ ├── link.py
│ │ │ └── text.py
│ │ ├── react_player/
│ │ │ ├── __init__.py
│ │ │ ├── audio.py
│ │ │ ├── react_player.py
│ │ │ └── video.py
│ │ ├── react_router/
│ │ │ ├── __init__.py
│ │ │ └── dom.py
│ │ ├── recharts/
│ │ │ ├── __init__.py
│ │ │ ├── cartesian.py
│ │ │ ├── charts.py
│ │ │ ├── general.py
│ │ │ ├── polar.py
│ │ │ └── recharts.py
│ │ ├── sonner/
│ │ │ ├── __init__.py
│ │ │ └── toast.py
│ │ └── tags/
│ │ ├── __init__.py
│ │ ├── cond_tag.py
│ │ ├── iter_tag.py
│ │ ├── match_tag.py
│ │ ├── tag.py
│ │ └── tagless.py
│ ├── config.py
│ ├── constants/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── colors.py
│ │ ├── compiler.py
│ │ ├── config.py
│ │ ├── custom_components.py
│ │ ├── event.py
│ │ ├── installer.py
│ │ ├── route.py
│ │ ├── state.py
│ │ └── utils.py
│ ├── custom_components/
│ │ ├── __init__.py
│ │ └── custom_components.py
│ ├── environment.py
│ ├── event.py
│ ├── experimental/
│ │ ├── __init__.py
│ │ ├── client_state.py
│ │ └── hooks.py
│ ├── istate/
│ │ ├── __init__.py
│ │ ├── data.py
│ │ ├── dynamic.py
│ │ ├── manager/
│ │ │ ├── __init__.py
│ │ │ ├── disk.py
│ │ │ ├── memory.py
│ │ │ └── redis.py
│ │ ├── proxy.py
│ │ ├── shared.py
│ │ ├── storage.py
│ │ └── wrappers.py
│ ├── middleware/
│ │ ├── __init__.py
│ │ ├── hydrate_middleware.py
│ │ └── middleware.py
│ ├── model.py
│ ├── page.py
│ ├── plugins/
│ │ ├── __init__.py
│ │ ├── _screenshot.py
│ │ ├── base.py
│ │ ├── shared_tailwind.py
│ │ ├── sitemap.py
│ │ ├── tailwind_v3.py
│ │ └── tailwind_v4.py
│ ├── py.typed
│ ├── reflex.py
│ ├── route.py
│ ├── state.py
│ ├── style.py
│ ├── testing.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── build.py
│ │ ├── codespaces.py
│ │ ├── compat.py
│ │ ├── console.py
│ │ ├── decorator.py
│ │ ├── exceptions.py
│ │ ├── exec.py
│ │ ├── export.py
│ │ ├── format.py
│ │ ├── frontend_skeleton.py
│ │ ├── imports.py
│ │ ├── js_runtimes.py
│ │ ├── lazy_loader.py
│ │ ├── misc.py
│ │ ├── monitoring.py
│ │ ├── net.py
│ │ ├── path_ops.py
│ │ ├── prerequisites.py
│ │ ├── processes.py
│ │ ├── pyi_generator.py
│ │ ├── redir.py
│ │ ├── registry.py
│ │ ├── rename.py
│ │ ├── serializers.py
│ │ ├── tasks.py
│ │ ├── telemetry.py
│ │ ├── templates.py
│ │ ├── token_manager.py
│ │ └── types.py
│ └── vars/
│ ├── __init__.py
│ ├── base.py
│ ├── color.py
│ ├── datetime.py
│ ├── dep_tracking.py
│ ├── function.py
│ ├── number.py
│ ├── object.py
│ └── sequence.py
├── scripts/
│ ├── __init__.py
│ ├── bun_install.sh
│ ├── darglint_test.bat
│ ├── hatch_build.py
│ ├── install.ps1
│ ├── integration.sh
│ ├── make_pyi.py
│ └── wait_for_listening_port.py
└── tests/
├── __init__.py
├── benchmarks/
│ ├── __init__.py
│ ├── conftest.py
│ ├── fixtures.py
│ ├── test_compilation.py
│ └── test_evaluate.py
├── integration/
│ ├── __init__.py
│ ├── conftest.py
│ ├── init-test/
│ │ ├── Dockerfile
│ │ └── in_docker_test_script.sh
│ ├── shared/
│ │ └── state.py
│ ├── test_background_task.py
│ ├── test_call_script.py
│ ├── test_client_storage.py
│ ├── test_component_state.py
│ ├── test_computed_vars.py
│ ├── test_connection_banner.py
│ ├── test_deploy_url.py
│ ├── test_dynamic_components.py
│ ├── test_dynamic_routes.py
│ ├── test_event_actions.py
│ ├── test_event_chain.py
│ ├── test_exception_handlers.py
│ ├── test_extra_overlay_function.py
│ ├── test_form_submit.py
│ ├── test_icon.py
│ ├── test_input.py
│ ├── test_large_state.py
│ ├── test_lifespan.py
│ ├── test_linked_state.py
│ ├── test_login_flow.py
│ ├── test_media.py
│ ├── test_memo.py
│ ├── test_navigation.py
│ ├── test_server_side_event.py
│ ├── test_shared_state.py
│ ├── test_state_inheritance.py
│ ├── test_tailwind.py
│ ├── test_upload.py
│ ├── test_urls.py
│ ├── test_var_operations.py
│ ├── tests_playwright/
│ │ ├── test_appearance.py
│ │ ├── test_datetime_operations.py
│ │ ├── test_link_hover.py
│ │ ├── test_stateless_app.py
│ │ └── test_table.py
│ └── utils.py
├── test_node_version.py
└── units/
├── __init__.py
├── assets/
│ ├── custom_script.js
│ └── test_assets.py
├── compiler/
│ ├── __init__.py
│ ├── test_compiler.py
│ └── test_compiler_utils.py
├── components/
│ ├── __init__.py
│ ├── base/
│ │ ├── test_bare.py
│ │ ├── test_link.py
│ │ └── test_script.py
│ ├── core/
│ │ ├── __init__.py
│ │ ├── test_banner.py
│ │ ├── test_colors.py
│ │ ├── test_cond.py
│ │ ├── test_debounce.py
│ │ ├── test_foreach.py
│ │ ├── test_html.py
│ │ ├── test_match.py
│ │ ├── test_responsive.py
│ │ └── test_upload.py
│ ├── datadisplay/
│ │ ├── __init__.py
│ │ ├── conftest.py
│ │ ├── test_code.py
│ │ ├── test_dataeditor.py
│ │ ├── test_datatable.py
│ │ └── test_shiki_code.py
│ ├── el/
│ │ └── test_svg.py
│ ├── forms/
│ │ ├── __init__.py
│ │ └── test_form.py
│ ├── graphing/
│ │ ├── __init__.py
│ │ ├── test_plotly.py
│ │ └── test_recharts.py
│ ├── layout/
│ │ └── __init__.py
│ ├── lucide/
│ │ └── test_icon.py
│ ├── markdown/
│ │ ├── __init__.py
│ │ └── test_markdown.py
│ ├── media/
│ │ ├── __init__.py
│ │ └── test_image.py
│ ├── radix/
│ │ ├── test_icon_button.py
│ │ └── test_layout.py
│ ├── recharts/
│ │ ├── test_cartesian.py
│ │ └── test_polar.py
│ ├── test_component.py
│ ├── test_component_future_annotations.py
│ ├── test_component_state.py
│ ├── test_props.py
│ ├── test_tag.py
│ └── typography/
│ ├── __init__.py
│ └── test_markdown.py
├── conftest.py
├── istate/
│ ├── __init__.py
│ ├── manager/
│ │ ├── __init__.py
│ │ └── test_redis.py
│ └── test_proxy.py
├── middleware/
│ ├── __init__.py
│ ├── conftest.py
│ └── test_hydrate_middleware.py
├── mock_redis.py
├── plugins/
│ └── test_sitemap.py
├── states/
│ ├── __init__.py
│ ├── mutation.py
│ └── upload.py
├── test_app.py
├── test_attribute_access_type.py
├── test_base.py
├── test_config.py
├── test_db_config.py
├── test_environment.py
├── test_event.py
├── test_health_endpoint.py
├── test_model.py
├── test_page.py
├── test_prerequisites.py
├── test_route.py
├── test_sqlalchemy.py
├── test_state.py
├── test_state_tree.py
├── test_style.py
├── test_telemetry.py
├── test_testing.py
├── test_var.py
├── utils/
│ ├── __init__.py
│ ├── test_format.py
│ ├── test_imports.py
│ ├── test_processes.py
│ ├── test_serializers.py
│ ├── test_tasks.py
│ ├── test_token_manager.py
│ ├── test_types.py
│ └── test_utils.py
└── vars/
├── test_base.py
├── test_dep_tracking.py
├── test_dep_tracking_integration.py
└── test_object.py
Showing preview only (370K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4412 symbols across 348 files)
FILE: reflex/.templates/apps/blank/code/blank.py
class State (line 8) | class State(rx.State):
function index (line 12) | def index() -> rx.Component:
FILE: reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js
function RadixThemesColorModeProvider (line 5) | function RadixThemesColorModeProvider({ children }) {
FILE: reflex/.templates/web/components/shiki/code.js
function Code (line 15) | function Code({
FILE: reflex/.templates/web/utils/helpers/dataeditor.js
function getDEColumn (line 3) | function getDEColumn(columns, col) {
function getDERow (line 9) | function getDERow(data, row) {
function locateCell (line 13) | function locateCell(row, column) {
function formatCell (line 21) | function formatCell(value, column) {
function formatDataEditorCells (line 61) | function formatDataEditorCells(col, row, columns, data) {
FILE: reflex/.templates/web/utils/helpers/debounce.js
function debounce (line 10) | function debounce(name, func, delay) {
FILE: reflex/.templates/web/utils/helpers/paste.js
function usePasteHandler (line 37) | function usePasteHandler(target_ids, event_actions, on_paste) {
FILE: reflex/.templates/web/utils/helpers/range.js
function range (line 13) | function range(start, stop, step) {
FILE: reflex/.templates/web/utils/helpers/throttle.js
function throttle (line 10) | function throttle(name, limit) {
FILE: reflex/.templates/web/utils/react-theme.js
function ThemeProvider (line 19) | function ThemeProvider({ children, defaultTheme = "system" }) {
function useTheme (line 97) | function useTheme() {
FILE: reflex/.templates/web/utils/state.js
constant EVENTURL (line 26) | const EVENTURL = env.EVENT;
constant SAME_DOMAIN_HOSTNAMES (line 29) | const SAME_DOMAIN_HOSTNAMES = ["localhost", "0.0.0.0", "::", "0:0:0:0:0:...
constant TOKEN_KEY (line 35) | const TOKEN_KEY = "token";
function urlFrom (line 191) | function urlFrom(string) {
function checkVisibility (line 590) | function checkVisibility() {
FILE: reflex/.templates/web/vite-plugin-safari-cachebust.js
function safariCacheBustPlugin (line 30) | function safariCacheBustPlugin() {
function isSafari (line 48) | function isSafari(ua) {
function createSafariMiddleware (line 56) | function createSafariMiddleware() {
FILE: reflex/__init__.py
function __getattr__ (line 370) | def __getattr__(name: str):
FILE: reflex/admin.py
class AdminDash (line 13) | class AdminDash:
FILE: reflex/app.py
function default_frontend_exception_handler (line 139) | def default_frontend_exception_handler(exception: Exception) -> None:
function default_backend_exception_handler (line 149) | def default_backend_exception_handler(exception: Exception) -> EventSpec:
function extra_overlay_function (line 182) | def extra_overlay_function() -> Component | None:
function default_overlay_component (line 210) | def default_overlay_component() -> Component:
function default_error_boundary (line 233) | def default_error_boundary(*children: Component, **props) -> Component:
class UploadFile (line 251) | class UploadFile(StarletteUploadFile):
method filename (line 270) | def filename(self) -> str | None:
method name (line 279) | def name(self) -> str | None:
class UnevaluatedPage (line 293) | class UnevaluatedPage:
method merged_with (line 305) | def merged_with(self, other: UnevaluatedPage) -> UnevaluatedPage:
class App (line 329) | class App(MiddlewareMixin, LifespanMixin):
method event_namespace (line 462) | def event_namespace(self) -> EventNamespace | None:
method __post_init__ (line 470) | def __post_init__(self):
method _enable_state (line 512) | def _enable_state(self) -> None:
method _setup_state (line 518) | def _setup_state(self) -> None:
method __repr__ (line 603) | def __repr__(self) -> str:
method __call__ (line 611) | def __call__(self) -> ASGIApp:
method _add_default_endpoints (line 678) | def _add_default_endpoints(self):
method _add_optional_endpoints (line 695) | def _add_optional_endpoints(self):
method _add_cors (line 731) | def _add_cors(api: Starlette):
method state_manager (line 746) | def state_manager(self) -> StateManager:
method _generate_component (line 761) | def _generate_component(component: Component | ComponentCallable) -> C...
method add_page (line 774) | def add_page(
method _compile_page (line 877) | def _compile_page(self, route: str, save_page: bool = True):
method router (line 899) | def router(self) -> Callable[[str], str | None]:
method get_load_events (line 909) | def get_load_events(self, path: str) -> list[IndividualEventType[()]]:
method _check_routes_conflict (line 928) | def _check_routes_conflict(self, new_route: str):
method _setup_admin_dash (line 968) | def _setup_admin_dash(self):
method _get_frontend_packages (line 998) | def _get_frontend_packages(self, imports: dict[str, set[ImportVar]]):
method _app_root (line 1033) | def _app_root(self, app_wrappers: dict[tuple[int, str], Component]) ->...
method _should_compile (line 1051) | def _should_compile(self) -> bool:
method _add_overlay_to_component (line 1072) | def _add_overlay_to_component(
method _setup_overlay_component (line 1082) | def _setup_overlay_component(self):
method _setup_sticky_badge (line 1098) | def _setup_sticky_badge(self):
method _apply_decorated_pages (line 1110) | def _apply_decorated_pages(self):
method _validate_var_dependencies (line 1116) | def _validate_var_dependencies(self, state: type[BaseState] | None = N...
method _compile (line 1149) | def _compile(
method _write_stateful_pages_marker (line 1548) | def _write_stateful_pages_marker(self):
method add_all_routes_endpoint (line 1558) | def add_all_routes_endpoint(self):
method modify_state (line 1571) | async def modify_state(
method _process_background (line 1613) | def _process_background(
method _validate_exception_handlers (line 1664) | def _validate_exception_handlers(self):
function process (line 1757) | async def process(
function ping (line 1846) | def ping(_request: Request) -> Response:
function health (line 1858) | async def health(_request: Request) -> JSONResponse:
class _UploadStreamingResponse (line 1897) | class _UploadStreamingResponse(StreamingResponse):
method __init__ (line 1902) | def __init__(
method __call__ (line 1911) | async def __call__(self, scope: Scope, receive: Receive, send: Send) -...
function upload (line 1918) | def upload(app: App):
class EventNamespace (line 2065) | class EventNamespace(AsyncNamespace):
method __init__ (line 2071) | def __init__(self, namespace: str, app: App):
method token_to_sid (line 2085) | def token_to_sid(self) -> Mapping[str, str]:
method sid_to_token (line 2097) | def sid_to_token(self) -> dict[str, str]:
method on_connect (line 2106) | async def on_connect(self, sid: str, environ: dict):
method on_disconnect (line 2129) | def on_disconnect(self, sid: str) -> asyncio.Task | None:
method emit_update (line 2156) | async def emit_update(self, update: StateUpdate, token: str) -> None:
method on_event (line 2190) | async def on_event(self, sid: str, data: Any):
method on_ping (line 2274) | async def on_ping(self, sid: str):
method link_token_to_sid (line 2283) | async def link_token_to_sid(self, sid: str, token: str):
FILE: reflex/app_mixins/lifespan.py
class LifespanMixin (line 22) | class LifespanMixin(AppMixin):
method _run_lifespan_tasks (line 31) | async def _run_lifespan_tasks(self, app: Starlette):
method register_lifespan_task (line 82) | def register_lifespan_task(self, task: Callable | asyncio.Task, **task...
FILE: reflex/app_mixins/middleware.py
class MiddlewareMixin (line 16) | class MiddlewareMixin(AppMixin):
method _init_mixin (line 22) | def _init_mixin(self):
method add_middleware (line 25) | def add_middleware(self, middleware: Middleware, index: int | None = N...
method _preprocess (line 37) | async def _preprocess(self, state: BaseState, event: Event) -> StateUp...
method _postprocess (line 61) | async def _postprocess(
FILE: reflex/app_mixins/mixin.py
class AppMixin (line 7) | class AppMixin:
method _init_mixin (line 10) | def _init_mixin(self):
FILE: reflex/assets.py
function remove_stale_external_asset_symlinks (line 10) | def remove_stale_external_asset_symlinks():
function asset (line 39) | def asset(
FILE: reflex/base.py
class Base (line 10) | class Base(BaseModel, metaclass=ModelMetaclassLazyAnnotations):
class Config (line 20) | class Config:
method __init_subclass__ (line 27) | def __init_subclass__(cls):
method json (line 39) | def json(self) -> str:
class PydanticNotFoundFallback (line 54) | class PydanticNotFoundFallback:
method __init__ (line 57) | def __init__(self, *args, **kwargs):
FILE: reflex/compiler/compiler.py
function _apply_common_imports (line 36) | def _apply_common_imports(
function _compile_document_root (line 45) | def _compile_document_root(root: Component) -> str:
function _normalize_library_name (line 62) | def _normalize_library_name(lib: str) -> str:
function _compile_app (line 76) | def _compile_app(app_root: Component) -> str:
function _compile_theme (line 106) | def _compile_theme(theme: str) -> str:
function _compile_contexts (line 118) | def _compile_contexts(state: type[BaseState] | None, theme: Component | ...
function _compile_page (line 148) | def _compile_page(component: BaseComponent) -> str:
function compile_root_stylesheet (line 171) | def compile_root_stylesheet(
function _validate_stylesheet (line 190) | def _validate_stylesheet(stylesheet_full_path: Path, assets_app_path: Pa...
function _compile_root_stylesheet (line 228) | def _compile_root_stylesheet(stylesheets: list[str], reset_style: bool =...
function _compile_component (line 328) | def _compile_component(component: Component | StatefulComponent) -> str:
function _compile_memo_components (line 340) | def _compile_memo_components(
function _get_shared_components_recursive (line 390) | def _get_shared_components_recursive(
function _compile_stateful_components (line 431) | def _compile_stateful_components(
function compile_document_root (line 469) | def compile_document_root(
function compile_app (line 499) | def compile_app(app_root: Component) -> tuple[str, str]:
function compile_theme (line 518) | def compile_theme(style: ComponentStyle) -> tuple[str, str]:
function compile_contexts (line 537) | def compile_contexts(
function compile_page (line 556) | def compile_page(path: str, component: BaseComponent) -> tuple[str, str]:
function compile_memo_components (line 574) | def compile_memo_components(
function compile_stateful_components (line 593) | def compile_stateful_components(
function purge_web_pages_dir (line 623) | def purge_web_pages_dir():
function _into_component_once (line 640) | def _into_component_once(
function readable_name_from_component (line 666) | def readable_name_from_component(
function _modify_exception (line 695) | def _modify_exception(e: Exception) -> None:
function into_component (line 721) | def into_component(component: Component | ComponentCallable) -> Component:
function compile_unevaluated_page (line 790) | def compile_unevaluated_page(
class ExecutorSafeFunctions (line 847) | class ExecutorSafeFunctions:
method compile_page (line 876) | def compile_page(cls, route: str) -> tuple[str, str]:
method compile_unevaluated_page (line 888) | def compile_unevaluated_page(
method compile_theme (line 910) | def compile_theme(cls, style: ComponentStyle | None) -> tuple[str, str]:
FILE: reflex/compiler/templates.py
function _sort_hooks (line 20) | def _sort_hooks(
class _RenderUtils (line 53) | class _RenderUtils:
method render (line 55) | def render(component: Mapping[str, Any] | str) -> str:
method render_tag (line 69) | def render_tag(component: Mapping[str, Any]) -> str:
method render_condition_tag (line 81) | def render_condition_tag(component: Any) -> str:
method render_iterable_tag (line 85) | def render_iterable_tag(component: Any) -> str:
method render_match_tag (line 92) | def render_match_tag(component: Any) -> str:
method get_import (line 110) | def get_import(module: _ImportDict) -> str:
function rxconfig_template (line 125) | def rxconfig_template(app_name: str):
function document_root_template (line 145) | def document_root_template(*, imports: list[_ImportDict], document: dict...
function app_root_template (line 165) | def app_root_template(
function theme_template (line 245) | def theme_template(theme: str):
function context_template (line 257) | def context_template(
function component_template (line 421) | def component_template(component: Component | StatefulComponent):
function page_template (line 433) | def page_template(
function package_json_template (line 472) | def package_json_template(
function vite_config_template (line 499) | def vite_config_template(
function stateful_component_template (line 622) | def stateful_component_template(
function stateful_components_template (line 647) | def stateful_components_template(imports: list[_ImportDict], memoized_co...
function memo_components_template (line 661) | def memo_components_template(
function styles_template (line 703) | def styles_template(stylesheets: list[str]) -> str:
function _render_hooks (line 717) | def _render_hooks(hooks: dict[str, VarData | None], memo: list | None = ...
FILE: reflex/compiler/utils.py
function compile_import_statement (line 36) | def compile_import_statement(fields: list[ImportVar]) -> tuple[str, list...
function validate_imports (line 66) | def validate_imports(import_dict: ParsedImportDict):
class _ImportDict (line 96) | class _ImportDict(TypedDict):
function compile_imports (line 102) | def compile_imports(import_dict: ParsedImportDict) -> list[_ImportDict]:
function get_import_dict (line 151) | def get_import_dict(
function save_error (line 171) | def save_error(error: Exception) -> str:
function _sorted_keys (line 187) | def _sorted_keys(d: Mapping[str, Any]) -> dict[str, Any]:
function compile_state (line 199) | def compile_state(state: type[BaseState]) -> dict:
function _compile_client_storage_field (line 224) | def _compile_client_storage_field(
function _compile_client_storage_recursive (line 252) | def _compile_client_storage_recursive(
function compile_client_storage (line 297) | def compile_client_storage(
function compile_custom_component (line 316) | def compile_custom_component(
function create_document_root (line 356) | def create_document_root(
function create_theme (line 439) | def create_theme(style: ComponentStyle) -> dict:
function _format_route_part (line 466) | def _format_route_part(part: str) -> str:
function _path_to_file_stem (line 477) | def _path_to_file_stem(path: str) -> str:
function get_page_path (line 485) | def get_page_path(path: str) -> str:
function get_theme_path (line 502) | def get_theme_path() -> str:
function get_root_stylesheet_path (line 515) | def get_root_stylesheet_path() -> str:
function get_context_path (line 528) | def get_context_path() -> str:
function get_components_path (line 537) | def get_components_path() -> str:
function get_stateful_components_path (line 550) | def get_stateful_components_path() -> str:
function add_meta (line 563) | def add_meta(
function resolve_path_of_web_dir (line 597) | def resolve_path_of_web_dir(path: str | Path) -> Path:
function write_file (line 613) | def write_file(path: str | Path, code: str):
function empty_dir (line 627) | def empty_dir(path: str | Path, keep_files: list[str] | None = None):
function is_valid_url (line 647) | def is_valid_url(url: str) -> bool:
FILE: reflex/components/base/app_wrap.py
class AppWrap (line 8) | class AppWrap(Fragment):
method create (line 12) | def create(cls) -> Component:
FILE: reflex/components/base/bare.py
function get_performance_mode (line 21) | def get_performance_mode():
function validate_str (line 30) | def validate_str(value: str):
function _components_from_var (line 50) | def _components_from_var(var: Var) -> Sequence[BaseComponent]:
class Bare (line 55) | class Bare(Component):
method create (line 61) | def create(cls, contents: Any) -> Component:
method _get_all_hooks_internal (line 80) | def _get_all_hooks_internal(self) -> dict[str, VarData | None]:
method _get_all_hooks (line 92) | def _get_all_hooks(self) -> dict[str, VarData | None]:
method _get_all_imports (line 104) | def _get_all_imports(self, collapse: bool = False) -> ParsedImportDict:
method _get_all_dynamic_imports (line 120) | def _get_all_dynamic_imports(self) -> set[str]:
method _get_all_custom_code (line 132) | def _get_all_custom_code(self) -> dict[str, None]:
method _get_all_app_wrap_components (line 144) | def _get_all_app_wrap_components(
method _get_all_refs (line 169) | def _get_all_refs(self) -> dict[str, None]:
method _render (line 181) | def _render(self) -> Tag:
method render (line 191) | def render(self) -> dict:
method _add_style_recursive (line 208) | def _add_style_recursive(
method _get_vars (line 235) | def _get_vars(
FILE: reflex/components/base/body.py
class Body (line 6) | class Body(elements.Body):
FILE: reflex/components/base/document.py
class ReactRouterLib (line 6) | class ReactRouterLib(Component):
class Meta (line 12) | class Meta(ReactRouterLib):
class Links (line 18) | class Links(ReactRouterLib):
class ScrollRestoration (line 24) | class ScrollRestoration(ReactRouterLib):
class Outlet (line 30) | class Outlet(ReactRouterLib):
class Scripts (line 36) | class Scripts(ReactRouterLib):
FILE: reflex/components/base/error_boundary.py
function on_error_spec (line 15) | def on_error_spec(
class ErrorBoundary (line 36) | class ErrorBoundary(Component):
method create (line 49) | def create(cls, *children, **props):
FILE: reflex/components/base/fragment.py
class Fragment (line 6) | class Fragment(Component):
FILE: reflex/components/base/link.py
class RawLink (line 7) | class RawLink(BaseHTML):
class ScriptTag (line 19) | class ScriptTag(BaseHTML):
FILE: reflex/components/base/meta.py
class Title (line 11) | class Title(elements.Title):
method render (line 14) | def render(self) -> dict:
class Description (line 30) | class Description(elements.Meta):
class Image (line 37) | class Image(elements.Meta):
FILE: reflex/components/base/script.py
class Script (line 10) | class Script(elements.Script):
method create (line 14) | def create(
FILE: reflex/components/base/strict_mode.py
class StrictMode (line 6) | class StrictMode(Component):
FILE: reflex/components/component.py
class ComponentField (line 72) | class ComponentField(BaseField[FIELD_TYPE]):
method __init__ (line 75) | def __init__(
method __repr__ (line 93) | def __repr__(self) -> str:
function field (line 109) | def field(
class BaseComponentMeta (line 138) | class BaseComponentMeta(FieldBasedMeta, ABCMeta):
method _process_annotated_fields (line 148) | def _process_annotated_fields(
method _create_field (line 192) | def _create_field(
method _process_field_overrides (line 206) | def _process_field_overrides(
method _finalize_fields (line 230) | def _finalize_fields(
class BaseComponent (line 248) | class BaseComponent(metaclass=BaseComponentMeta):
method __init__ (line 270) | def __init__(
method set (line 285) | def set(self, **kwargs):
method __eq__ (line 298) | def __eq__(self, value: Any) -> bool:
method get_fields (line 312) | def get_fields(cls) -> Mapping[str, ComponentField]:
method get_js_fields (line 321) | def get_js_fields(cls) -> Mapping[str, ComponentField]:
method render (line 330) | def render(self) -> dict:
method _get_all_hooks_internal (line 338) | def _get_all_hooks_internal(self) -> dict[str, VarData | None]:
method _get_all_hooks (line 346) | def _get_all_hooks(self) -> dict[str, VarData | None]:
method _get_all_imports (line 354) | def _get_all_imports(self) -> ParsedImportDict:
method _get_all_dynamic_imports (line 362) | def _get_all_dynamic_imports(self) -> set[str]:
method _get_all_custom_code (line 370) | def _get_all_custom_code(self) -> dict[str, None]:
method _get_all_refs (line 378) | def _get_all_refs(self) -> dict[str, None]:
class ComponentNamespace (line 386) | class ComponentNamespace(SimpleNamespace):
method __hash__ (line 389) | def __hash__(self) -> int: # pyright: ignore [reportIncompatibleVaria...
function evaluate_style_namespaces (line 398) | def evaluate_style_namespaces(style: ComponentStyle) -> dict:
function _satisfies_type_hint (line 418) | def _satisfies_type_hint(obj: Any, type_hint: Any) -> bool:
function satisfies_type_hint (line 430) | def satisfies_type_hint(obj: Any, type_hint: Any) -> bool:
function _components_from (line 456) | def _components_from(
function _hash_str (line 475) | def _hash_str(value: str) -> str:
function _hash_sequence (line 479) | def _hash_sequence(value: Sequence) -> str:
function _hash_dict (line 483) | def _hash_dict(value: dict) -> str:
function _deterministic_hash (line 489) | def _deterministic_hash(value: object) -> str:
class Component (line 555) | class Component(BaseComponent, ABC):
method add_imports (line 617) | def add_imports(self) -> ImportDict | list[ImportDict]:
method add_hooks (line 645) | def add_hooks(self) -> list[str | Var]:
method add_custom_code (line 676) | def add_custom_code(self) -> list[str]:
method __init_subclass__ (line 703) | def __init_subclass__(cls, **kwargs):
method __init__ (line 719) | def __init__(self, **kwargs):
method _post_init (line 730) | def _post_init(self, *args, **kwargs):
method get_event_triggers (line 896) | def get_event_triggers(cls) -> dict[str, types.ArgsSpec | Sequence[typ...
method __repr__ (line 906) | def __repr__(self) -> str:
method __str__ (line 914) | def __str__(self) -> str:
method _exclude_props (line 924) | def _exclude_props(self) -> list[str]:
method _render (line 932) | def _render(self, props: dict[str, Any] | None = None) -> Tag:
method get_props (line 987) | def get_props(cls) -> Iterable[str]:
method get_initial_props (line 997) | def get_initial_props(cls) -> set[str]:
method _get_component_prop_property (line 1006) | def _get_component_prop_property(self) -> Sequence[BaseComponent]:
method _get_components_in_props (line 1015) | def _get_components_in_props(self) -> Sequence[BaseComponent]:
method _validate_children (line 1024) | def _validate_children(cls, children: tuple | list):
method create (line 1036) | def create(cls: type[T], *children, **props) -> T:
method _create (line 1072) | def _create(cls: type[T], children: Sequence[BaseComponent], **props: ...
method _unsafe_create (line 1088) | def _unsafe_create(
method add_style (line 1106) | def add_style(self) -> dict[str, Any] | None:
method _add_style (line 1117) | def _add_style(self) -> Style:
method _get_component_style (line 1138) | def _get_component_style(self, styles: ComponentStyle | Style) -> Styl...
method _add_style_recursive (line 1154) | def _add_style_recursive(
method _get_style (line 1205) | def _get_style(self) -> dict:
method render (line 1220) | def render(self) -> dict:
method _replace_prop_names (line 1235) | def _replace_prop_names(self, rendered_dict: dict) -> None:
method _validate_component_children (line 1250) | def _validate_component_children(self, children: list[Component]):
method _get_vars_from_event_triggers (line 1320) | def _get_vars_from_event_triggers(
method _get_vars (line 1344) | def _get_vars(
method _event_trigger_values_use_state (line 1412) | def _event_trigger_values_use_state(self) -> bool:
method _has_stateful_event_triggers (line 1436) | def _has_stateful_event_triggers(self):
method _iter_parent_classes_names (line 1450) | def _iter_parent_classes_names(cls) -> Iterator[str]:
method _iter_parent_classes_with_method (line 1457) | def _iter_parent_classes_with_method(cls, method: str) -> Sequence[typ...
method _get_custom_code (line 1485) | def _get_custom_code(self) -> str | None:
method _get_all_custom_code (line 1493) | def _get_all_custom_code(self) -> dict[str, None]:
method _get_dynamic_imports (line 1522) | def _get_dynamic_imports(self) -> str | None:
method _get_all_dynamic_imports (line 1530) | def _get_all_dynamic_imports(self) -> set[str]:
method _get_dependencies_imports (line 1554) | def _get_dependencies_imports(self) -> ParsedImportDict:
method _get_hooks_imports (line 1564) | def _get_hooks_imports(self) -> ParsedImportDict:
method _get_imports (line 1600) | def _get_imports(self) -> ParsedImportDict:
method _get_all_imports (line 1642) | def _get_all_imports(self, collapse: bool = False) -> ParsedImportDict:
method _get_mount_lifecycle_hook (line 1656) | def _get_mount_lifecycle_hook(self) -> str | None:
method _get_ref_hook (line 1680) | def _get_ref_hook(self) -> Var | None:
method _get_vars_hooks (line 1694) | def _get_vars_hooks(self) -> dict[str, VarData | None]:
method _get_events_hooks (line 1716) | def _get_events_hooks(self) -> dict[str, VarData | None]:
method _get_hooks_internal (line 1728) | def _get_hooks_internal(self) -> dict[str, VarData | None]:
method _get_added_hooks (line 1747) | def _get_added_hooks(self) -> dict[str, VarData | None]:
method _get_hooks (line 1777) | def _get_hooks(self) -> str | None:
method _get_all_hooks_internal (line 1787) | def _get_all_hooks_internal(self) -> dict[str, VarData | None]:
method _get_all_hooks (line 1802) | def _get_all_hooks(self) -> dict[str, VarData | None]:
method get_ref (line 1826) | def get_ref(self) -> str | None:
method _get_all_refs (line 1837) | def _get_all_refs(self) -> dict[str, None]:
method import_var (line 1855) | def import_var(self):
method _get_app_wrap_components (line 1867) | def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
method _get_all_app_wrap_components (line 1875) | def _get_all_app_wrap_components(
class CustomComponent (line 1912) | class CustomComponent(Component):
method _post_init (line 1924) | def _post_init(self, **kwargs):
method __eq__ (line 2010) | def __eq__(self, other: Any) -> bool:
method __hash__ (line 2021) | def __hash__(self) -> int:
method get_props (line 2030) | def get_props(cls) -> Iterable[str]:
method _get_event_spec_from_args_spec (line 2039) | def _get_event_spec_from_args_spec(name: str, event: EventChain) -> Ca...
method get_prop_vars (line 2075) | def get_prop_vars(self) -> list[Var | Callable]:
method get_component (line 2094) | def get_component(self) -> Component:
method _get_all_app_wrap_components (line 2112) | def _get_all_app_wrap_components(
function _register_custom_component (line 2134) | def _register_custom_component(
function custom_component (line 2172) | def custom_component(
class NoSSRComponent (line 2219) | class NoSSRComponent(Component):
method _get_import_name (line 2222) | def _get_import_name(self) -> str | None:
method _get_imports (line 2227) | def _get_imports(self) -> ParsedImportDict:
method _get_dynamic_imports (line 2254) | def _get_dynamic_imports(self) -> str:
class StatefulComponent (line 2277) | class StatefulComponent(BaseComponent):
method create (line 2307) | def create(cls, component: Component) -> StatefulComponent | None:
method _child_var (line 2384) | def _child_var(child: Component) -> Var | Component:
method _get_tag_name (line 2413) | def _get_tag_name(cls, component: Component) -> str | None:
method _render_stateful_code (line 2436) | def _render_stateful_code(
method _fix_event_triggers (line 2451) | def _fix_event_triggers(
method _get_hook_deps (line 2484) | def _get_hook_deps(hook: str) -> list[str]:
method _get_deps_from_event_trigger (line 2510) | def _get_deps_from_event_trigger(
method _get_memoized_event_triggers (line 2537) | def _get_memoized_event_triggers(
method _get_all_hooks_internal (line 2599) | def _get_all_hooks_internal(self) -> dict[str, VarData | None]:
method _get_all_hooks (line 2607) | def _get_all_hooks(self) -> dict[str, VarData | None]:
method _get_all_imports (line 2615) | def _get_all_imports(self) -> ParsedImportDict:
method _get_all_dynamic_imports (line 2629) | def _get_all_dynamic_imports(self) -> set[str]:
method _get_all_custom_code (line 2639) | def _get_all_custom_code(self, export: bool = False) -> dict[str, None]:
method _get_all_refs (line 2654) | def _get_all_refs(self) -> dict[str, None]:
method render (line 2664) | def render(self) -> dict:
method __str__ (line 2672) | def __str__(self) -> str:
method compile_from (line 2683) | def compile_from(cls, component: BaseComponent) -> BaseComponent:
class MemoizationLeaf (line 2705) | class MemoizationLeaf(Component):
method create (line 2719) | def create(cls, *children, **props) -> Component:
class ComponentVar (line 2740) | class ComponentVar(Var[Component], python_types=BaseComponent):
function empty_component (line 2744) | def empty_component() -> Component:
function render_dict_to_var (line 2755) | def render_dict_to_var(tag: dict | Component | str) -> Var:
class LiteralComponentVar (line 2838) | class LiteralComponentVar(CachedVarOperation, LiteralVar, ComponentVar):
method _cached_var_name (line 2844) | def _cached_var_name(self) -> str:
method _cached_get_all_var_data (line 2853) | def _cached_get_all_var_data(self) -> VarData | None:
method __hash__ (line 2872) | def __hash__(self) -> int:
method create (line 2881) | def create(
FILE: reflex/components/core/auto_scroll.py
class AutoScroll (line 13) | class AutoScroll(Div):
method create (line 21) | def create(cls, *children, **props):
method add_imports (line 40) | def add_imports(self) -> ImportDict | list[ImportDict]:
method add_hooks (line 48) | def add_hooks(self) -> list[str | Var]:
FILE: reflex/components/core/banner.py
class WebsocketTargetURL (line 56) | class WebsocketTargetURL(Var):
method create (line 60) | def create(cls) -> Var:
function default_connection_error (line 78) | def default_connection_error() -> list[str | Var | Component]:
class ConnectionToaster (line 92) | class ConnectionToaster(Fragment):
method add_hooks (line 95) | def add_hooks(self) -> list[str | Var]:
method create (line 186) | def create(cls, *children, **props) -> Component:
class ConnectionBanner (line 199) | class ConnectionBanner(Component):
method create (line 203) | def create(cls, comp: Component | None = None) -> Component:
class ConnectionModal (line 229) | class ConnectionModal(Component):
method create (line 233) | def create(cls, comp: Component | None = None) -> Component:
class WifiOffPulse (line 257) | class WifiOffPulse(Icon):
method create (line 261) | def create(cls, *children, **props) -> Icon:
method add_imports (line 286) | def add_imports(self) -> dict[str, str | ImportVar | list[str | Import...
class ConnectionPulser (line 295) | class ConnectionPulser(Div):
method create (line 299) | def create(cls, **props) -> Component:
class BackendDisabled (line 320) | class BackendDisabled(Div):
method create (line 324) | def create(cls, **props) -> Component:
FILE: reflex/components/core/breakpoints.py
function set_breakpoints (line 11) | def set_breakpoints(values: tuple[str, str, str, str, str]):
class Breakpoints (line 25) | class Breakpoints(dict[K, V]):
method factorize (line 28) | def factorize(self):
method create (line 45) | def create(
FILE: reflex/components/core/clipboard.py
class Clipboard (line 17) | class Clipboard(Fragment):
method create (line 30) | def create(cls, *children, **props):
method _exclude_props (line 54) | def _exclude_props(self) -> list[str]:
method _render (line 57) | def _render(self) -> Tag:
method add_imports (line 62) | def add_imports(self) -> dict[str, ImportVar]:
method add_hooks (line 74) | def add_hooks(self) -> list[str | Var[str]]:
FILE: reflex/components/core/colors.py
function color (line 15) | def color(
FILE: reflex/components/core/cond.py
class Cond (line 23) | class Cond(Component):
method create (line 30) | def create(
method _render (line 62) | def _render(self) -> Tag:
method render (line 69) | def render(self) -> dict:
method add_imports (line 81) | def add_imports(self) -> ImportDict:
function cond (line 95) | def cond(condition: Any, c1: Component, c2: Any, /) -> Component: ... #...
function cond (line 99) | def cond(condition: Any, c1: Component, /) -> Component: ...
function cond (line 103) | def cond(condition: Any, c1: Any, c2: Component, /) -> Component: ... #...
function cond (line 107) | def cond(condition: Any, c1: Any, c2: Any, /) -> Var: ...
function cond (line 110) | def cond(condition: Any, c1: Any, c2: Any = types.Unset(), /) -> Compone...
function color_mode_cond (line 160) | def color_mode_cond(light: Component, dark: Component | None = None) -> ...
function color_mode_cond (line 164) | def color_mode_cond(light: Any, dark: Any = None) -> Var: ...
function color_mode_cond (line 167) | def color_mode_cond(light: Any, dark: Any = None) -> Var | Component:
FILE: reflex/components/core/debounce.py
class DebounceInput (line 16) | class DebounceInput(Component):
method create (line 53) | def create(cls, *children: Component, **props: Any) -> Component:
method _render (line 141) | def _render(self):
FILE: reflex/components/core/foreach.py
class ForeachVarError (line 23) | class ForeachVarError(TypeError):
class ForeachRenderError (line 27) | class ForeachRenderError(TypeError):
class Foreach (line 31) | class Foreach(Component):
method create (line 43) | def create(
method _render (line 120) | def _render(self) -> IterTag:
method render (line 160) | def render(self):
FILE: reflex/components/core/helmet.py
class Helmet (line 6) | class Helmet(Component):
FILE: reflex/components/core/html.py
class Html (line 7) | class Html(Div):
method create (line 18) | def create(cls, *children, **props):
FILE: reflex/components/core/match.py
class Match (line 18) | class Match(MemoizationLeaf):
method create (line 35) | def create(cls, cond: Any, *cases) -> Component | Var:
method _create_condition_var (line 63) | def _create_condition_var(cls, cond: Any) -> Var:
method _process_cases (line 83) | def _process_cases(
method _create_case_var_with_var_data (line 122) | def _create_case_var_with_var_data(cls, case_element: Any) -> Var:
method _process_match_cases (line 137) | def _process_match_cases(
method _validate_return_types (line 182) | def _validate_return_types(
method _create_match_cond_var_or_component (line 218) | def _create_match_cond_var_or_component(
method _render (line 266) | def _render(self) -> Tag:
method render (line 276) | def render(self) -> dict:
method add_imports (line 284) | def add_imports(self) -> ImportDict:
FILE: reflex/components/core/responsive.py
function mobile_only (line 7) | def mobile_only(*children, **props):
function tablet_only (line 20) | def tablet_only(*children, **props):
function desktop_only (line 33) | def desktop_only(*children, **props):
function tablet_and_desktop (line 46) | def tablet_and_desktop(*children, **props):
function mobile_and_tablet (line 59) | def mobile_and_tablet(*children, **props):
FILE: reflex/components/core/sticky.py
class StickyLogo (line 13) | class StickyLogo(Svg):
method create (line 17) | def create(cls):
method add_style (line 33) | def add_style(self):
class StickyLabel (line 44) | class StickyLabel(Text):
method create (line 48) | def create(cls):
method add_style (line 56) | def add_style(self):
class StickyBadge (line 72) | class StickyBadge(A):
method create (line 76) | def create(cls):
method add_style (line 93) | def add_style(self):
class StickyNamespace (line 122) | class StickyNamespace(ComponentNamespace):
FILE: reflex/components/core/upload.py
function upload_file (line 59) | def upload_file(id_: str | Var[str] = DEFAULT_UPLOAD_ID) -> Var:
function selected_files (line 88) | def selected_files(id_: str | Var[str] = DEFAULT_UPLOAD_ID) -> Var:
function clear_selected_files (line 108) | def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec:
function cancel_upload (line 123) | def cancel_upload(upload_id: str) -> EventSpec:
function get_upload_dir (line 136) | def get_upload_dir() -> Path:
function get_upload_url (line 160) | def get_upload_url(file_path: str | Var[str]) -> Var[str]:
function _default_drop_rejected (line 177) | def _default_drop_rejected(rejected_files: ArrayVar[list[dict[str, Any]]...
class UploadFilesProvider (line 204) | class UploadFilesProvider(Component):
class GhostUpload (line 211) | class GhostUpload(Fragment):
class Upload (line 221) | class Upload(MemoizationLeaf):
method create (line 270) | def create(cls, *children, **props) -> Component:
method _update_arg_tuple_for_on_drop (line 424) | def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]):
method _get_app_wrap_components (line 440) | def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
class StyledUpload (line 446) | class StyledUpload(Upload):
method create (line 450) | def create(cls, *children, **props) -> Component:
class UploadNamespace (line 474) | class UploadNamespace(ComponentNamespace):
FILE: reflex/components/core/window_events.py
function _on_resize_spec (line 16) | def _on_resize_spec() -> tuple[Var[int], Var[int]]:
function _on_scroll_spec (line 25) | def _on_scroll_spec() -> tuple[Var[float], Var[float]]:
function _on_visibility_change_spec (line 34) | def _on_visibility_change_spec() -> tuple[Var[bool]]:
function _on_storage_spec (line 43) | def _on_storage_spec(e: ObjectVar) -> tuple[Var[str], Var[str], Var[str]...
class WindowEventListener (line 55) | class WindowEventListener(Fragment):
method create (line 72) | def create(cls, **props) -> WindowEventListener:
method _exclude_props (line 86) | def _exclude_props(self) -> list[str]:
method add_hooks (line 94) | def add_hooks(self) -> list[str | Var[Any]]:
FILE: reflex/components/datadisplay/code.py
function construct_theme_var (line 304) | def construct_theme_var(theme: str) -> Var[Theme]:
class Theme (line 326) | class Theme:
class CodeBlock (line 382) | class CodeBlock(Component, MarkdownComponentMap):
method create (line 430) | def create(
method add_style (line 494) | def add_style(self):
method _render (line 498) | def _render(self):
class CodeblockNamespace (line 513) | class CodeblockNamespace(ComponentNamespace):
FILE: reflex/components/datadisplay/dataeditor.py
class GridColumnIcons (line 23) | class GridColumnIcons(Enum):
class DataEditorThemeBase (line 55) | class DataEditorThemeBase:
class DataEditorTheme (line 93) | class DataEditorTheme(DataEditorThemeBase):
method __init__ (line 96) | def __init__(self, **kwargs: Any):
class Bounds (line 106) | class Bounds(TypedDict):
class CompatSelection (line 115) | class CompatSelection(TypedDict):
class Rectangle (line 121) | class Rectangle(TypedDict):
class GridSelectionCurrent (line 130) | class GridSelectionCurrent(TypedDict):
class GridSelection (line 138) | class GridSelection(TypedDict):
class GroupHeaderClickedEventArgs (line 146) | class GroupHeaderClickedEventArgs(TypedDict):
class GridCell (line 165) | class GridCell(TypedDict):
class GridColumn (line 171) | class GridColumn(TypedDict):
class DataEditor (line 178) | class DataEditor(NoSSRComponent):
method add_imports (line 369) | def add_imports(self) -> ImportDict:
method add_custom_code (line 385) | def add_custom_code(self) -> list[str]:
method add_hooks (line 434) | def add_hooks(self) -> list[str]:
method create (line 463) | def create(cls, *children, **props) -> Component:
method _get_app_wrap_components (line 532) | def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
function serialize_dataeditortheme (line 554) | def serialize_dataeditortheme(theme: DataEditorTheme):
FILE: reflex/components/datadisplay/logo.py
function svg_logo (line 8) | def svg_logo(color: str | rx.Var[str] = SVG_COLOR, **props):
function logo (line 44) | def logo(**props):
FILE: reflex/components/datadisplay/shiki_code_block.py
function copy_script (line 28) | def copy_script() -> Any:
class Position (line 397) | class Position(NoExtrasAllowedProps):
class ShikiDecorations (line 404) | class ShikiDecorations(NoExtrasAllowedProps):
class ShikiBaseTransformers (line 415) | class ShikiBaseTransformers:
class ShikiJsTransformer (line 424) | class ShikiJsTransformer(ShikiBaseTransformers):
method __init__ (line 517) | def __init__(self, **kwargs):
class ShikiCodeBlock (line 541) | class ShikiCodeBlock(Component, MarkdownComponentMap):
method create (line 571) | def create(
method add_imports (line 624) | def add_imports(self) -> dict[str, list[str]]:
method create_transformer (line 649) | def create_transformer(cls, library: str, fns: list[str]) -> ShikiBase...
method _render (line 670) | def _render(self, props: dict[str, Any] | None = None):
method _process_transformers (line 692) | def _process_transformers(self, transformer_list: list) -> list:
class ShikiHighLevelCodeBlock (line 712) | class ShikiHighLevelCodeBlock(ShikiCodeBlock):
method create (line 730) | def create(
method _map_themes (line 813) | def _map_themes(theme: str) -> str:
method _map_languages (line 819) | def _map_languages(language: str) -> str:
method _strip_transformer_triggers (line 825) | def _strip_transformer_triggers(code: str | StringVar) -> StringVar | ...
class TransformerNamespace (line 840) | class TransformerNamespace(ComponentNamespace):
class CodeblockNamespace (line 846) | class CodeblockNamespace(ComponentNamespace):
FILE: reflex/components/dynamic.py
function get_cdn_url (line 17) | def get_cdn_url(lib: str) -> str:
function bundle_library (line 39) | def bundle_library(component: Union["Component", str]):
function load_dynamic_serializer (line 57) | def load_dynamic_serializer():
FILE: reflex/components/el/element.py
class Element (line 8) | class Element(Component):
method __eq__ (line 13) | def __eq__(self, other: object):
FILE: reflex/components/el/elements/base.py
class BaseHTML (line 87) | class BaseHTML(Element):
FILE: reflex/components/el/elements/forms.py
function _handle_submit_js_template (line 33) | def _handle_submit_js_template(
class Button (line 70) | class Button(BaseHTML):
class Datalist (line 111) | class Datalist(BaseHTML):
class Fieldset (line 117) | class Fieldset(Element):
class Form (line 132) | class Form(BaseHTML):
method create (line 174) | def create(cls, *children, **props):
method add_imports (line 198) | def add_imports(self) -> ImportDict:
method add_hooks (line 209) | def add_hooks(self) -> list[str]:
method _render (line 229) | def _render(self) -> Tag:
method _get_form_refs (line 240) | def _get_form_refs(self) -> dict[str, Any]:
method _get_vars (line 260) | def _get_vars(
method _exclude_props (line 268) | def _exclude_props(self) -> list[str]:
class BaseInput (line 302) | class BaseInput(BaseHTML):
class CheckboxInput (line 407) | class CheckboxInput(BaseInput):
class ValueNumberInput (line 420) | class ValueNumberInput(BaseInput):
class Input (line 433) | class Input(BaseInput):
method create (line 446) | def create(cls, *children, **props):
class Label (line 481) | class Label(BaseHTML):
class Legend (line 493) | class Legend(BaseHTML):
class Meter (line 499) | class Meter(BaseHTML):
class Optgroup (line 526) | class Optgroup(BaseHTML):
class Option (line 538) | class Option(BaseHTML):
class Output (line 556) | class Output(BaseHTML):
class Progress (line 571) | class Progress(BaseHTML):
class Select (line 586) | class Select(BaseHTML):
class Textarea (line 655) | class Textarea(BaseHTML):
method create (line 730) | def create(cls, *children, **props):
method _exclude_props (line 764) | def _exclude_props(self) -> list[str]:
method _get_all_custom_code (line 771) | def _get_all_custom_code(self) -> dict[str, None]:
FILE: reflex/components/el/elements/inline.py
class A (line 22) | class A(BaseHTML): # Inherits common attributes from BaseMeta
class Abbr (line 54) | class Abbr(BaseHTML):
class B (line 60) | class B(BaseHTML):
class Bdi (line 66) | class Bdi(BaseHTML):
class Bdo (line 72) | class Bdo(BaseHTML):
class Br (line 78) | class Br(BaseHTML):
class Cite (line 84) | class Cite(BaseHTML):
class Code (line 90) | class Code(BaseHTML):
class Data (line 96) | class Data(BaseHTML):
class Dfn (line 105) | class Dfn(BaseHTML):
class Em (line 111) | class Em(BaseHTML):
class I (line 117) | class I(BaseHTML): # noqa: E742
class Kbd (line 123) | class Kbd(BaseHTML):
class Mark (line 129) | class Mark(BaseHTML):
class Q (line 135) | class Q(BaseHTML):
class Rp (line 144) | class Rp(BaseHTML):
class Rt (line 150) | class Rt(BaseHTML):
class Ruby (line 156) | class Ruby(BaseHTML):
class S (line 162) | class S(BaseHTML):
class Samp (line 168) | class Samp(BaseHTML):
class Small (line 174) | class Small(BaseHTML):
class Span (line 180) | class Span(BaseHTML):
class Strong (line 186) | class Strong(BaseHTML):
class Sub (line 192) | class Sub(BaseHTML):
class Sup (line 198) | class Sup(BaseHTML):
class Time (line 204) | class Time(BaseHTML):
class U (line 213) | class U(BaseHTML):
class Wbr (line 219) | class Wbr(BaseHTML):
FILE: reflex/components/el/elements/media.py
class Area (line 13) | class Area(BaseHTML):
class Audio (line 52) | class Audio(BaseHTML):
class Img (line 83) | class Img(BaseHTML):
method create (line 116) | def create(cls, *children, **props) -> Component:
class Map (line 133) | class Map(BaseHTML):
class Track (line 142) | class Track(BaseHTML):
class Video (line 163) | class Video(BaseHTML):
class Embed (line 196) | class Embed(BaseHTML):
class Iframe (line 208) | class Iframe(BaseHTML):
class Object (line 235) | class Object(BaseHTML):
class Picture (line 256) | class Picture(BaseHTML):
class Portal (line 262) | class Portal(BaseHTML):
class Source (line 268) | class Source(BaseHTML):
class Svg (line 289) | class Svg(BaseHTML):
class Text (line 307) | class Text(BaseHTML):
class Line (line 327) | class Line(BaseHTML):
class Circle (line 343) | class Circle(BaseHTML):
class Ellipse (line 357) | class Ellipse(BaseHTML):
class Rect (line 373) | class Rect(BaseHTML):
class Polygon (line 393) | class Polygon(BaseHTML):
class Polyline (line 403) | class Polyline(BaseHTML):
class Defs (line 413) | class Defs(BaseHTML):
class LinearGradient (line 419) | class LinearGradient(BaseHTML):
class RadialGradient (line 449) | class RadialGradient(BaseHTML):
class Stop (line 485) | class Stop(BaseHTML):
class Path (line 500) | class Path(BaseHTML):
class Marker (line 511) | class Marker(BaseHTML):
class G (line 541) | class G(BaseHTML):
class SvgImage (line 565) | class SvgImage(BaseHTML):
class Use (line 592) | class Use(BaseHTML):
class TSpan (line 613) | class TSpan(BaseHTML):
class TextPath (line 640) | class TextPath(BaseHTML):
class Pattern (line 670) | class Pattern(BaseHTML):
class ClipPath (line 706) | class ClipPath(BaseHTML):
class Symbol (line 715) | class Symbol(BaseHTML):
class Mask (line 733) | class Mask(BaseHTML):
class ForeignObject (line 757) | class ForeignObject(BaseHTML):
class SvgA (line 775) | class SvgA(BaseHTML):
class Animate (line 802) | class Animate(BaseHTML):
class AnimateMotion (line 850) | class AnimateMotion(BaseHTML):
class AnimateTransform (line 883) | class AnimateTransform(BaseHTML):
class Set (line 919) | class Set(BaseHTML):
class MPath (line 943) | class MPath(BaseHTML):
class Desc (line 952) | class Desc(BaseHTML):
class Title (line 958) | class Title(BaseHTML):
class Metadata (line 964) | class Metadata(BaseHTML):
class Script (line 970) | class Script(BaseHTML):
class SvgStyle (line 985) | class SvgStyle(BaseHTML):
class Switch (line 1000) | class Switch(BaseHTML):
class View (line 1006) | class View(BaseHTML):
class SVG (line 1018) | class SVG(ComponentNamespace):
FILE: reflex/components/el/elements/metadata.py
class Base (line 11) | class Base(BaseHTML):
class Head (line 20) | class Head(BaseHTML):
class Link (line 26) | class Link(BaseHTML):
class Meta (line 59) | class Meta(BaseHTML): # Inherits common attributes from BaseHTML
class Title (line 80) | class Title(Element):
class StyleEl (line 87) | class StyleEl(Element):
FILE: reflex/components/el/elements/other.py
class Details (line 8) | class Details(BaseHTML):
class Dialog (line 17) | class Dialog(BaseHTML):
class Summary (line 26) | class Summary(BaseHTML):
class Slot (line 35) | class Slot(BaseHTML):
class Template (line 44) | class Template(BaseHTML):
class Math (line 53) | class Math(BaseHTML):
class Html (line 62) | class Html(BaseHTML):
FILE: reflex/components/el/elements/scripts.py
class Canvas (line 10) | class Canvas(BaseHTML):
class Noscript (line 16) | class Noscript(BaseHTML):
class Script (line 22) | class Script(BaseHTML):
FILE: reflex/components/el/elements/sectioning.py
class Body (line 6) | class Body(BaseHTML):
class Address (line 12) | class Address(BaseHTML):
class Article (line 18) | class Article(BaseHTML):
class Aside (line 24) | class Aside(BaseHTML):
class Footer (line 30) | class Footer(BaseHTML):
class Header (line 36) | class Header(BaseHTML):
class H1 (line 42) | class H1(BaseHTML):
class H2 (line 48) | class H2(BaseHTML):
class H3 (line 54) | class H3(BaseHTML):
class H4 (line 60) | class H4(BaseHTML):
class H5 (line 66) | class H5(BaseHTML):
class H6 (line 72) | class H6(BaseHTML):
class Main (line 78) | class Main(BaseHTML):
class Nav (line 84) | class Nav(BaseHTML):
class Section (line 90) | class Section(BaseHTML):
FILE: reflex/components/el/elements/tables.py
class Caption (line 10) | class Caption(BaseHTML):
class Col (line 16) | class Col(BaseHTML):
class Colgroup (line 25) | class Colgroup(BaseHTML):
class Table (line 34) | class Table(BaseHTML):
class Tbody (line 46) | class Tbody(BaseHTML):
class Td (line 52) | class Td(BaseHTML):
class Tfoot (line 70) | class Tfoot(BaseHTML):
class Th (line 76) | class Th(BaseHTML):
class Thead (line 97) | class Thead(BaseHTML):
class Tr (line 103) | class Tr(BaseHTML):
FILE: reflex/components/el/elements/typography.py
class Blockquote (line 10) | class Blockquote(BaseHTML):
class Dd (line 19) | class Dd(BaseHTML):
class Div (line 25) | class Div(BaseHTML):
class Dl (line 31) | class Dl(BaseHTML):
class Dt (line 37) | class Dt(BaseHTML):
class Figcaption (line 43) | class Figcaption(BaseHTML):
class Figure (line 49) | class Figure(BaseHTML):
class Hr (line 55) | class Hr(BaseHTML):
class Li (line 61) | class Li(BaseHTML):
class Menu (line 67) | class Menu(BaseHTML):
class Ol (line 76) | class Ol(BaseHTML):
class P (line 91) | class P(BaseHTML):
class Pre (line 99) | class Pre(BaseHTML):
class Ul (line 105) | class Ul(BaseHTML):
class Ins (line 111) | class Ins(BaseHTML):
class Del (line 123) | class Del(BaseHTML):
FILE: reflex/components/field.py
class BaseField (line 15) | class BaseField(Generic[FIELD_TYPE]):
method __init__ (line 18) | def __init__(
method default_value (line 46) | def default_value(self) -> FIELD_TYPE:
class FieldBasedMeta (line 63) | class FieldBasedMeta(type):
method __new__ (line 70) | def __new__(
method _collect_inherited_fields (line 105) | def _collect_inherited_fields(cls, bases: tuple[type, ...]) -> dict[st...
method _resolve_annotations (line 119) | def _resolve_annotations(
method _process_field_overrides (line 128) | def _process_field_overrides(
method _process_annotated_fields (line 149) | def _process_annotated_fields(
method _create_field (line 158) | def _create_field(
method _finalize_fields (line 167) | def _finalize_fields(
FILE: reflex/components/gridjs/datatable.py
class Gridjs (line 16) | class Gridjs(NoSSRComponent):
class DataTable (line 24) | class DataTable(Gridjs):
method create (line 51) | def create(cls, *children, **props):
method add_imports (line 103) | def add_imports(self) -> ImportDict:
method _render (line 111) | def _render(self) -> Tag:
FILE: reflex/components/lucide/icon.py
class LucideIconComponent (line 12) | class LucideIconComponent(Component):
class Icon (line 18) | class Icon(LucideIconComponent):
method create (line 27) | def create(cls, *children, **props) -> Component:
class DynamicIcon (line 90) | class DynamicIcon(LucideIconComponent):
method _get_imports (line 98) | def _get_imports(self):
FILE: reflex/components/markdown/markdown.py
class Plugin (line 39) | class Plugin(SimpleNamespace):
method create (line 43) | def create(
function _h1 (line 90) | def _h1(value: object):
function _h2 (line 96) | def _h2(value: object):
function _h3 (line 102) | def _h3(value: object):
function _h4 (line 108) | def _h4(value: object):
function _h5 (line 114) | def _h5(value: object):
function _h6 (line 120) | def _h6(value: object):
function _p (line 126) | def _p(value: object):
function _ul (line 132) | def _ul(value: object):
function _ol (line 138) | def _ol(value: object):
function _li (line 144) | def _li(value: object):
function _a (line 150) | def _a(value: object):
function _code (line 156) | def _code(value: object):
function _codeblock (line 162) | def _codeblock(value: object, **props):
function get_base_component_map (line 170) | def get_base_component_map() -> dict[str, Callable]:
class MarkdownComponentMap (line 194) | class MarkdownComponentMap:
method get_component_map_custom_code (line 200) | def get_component_map_custom_code(cls) -> Var:
method create_map_fn_var (line 209) | def create_map_fn_var(
method get_fn_args (line 239) | def get_fn_args(cls) -> Sequence[str]:
method get_fn_body (line 248) | def get_fn_body(cls) -> Var:
class Markdown (line 257) | class Markdown(Component):
method create (line 281) | def create(
method add_imports (line 328) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_tag_map_fn_var (line 350) | def _get_tag_map_fn_var(self, tag: str) -> Var:
method format_component_map (line 353) | def format_component_map(self) -> dict[str, Var]:
method _get_codeblock_fn_var (line 370) | def _get_codeblock_fn_var(self) -> Var:
method get_component (line 407) | def get_component(self, tag: str, **props) -> Component:
method format_component (line 430) | def format_component(self, tag: str, **props) -> str:
method _get_map_fn_var_from_children (line 442) | def _get_map_fn_var_from_children(self, component: Component, tag: str...
method _get_map_fn_custom_code_from_children (line 461) | def _get_map_fn_custom_code_from_children(
method _component_map_hash (line 493) | def _component_map_hash(component_map: dict) -> str:
method _get_component_map_name (line 506) | def _get_component_map_name(self) -> str:
method _get_custom_code (line 509) | def _get_custom_code(self) -> str | None:
method _render (line 526) | def _render(self) -> Tag:
class MarkdownWrapper (line 537) | class MarkdownWrapper(Div):
method create (line 541) | def create(
class MarkdownNamespace (line 636) | class MarkdownNamespace(ComponentNamespace):
FILE: reflex/components/moment/moment.py
class MomentDelta (line 13) | class MomentDelta:
class Moment (line 27) | class Moment(NoSSRComponent):
method add_imports (line 104) | def add_imports(self) -> ImportDict:
FILE: reflex/components/plotly/__init__.py
class PlotlyNamespace (line 18) | class PlotlyNamespace(ComponentNamespace):
FILE: reflex/components/plotly/plotly.py
function _event_points_data_signature (line 25) | def _event_points_data_signature(e0: Var) -> tuple[Var[list[Point]]]:
class BBox (line 42) | class BBox(TypedDict):
class Point (line 53) | class Point(TypedDict):
class Plotly (line 70) | class Plotly(NoSSRComponent):
method add_imports (line 156) | def add_imports(self) -> dict[str, str]:
method add_custom_code (line 167) | def add_custom_code(self) -> list[str]:
method create (line 207) | def create(cls, *children, **props) -> Component:
method _exclude_props (line 230) | def _exclude_props(self) -> set[str]:
method _render (line 234) | def _render(self):
function dynamic_plotly_import (line 280) | def dynamic_plotly_import(name: str, package: str) -> str:
class PlotlyBasic (line 299) | class PlotlyBasic(Plotly):
method add_imports (line 308) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 316) | def _get_dynamic_imports(self) -> str:
class PlotlyCartesian (line 325) | class PlotlyCartesian(Plotly):
method add_imports (line 334) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 342) | def _get_dynamic_imports(self) -> str:
class PlotlyGeo (line 351) | class PlotlyGeo(Plotly):
method add_imports (line 360) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 368) | def _get_dynamic_imports(self) -> str:
class PlotlyGl3d (line 377) | class PlotlyGl3d(Plotly):
method add_imports (line 386) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 394) | def _get_dynamic_imports(self) -> str:
class PlotlyGl2d (line 403) | class PlotlyGl2d(Plotly):
method add_imports (line 412) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 420) | def _get_dynamic_imports(self) -> str:
class PlotlyMapbox (line 429) | class PlotlyMapbox(Plotly):
method add_imports (line 438) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 446) | def _get_dynamic_imports(self) -> str:
class PlotlyFinance (line 455) | class PlotlyFinance(Plotly):
method add_imports (line 464) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 472) | def _get_dynamic_imports(self) -> str:
class PlotlyStrict (line 481) | class PlotlyStrict(Plotly):
method add_imports (line 490) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _get_dynamic_imports (line 498) | def _get_dynamic_imports(self) -> str:
FILE: reflex/components/props.py
function _get_props_subclass (line 22) | def _get_props_subclass(field_type: Any) -> type | None:
function _find_props_in_list_annotation (line 47) | def _find_props_in_list_annotation(field_type: Any) -> type | None:
class PropsField (line 73) | class PropsField(BaseField[PROPS_FIELD_TYPE]):
method __init__ (line 76) | def __init__(
method required (line 93) | def required(self) -> bool:
method name (line 102) | def name(self) -> str | None:
method get_default (line 112) | def get_default(self) -> Any:
method __repr__ (line 124) | def __repr__(self) -> str:
function props_field (line 142) | def props_field(
class PropsBaseMeta (line 169) | class PropsBaseMeta(FieldBasedMeta):
method _process_annotated_fields (line 173) | def _process_annotated_fields(
method _create_field (line 203) | def _create_field(
method _finalize_fields (line 216) | def _finalize_fields(
class PropsBase (line 229) | class PropsBase(metaclass=PropsBaseMeta):
method __init__ (line 232) | def __init__(self, **kwargs):
method get_fields (line 286) | def get_fields(cls) -> dict[str, Any]:
method json (line 294) | def json(self) -> str:
method dict (line 308) | def dict(
method _convert_to_camel_case (line 356) | def _convert_to_camel_case(
function serialize_props_base (line 399) | def serialize_props_base(value: PropsBase) -> dict:
class NoExtrasAllowedProps (line 414) | class NoExtrasAllowedProps(PropsBase):
method __init__ (line 417) | def __init__(self, component_name: str | None = None, **kwargs):
FILE: reflex/components/radix/primitives/accordion.py
function _inherited_variant_selector (line 29) | def _inherited_variant_selector(
class AccordionComponent (line 52) | class AccordionComponent(RadixPrimitiveComponent):
method add_style (line 63) | def add_style(self):
method _exclude_props (line 70) | def _exclude_props(self) -> list[str]:
function on_value_change (line 74) | def on_value_change(value: Var[str | list[str]]) -> tuple[Var[str | list...
class AccordionRoot (line 86) | class AccordionRoot(AccordionComponent):
method _exclude_props (line 131) | def _exclude_props(self) -> list[str]:
method add_style (line 140) | def add_style(self):
class AccordionItem (line 184) | class AccordionItem(AccordionComponent):
method create (line 212) | def create(
method add_style (line 264) | def add_style(self) -> dict[str, Any] | None:
method _exclude_props (line 300) | def _exclude_props(self) -> list[str]:
class AccordionHeader (line 304) | class AccordionHeader(AccordionComponent):
method create (line 312) | def create(cls, *children, **props) -> Component:
method add_style (line 329) | def add_style(self) -> dict[str, Any] | None:
class AccordionTrigger (line 342) | class AccordionTrigger(AccordionComponent):
method create (line 352) | def create(cls, *children, **props) -> Component:
method add_style (line 369) | def add_style(self) -> dict[str, Any] | None:
class AccordionIcon (line 410) | class AccordionIcon(Icon):
method create (line 414) | def create(cls, *children, **props) -> Component:
class AccordionContent (line 440) | class AccordionContent(AccordionComponent):
method add_imports (line 447) | def add_imports(self) -> dict:
method create (line 456) | def create(cls, *children, **props) -> Component:
method add_style (line 473) | def add_style(self) -> dict[str, Any] | None:
class Accordion (line 505) | class Accordion(ComponentNamespace):
FILE: reflex/components/radix/primitives/base.py
class RadixPrimitiveComponent (line 11) | class RadixPrimitiveComponent(Component):
class RadixPrimitiveComponentWithClassName (line 18) | class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
method _render (line 21) | def _render(self) -> Tag:
class RadixPrimitiveTriggerComponent (line 31) | class RadixPrimitiveTriggerComponent(RadixPrimitiveComponent):
method create (line 41) | def create(cls, *children: Any, **props: Any) -> Component:
FILE: reflex/components/radix/primitives/dialog.py
class DialogElement (line 14) | class DialogElement(RadixPrimitiveComponent):
class DialogRoot (line 20) | class DialogRoot(DialogElement):
class DialogPortal (line 44) | class DialogPortal(DialogElement):
class DialogOverlay (line 59) | class DialogOverlay(DialogElement):
class DialogTrigger (line 74) | class DialogTrigger(DialogElement, RadixPrimitiveTriggerComponent):
class DialogContent (line 88) | class DialogContent(elements.Div, DialogElement):
class DialogTitle (line 118) | class DialogTitle(DialogElement):
class DialogDescription (line 128) | class DialogDescription(DialogElement):
class DialogClose (line 138) | class DialogClose(DialogElement, RadixPrimitiveTriggerComponent):
class Dialog (line 148) | class Dialog(ComponentNamespace):
FILE: reflex/components/radix/primitives/drawer.py
class DrawerComponent (line 19) | class DrawerComponent(RadixPrimitiveComponent):
class DrawerRoot (line 30) | class DrawerRoot(DrawerComponent):
class DrawerTrigger (line 80) | class DrawerTrigger(DrawerComponent):
method create (line 93) | def create(cls, *children: Any, **props: Any) -> Component:
class DrawerPortal (line 110) | class DrawerPortal(DrawerComponent):
class DrawerContent (line 119) | class DrawerContent(DrawerComponent):
method add_style (line 127) | def add_style(self) -> dict:
method create (line 159) | def create(cls, *children, **props):
class DrawerOverlay (line 178) | class DrawerOverlay(DrawerComponent):
method add_style (line 186) | def add_style(self) -> dict:
class DrawerClose (line 203) | class DrawerClose(DrawerTrigger):
class DrawerTitle (line 211) | class DrawerTitle(DrawerComponent):
method add_style (line 219) | def add_style(self) -> dict:
class DrawerDescription (line 233) | class DrawerDescription(DrawerComponent):
method add_style (line 241) | def add_style(self) -> dict:
class DrawerHandle (line 252) | class DrawerHandle(DrawerComponent):
class Drawer (line 260) | class Drawer(ComponentNamespace):
FILE: reflex/components/radix/primitives/form.py
class FormComponent (line 17) | class FormComponent(RadixPrimitiveComponentWithClassName):
class FormRoot (line 23) | class FormRoot(FormComponent, HTMLForm):
method add_style (line 33) | def add_style(self) -> dict[str, Any] | None:
class FormField (line 42) | class FormField(FormComponent):
method add_style (line 55) | def add_style(self) -> dict[str, Any] | None:
class FormLabel (line 64) | class FormLabel(FormComponent):
method add_style (line 71) | def add_style(self) -> dict[str, Any] | None:
class FormControl (line 80) | class FormControl(FormComponent):
method create (line 88) | def create(cls, *children, **props):
class FormMessage (line 126) | class FormMessage(FormComponent):
method add_style (line 142) | def add_style(self) -> dict[str, Any] | None:
class FormValidityState (line 151) | class FormValidityState(FormComponent):
class FormSubmit (line 158) | class FormSubmit(FormComponent):
class Form (line 166) | class Form(FormRoot):
class FormNamespace (line 170) | class FormNamespace(ComponentNamespace):
FILE: reflex/components/radix/primitives/progress.py
class ProgressComponent (line 15) | class ProgressComponent(RadixPrimitiveComponentWithClassName):
class ProgressRoot (line 21) | class ProgressRoot(ProgressComponent):
method add_style (line 30) | def add_style(self) -> dict[str, Any] | None:
method _exclude_props (line 49) | def _exclude_props(self) -> list[str]:
class ProgressIndicator (line 53) | class ProgressIndicator(ProgressComponent):
method add_style (line 69) | def add_style(self) -> dict[str, Any] | None:
method _exclude_props (line 90) | def _exclude_props(self) -> list[str]:
class Progress (line 94) | class Progress(ProgressRoot):
method create (line 107) | def create(cls, **props) -> Component:
class ProgressNamespace (line 130) | class ProgressNamespace(ComponentNamespace):
FILE: reflex/components/radix/primitives/slider.py
class SliderComponent (line 17) | class SliderComponent(RadixPrimitiveComponentWithClassName):
class SliderRoot (line 23) | class SliderRoot(SliderComponent):
method add_style (line 57) | def add_style(self) -> dict[str, Any] | None:
class SliderTrack (line 79) | class SliderTrack(SliderComponent):
method add_style (line 85) | def add_style(self) -> dict[str, Any] | None:
class SliderRange (line 101) | class SliderRange(SliderComponent):
method add_style (line 107) | def add_style(self) -> dict[str, Any] | None:
class SliderThumb (line 121) | class SliderThumb(SliderComponent):
method add_style (line 127) | def add_style(self) -> dict[str, Any] | None:
class Slider (line 150) | class Slider(ComponentNamespace):
method __call__ (line 159) | def __call__(**props) -> Component:
FILE: reflex/components/radix/themes/base.py
class CommonMarginProps (line 52) | class CommonMarginProps(Component):
class CommonPaddingProps (line 77) | class CommonPaddingProps(Component):
class RadixLoadingProp (line 102) | class RadixLoadingProp(Component):
class RadixThemesComponent (line 109) | class RadixThemesComponent(Component):
method create (line 118) | def create(
method _get_app_wrap_components (line 144) | def _get_app_wrap_components() -> dict[tuple[int, str], Component]:
class RadixThemesTriggerComponent (line 150) | class RadixThemesTriggerComponent(RadixThemesComponent):
method create (line 160) | def create(cls, *children: Any, **props: Any) -> Component:
class Theme (line 179) | class Theme(RadixThemesComponent):
method create (line 213) | def create(
method add_imports (line 237) | def add_imports(self) -> ImportDict | list[ImportDict]:
method _render (line 247) | def _render(self, props: dict[str, Any] | None = None) -> Tag:
class ThemePanel (line 256) | class ThemePanel(RadixThemesComponent):
method add_imports (line 267) | def add_imports(self) -> dict[str, str]:
class RadixThemesColorModeProvider (line 276) | class RadixThemesColorModeProvider(Component):
FILE: reflex/components/radix/themes/color_mode.py
class ColorModeIcon (line 43) | class ColorModeIcon(Cond):
method create (line 47) | def create(
function _find (line 81) | def _find(const: list[str], var: Any):
function _set_var_default (line 85) | def _set_var_default(
function _set_static_default (line 93) | def _set_static_default(props: dict, position: Any, prop: str, default: ...
class ColorModeIconButton (line 98) | class ColorModeIconButton(IconButton):
method create (line 110) | def create(
class ColorModeSwitch (line 174) | class ColorModeSwitch(Switch):
method create (line 178) | def create(cls, *children, **props):
class ColorModeNamespace (line 196) | class ColorModeNamespace(Var):
FILE: reflex/components/radix/themes/components/alert_dialog.py
class AlertDialogRoot (line 19) | class AlertDialogRoot(RadixThemesComponent):
class AlertDialogTrigger (line 34) | class AlertDialogTrigger(RadixThemesTriggerComponent):
class AlertDialogContent (line 42) | class AlertDialogContent(elements.Div, RadixThemesComponent):
class AlertDialogTitle (line 63) | class AlertDialogTitle(RadixThemesComponent):
class AlertDialogDescription (line 72) | class AlertDialogDescription(RadixThemesComponent):
class AlertDialogAction (line 80) | class AlertDialogAction(RadixThemesTriggerComponent):
class AlertDialogCancel (line 88) | class AlertDialogCancel(RadixThemesTriggerComponent):
class AlertDialog (line 96) | class AlertDialog(ComponentNamespace):
FILE: reflex/components/radix/themes/components/aspect_ratio.py
class AspectRatio (line 7) | class AspectRatio(RadixThemesComponent):
FILE: reflex/components/radix/themes/components/avatar.py
class Avatar (line 16) | class Avatar(RadixThemesComponent):
FILE: reflex/components/radix/themes/components/badge.py
class Badge (line 15) | class Badge(elements.Span, RadixThemesComponent):
FILE: reflex/components/radix/themes/components/button.py
class Button (line 19) | class Button(elements.Button, RadixLoadingProp, RadixThemesComponent):
FILE: reflex/components/radix/themes/components/callout.py
class CalloutRoot (line 16) | class CalloutRoot(elements.Div, RadixThemesComponent):
class CalloutIcon (line 37) | class CalloutIcon(elements.Div, RadixThemesComponent):
class CalloutText (line 43) | class CalloutText(elements.P, RadixThemesComponent):
class Callout (line 49) | class Callout(CalloutRoot):
method create (line 59) | def create(cls, text: str | Var[str], **props) -> Component:
class CalloutNamespace (line 80) | class CalloutNamespace(ComponentNamespace):
FILE: reflex/components/radix/themes/components/card.py
class Card (line 11) | class Card(elements.Div, RadixThemesComponent):
FILE: reflex/components/radix/themes/components/checkbox.py
class Checkbox (line 21) | class Checkbox(RadixThemesComponent):
class HighLevelCheckbox (line 66) | class HighLevelCheckbox(RadixThemesComponent):
method create (line 117) | def create(cls, text: Var[str] = Var.create(""), **props) -> Component:
class CheckboxNamespace (line 148) | class CheckboxNamespace(ComponentNamespace):
FILE: reflex/components/radix/themes/components/checkbox_cards.py
class CheckboxCardsRoot (line 11) | class CheckboxCardsRoot(RadixThemesComponent):
class CheckboxCardsItem (line 35) | class CheckboxCardsItem(RadixThemesComponent):
class CheckboxCards (line 41) | class CheckboxCards(SimpleNamespace):
FILE: reflex/components/radix/themes/components/checkbox_group.py
class CheckboxGroupRoot (line 12) | class CheckboxGroupRoot(RadixThemesComponent):
class CheckboxGroupItem (line 36) | class CheckboxGroupItem(RadixThemesComponent):
class CheckboxGroup (line 48) | class CheckboxGroup(SimpleNamespace):
FILE: reflex/components/radix/themes/components/context_menu.py
class ContextMenuRoot (line 31) | class ContextMenuRoot(RadixThemesComponent):
class ContextMenuTrigger (line 48) | class ContextMenuTrigger(RadixThemesComponent):
class ContextMenuContent (line 63) | class ContextMenuContent(RadixThemesComponent):
class ContextMenuSub (line 129) | class ContextMenuSub(RadixThemesComponent):
class ContextMenuSubTrigger (line 144) | class ContextMenuSubTrigger(RadixThemesComponent):
class ContextMenuSubContent (line 163) | class ContextMenuSubContent(RadixThemesComponent):
class ContextMenuItem (line 210) | class ContextMenuItem(RadixThemesComponent):
class ContextMenuSeparator (line 240) | class ContextMenuSeparator(RadixThemesComponent):
class ContextMenuCheckbox (line 246) | class ContextMenuCheckbox(Checkbox):
class ContextMenuLabel (line 255) | class ContextMenuLabel(RadixThemesComponent):
class ContextMenuGroup (line 264) | class ContextMenuGroup(RadixThemesComponent):
class ContextMenuRadioGroup (line 278) | class ContextMenuRadioGroup(RadixThemesComponent):
class ContextMenuRadioItem (line 303) | class ContextMenuRadioItem(HighLevelRadioGroup):
class ContextMenu (line 327) | class ContextMenu(ComponentNamespace):
FILE: reflex/components/radix/themes/components/data_list.py
class DataListRoot (line 11) | class DataListRoot(RadixThemesComponent):
class DataListItem (line 26) | class DataListItem(RadixThemesComponent):
class DataListLabel (line 35) | class DataListLabel(RadixThemesComponent):
class DataListValue (line 53) | class DataListValue(RadixThemesComponent):
class DataList (line 59) | class DataList(SimpleNamespace):
FILE: reflex/components/radix/themes/components/dialog.py
class DialogRoot (line 17) | class DialogRoot(RadixThemesComponent):
class DialogTrigger (line 32) | class DialogTrigger(RadixThemesTriggerComponent):
class DialogTitle (line 40) | class DialogTitle(RadixThemesComponent):
class DialogContent (line 46) | class DialogContent(elements.Div, RadixThemesComponent):
class DialogDescription (line 70) | class DialogDescription(RadixThemesComponent):
class DialogClose (line 76) | class DialogClose(RadixThemesTriggerComponent):
class Dialog (line 82) | class Dialog(ComponentNamespace):
FILE: reflex/components/radix/themes/components/dropdown_menu.py
class DropdownMenuRoot (line 32) | class DropdownMenuRoot(RadixThemesComponent):
class DropdownMenuTrigger (line 55) | class DropdownMenuTrigger(RadixThemesTriggerComponent):
class DropdownMenuContent (line 70) | class DropdownMenuContent(RadixThemesComponent):
class DropdownMenuSubTrigger (line 136) | class DropdownMenuSubTrigger(RadixThemesTriggerComponent):
class DropdownMenuSub (line 155) | class DropdownMenuSub(RadixThemesComponent):
class DropdownMenuSubContent (line 170) | class DropdownMenuSubContent(RadixThemesComponent):
class DropdownMenuItem (line 217) | class DropdownMenuItem(RadixThemesComponent):
class DropdownMenuSeparator (line 246) | class DropdownMenuSeparator(RadixThemesComponent):
class DropdownMenu (line 252) | class DropdownMenu(ComponentNamespace):
FILE: reflex/components/radix/themes/components/hover_card.py
class HoverCardRoot (line 17) | class HoverCardRoot(RadixThemesComponent):
class HoverCardTrigger (line 38) | class HoverCardTrigger(RadixThemesTriggerComponent):
class HoverCardContent (line 46) | class HoverCardContent(elements.Div, RadixThemesComponent):
class HoverCard (line 79) | class HoverCard(ComponentNamespace):
FILE: reflex/components/radix/themes/components/icon_button.py
class IconButton (line 27) | class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent):
method create (line 51) | def create(cls, *children, **props) -> Component:
method add_style (line 89) | def add_style(self):
FILE: reflex/components/radix/themes/components/inset.py
class Inset (line 13) | class Inset(elements.Div, RadixThemesComponent):
FILE: reflex/components/radix/themes/components/popover.py
class PopoverRoot (line 17) | class PopoverRoot(RadixThemesComponent):
class PopoverTrigger (line 35) | class PopoverTrigger(RadixThemesTriggerComponent):
class PopoverContent (line 43) | class PopoverContent(elements.Div, RadixThemesComponent):
class PopoverClose (line 94) | class PopoverClose(RadixThemesTriggerComponent):
class Popover (line 100) | class Popover(ComponentNamespace):
FILE: reflex/components/radix/themes/components/progress.py
class Progress (line 12) | class Progress(RadixThemesComponent):
method _color_selector (line 45) | def _color_selector(color: str) -> Style:
method create (line 57) | def create(cls, *children, **props) -> Component:
FILE: reflex/components/radix/themes/components/radio.py
class Radio (line 10) | class Radio(RadixThemesComponent):
FILE: reflex/components/radix/themes/components/radio_cards.py
class RadioCardsRoot (line 12) | class RadioCardsRoot(RadixThemesComponent):
class RadioCardsItem (line 66) | class RadioCardsItem(RadixThemesComponent):
class RadioCards (line 86) | class RadioCards(SimpleNamespace):
FILE: reflex/components/radix/themes/components/radio_group.py
class RadioGroupRoot (line 26) | class RadioGroupRoot(RadixThemesComponent):
class RadioGroupItem (line 65) | class RadioGroupItem(RadixThemesComponent):
class HighLevelRadioGroup (line 80) | class HighLevelRadioGroup(RadixThemesComponent):
method create (line 123) | def create(
class RadioGroup (line 206) | class RadioGroup(ComponentNamespace):
FILE: reflex/components/radix/themes/components/scroll_area.py
class ScrollArea (line 9) | class ScrollArea(RadixThemesComponent):
FILE: reflex/components/radix/themes/components/segmented_control.py
function on_value_change (line 15) | def on_value_change(
class SegmentedControlRoot (line 29) | class SegmentedControlRoot(RadixThemesComponent):
class SegmentedControlItem (line 61) | class SegmentedControlItem(RadixThemesComponent):
class SegmentedControl (line 72) | class SegmentedControl(SimpleNamespace):
FILE: reflex/components/radix/themes/components/select.py
class SelectRoot (line 19) | class SelectRoot(RadixThemesComponent):
class SelectTrigger (line 58) | class SelectTrigger(RadixThemesComponent):
class SelectContent (line 80) | class SelectContent(RadixThemesComponent):
class SelectGroup (line 119) | class SelectGroup(RadixThemesComponent):
class SelectItem (line 127) | class SelectItem(RadixThemesComponent):
class SelectLabel (line 141) | class SelectLabel(RadixThemesComponent):
class SelectSeparator (line 149) | class SelectSeparator(RadixThemesComponent):
class HighLevelSelect (line 155) | class HighLevelSelect(SelectRoot):
method create (line 186) | def create(cls, items: list[str] | Var[list[str]], **props) -> Component:
class Select (line 246) | class Select(ComponentNamespace):
FILE: reflex/components/radix/themes/components/separator.py
class Separator (line 12) | class Separator(RadixThemesComponent):
FILE: reflex/components/radix/themes/components/skeleton.py
class Skeleton (line 9) | class Skeleton(RadixLoadingProp, RadixThemesComponent):
FILE: reflex/components/radix/themes/components/slider.py
class Slider (line 21) | class Slider(RadixThemesComponent):
method create (line 81) | def create(
FILE: reflex/components/radix/themes/components/spinner.py
class Spinner (line 12) | class Spinner(RadixLoadingProp, RadixThemesComponent):
FILE: reflex/components/radix/themes/components/switch.py
class Switch (line 13) | class Switch(RadixThemesComponent):
FILE: reflex/components/radix/themes/components/table.py
class TableRoot (line 12) | class TableRoot(elements.Table, RadixThemesComponent):
class TableHeader (line 24) | class TableHeader(elements.Thead, RadixThemesComponent):
class TableRow (line 34) | class TableRow(elements.Tr, RadixThemesComponent):
class TableColumnHeaderCell (line 45) | class TableColumnHeaderCell(elements.Th, RadixThemesComponent):
class TableBody (line 69) | class TableBody(elements.Tbody, RadixThemesComponent):
class TableCell (line 84) | class TableCell(elements.Td, CommonPaddingProps, RadixThemesComponent):
class TableRowHeaderCell (line 107) | class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesCom...
class Table (line 131) | class Table(ComponentNamespace):
FILE: reflex/components/radix/themes/components/tabs.py
class TabsRoot (line 18) | class TabsRoot(RadixThemesComponent):
method add_style (line 44) | def add_style(self) -> dict[str, Any] | None:
class TabsList (line 57) | class TabsList(RadixThemesComponent):
method add_style (line 68) | def add_style(self):
class TabsTrigger (line 82) | class TabsTrigger(RadixThemesComponent):
method create (line 101) | def create(cls, *children, **props) -> Component:
method _exclude_props (line 116) | def _exclude_props(self) -> list[str]:
method add_style (line 119) | def add_style(self) -> dict[str, Any] | None:
class TabsContent (line 128) | class TabsContent(RadixThemesComponent):
method add_style (line 139) | def add_style(self) -> dict[str, Any] | None:
class Tabs (line 150) | class Tabs(ComponentNamespace):
FILE: reflex/components/radix/themes/components/text_area.py
class TextArea (line 21) | class TextArea(RadixThemesComponent, elements.Textarea):
method create (line 87) | def create(cls, *children, **props) -> Component:
method add_style (line 102) | def add_style(self):
FILE: reflex/components/radix/themes/components/text_field.py
class TextFieldRoot (line 25) | class TextFieldRoot(elements.Input, RadixThemesComponent):
method create (line 94) | def create(cls, *children, **props) -> Component:
class TextFieldSlot (line 125) | class TextFieldSlot(RadixThemesComponent):
class TextField (line 137) | class TextField(ComponentNamespace):
FILE: reflex/components/radix/themes/components/tooltip.py
class Tooltip (line 35) | class Tooltip(RadixThemesComponent):
method create (line 100) | def create(cls, *children, **props) -> Component:
FILE: reflex/components/radix/themes/layout/base.py
class LayoutComponent (line 18) | class LayoutComponent(CommonMarginProps, CommonPaddingProps, RadixThemes...
FILE: reflex/components/radix/themes/layout/box.py
class Box (line 9) | class Box(elements.Div, RadixThemesComponent):
FILE: reflex/components/radix/themes/layout/center.py
class Center (line 10) | class Center(Flex):
method add_style (line 13) | def add_style(self) -> dict[str, Any] | None:
FILE: reflex/components/radix/themes/layout/container.py
class Container (line 16) | class Container(elements.Div, RadixThemesComponent):
method create (line 28) | def create(
FILE: reflex/components/radix/themes/layout/flex.py
class Flex (line 21) | class Flex(elements.Div, RadixThemesComponent):
FILE: reflex/components/radix/themes/layout/grid.py
class Grid (line 20) | class Grid(elements.Div, RadixThemesComponent):
FILE: reflex/components/radix/themes/layout/list.py
class BaseList (line 42) | class BaseList(BaseHTML, MarkdownComponentMap):
method create (line 56) | def create(
method add_style (line 85) | def add_style(self) -> dict[str, Any] | None:
method _exclude_props (line 95) | def _exclude_props(self) -> list[str]:
class UnorderedList (line 99) | class UnorderedList(BaseList, Ul):
method create (line 105) | def create(
class OrderedList (line 128) | class OrderedList(BaseList, Ol):
method create (line 134) | def create(
class ListItem (line 157) | class ListItem(Li, MarkdownComponentMap):
method create (line 161) | def create(cls, *children, **props):
class List (line 179) | class List(ComponentNamespace):
function __getattr__ (line 194) | def __getattr__(name: Any):
FILE: reflex/components/radix/themes/layout/section.py
class Section (line 15) | class Section(elements.Section, RadixThemesComponent):
FILE: reflex/components/radix/themes/layout/spacer.py
class Spacer (line 10) | class Spacer(Flex):
method add_style (line 13) | def add_style(self) -> dict[str, Any] | None:
FILE: reflex/components/radix/themes/layout/stack.py
class Stack (line 13) | class Stack(Flex):
method create (line 23) | def create(
class VStack (line 49) | class VStack(Stack):
class HStack (line 56) | class HStack(Stack):
FILE: reflex/components/radix/themes/typography/blockquote.py
class Blockquote (line 16) | class Blockquote(elements.Blockquote, RadixThemesComponent):
FILE: reflex/components/radix/themes/typography/code.py
class Code (line 21) | class Code(elements.Code, RadixThemesComponent, MarkdownComponentMap):
FILE: reflex/components/radix/themes/typography/heading.py
class Heading (line 17) | class Heading(elements.H1, RadixThemesComponent, MarkdownComponentMap):
FILE: reflex/components/radix/themes/typography/link.py
class Link (line 29) | class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
method add_imports (line 58) | def add_imports(self) -> ImportDict:
method create (line 69) | def create(cls, *children, **props) -> Component:
FILE: reflex/components/radix/themes/typography/text.py
class Text (line 41) | class Text(elements.Span, RadixThemesComponent, MarkdownComponentMap):
class Span (line 71) | class Span(Text):
class Em (line 77) | class Em(elements.Em, RadixThemesComponent):
class Kbd (line 83) | class Kbd(elements.Kbd, RadixThemesComponent):
class Quote (line 92) | class Quote(elements.Q, RadixThemesComponent):
class Strong (line 98) | class Strong(elements.Strong, RadixThemesComponent):
class TextNamespace (line 104) | class TextNamespace(ComponentNamespace):
FILE: reflex/components/react_player/audio.py
class Audio (line 6) | class Audio(ReactPlayer):
FILE: reflex/components/react_player/react_player.py
class Progress (line 17) | class Progress(TypedDict):
function _on_progress_signature (line 27) | def _on_progress_signature(event: ReactPlayerEvent) -> list[Var[Progress]]:
function _player_info_key_or_zero (line 62) | def _player_info_key_or_zero(event: ReactPlayerEvent, key: str) -> Var[f...
function _on_time_update_signature (line 80) | def _on_time_update_signature(event: ReactPlayerEvent) -> list[Var[float]]:
function _on_duration_change_signature (line 92) | def _on_duration_change_signature(event: ReactPlayerEvent) -> list[Var[f...
function _on_rate_change_signature (line 104) | def _on_rate_change_signature(event: ReactPlayerEvent) -> list[Var[float]]:
class ReactPlayer (line 128) | class ReactPlayer(Component):
method create (line 218) | def create(cls, *children, **props) -> ReactPlayer:
method _render (line 244) | def _render(self, props: dict[str, Any] | None = None):
FILE: reflex/components/react_player/video.py
class Video (line 6) | class Video(ReactPlayer):
FILE: reflex/components/react_router/dom.py
class To (line 13) | class To(TypedDict):
class ReactRouterLink (line 26) | class ReactRouterLink(A):
method create (line 54) | def create(cls, *children, **props):
FILE: reflex/components/recharts/cartesian.py
class Axis (line 35) | class Axis(Recharts):
class XAxis (line 135) | class XAxis(Axis):
class YAxis (line 158) | class YAxis(Axis):
class ZAxis (line 175) | class ZAxis(Recharts):
class Brush (line 201) | class Brush(Recharts):
method get_event_triggers (line 245) | def get_event_triggers(cls) -> dict[str, Var | Any]:
class Cartesian (line 256) | class Cartesian(Recharts):
class Area (line 326) | class Area(Cartesian):
class Bar (line 370) | class Bar(Cartesian):
class Line (line 417) | class Line(Cartesian):
class Scatter (line 464) | class Scatter(Recharts):
class Funnel (line 541) | class Funnel(Recharts):
class ErrorBar (line 612) | class ErrorBar(Recharts):
class Reference (line 635) | class Reference(Recharts):
class Segment (line 651) | class Segment(TypedDict):
class ReferenceLine (line 658) | class ReferenceLine(Reference):
class ReferenceDot (line 684) | class ReferenceDot(Reference):
class ReferenceArea (line 734) | class ReferenceArea(Recharts):
class Grid (line 775) | class Grid(Recharts):
class CartesianGrid (line 791) | class CartesianGrid(Grid):
class CartesianAxis (line 823) | class CartesianAxis(Grid):
FILE: reflex/components/recharts/charts.py
class ChartBase (line 25) | class ChartBase(RechartsCharts):
method _ensure_valid_dimension (line 47) | def _ensure_valid_dimension(name: str, value: Any) -> None:
method create (line 74) | def create(cls, *children: Any, **props: Any) -> Component:
class CategoricalChartBase (line 105) | class CategoricalChartBase(ChartBase):
class AreaChart (line 127) | class AreaChart(CategoricalChartBase):
class BarChart (line 153) | class BarChart(CategoricalChartBase):
class LineChart (line 193) | class LineChart(CategoricalChartBase):
class ComposedChart (line 215) | class ComposedChart(CategoricalChartBase):
class PieChart (line 254) | class PieChart(ChartBase):
class RadarChart (line 287) | class RadarChart(ChartBase):
method get_event_triggers (line 329) | def get_event_triggers(cls) -> dict[str, Var | Any]:
class RadialBarChart (line 342) | class RadialBarChart(ChartBase):
class ScatterChart (line 393) | class ScatterChart(ChartBase):
method get_event_triggers (line 419) | def get_event_triggers(cls) -> dict[str, Var | Any]:
class FunnelChart (line 437) | class FunnelChart(ChartBase):
class Treemap (line 457) | class Treemap(RechartsCharts):
method create (line 501) | def create(cls, *children, **props) -> Component:
FILE: reflex/components/recharts/general.py
class ResponsiveContainer (line 24) | class ResponsiveContainer(Recharts, MemoizationLeaf):
class Legend (line 68) | class Legend(Recharts):
class GraphingTooltip (line 133) | class GraphingTooltip(Recharts):
class Label (line 198) | class Label(Recharts):
class LabelList (line 218) | class LabelList(Recharts):
class Cell (line 241) | class Cell(Recharts):
FILE: reflex/components/recharts/polar.py
class Pie (line 25) | class Pie(Recharts):
method get_event_triggers (line 99) | def get_event_triggers(cls) -> dict[str, Var | Any]:
class Radar (line 117) | class Radar(Recharts):
method get_event_triggers (line 164) | def get_event_triggers(cls) -> dict[str, Var | Any]:
class RadialBar (line 176) | class RadialBar(Recharts):
method get_event_triggers (line 217) | def get_event_triggers(cls) -> dict[str, Var | Any]:
class PolarAngleAxis (line 235) | class PolarAngleAxis(Recharts):
class PolarGrid (line 306) | class PolarGrid(Recharts):
class PolarRadiusAxis (line 341) | class PolarRadiusAxis(Recharts):
method get_event_triggers (line 391) | def get_event_triggers(cls) -> dict[str, Var | Any]:
FILE: reflex/components/recharts/recharts.py
class Recharts (line 8) | class Recharts(Component):
method _get_style (line 13) | def _get_style(self) -> dict:
class RechartsCharts (line 17) | class RechartsCharts(NoSSRComponent, MemoizationLeaf):
FILE: reflex/components/sonner/toast.py
class ToastAction (line 39) | class ToastAction:
function serialize_action (line 47) | def serialize_action(action: ToastAction) -> dict:
function _toast_callback_signature (line 62) | def _toast_callback_signature(toast: Var) -> list[Var]:
class ToastProps (line 78) | class ToastProps(NoExtrasAllowedProps):
method dict (line 141) | def dict(self, *args: Any, **kwargs: Any) -> dict[str, Any]:
class Toaster (line 172) | class Toaster(Component):
method add_hooks (line 221) | def add_hooks(self) -> list[Var | str]:
method send_toast (line 241) | def send_toast(
method toast_info (line 297) | def toast_info(message: str | Var[str] = "", **kwargs: Any) -> EventSpec:
method toast_warning (line 310) | def toast_warning(message: str | Var[str] = "", **kwargs: Any) -> Even...
method toast_error (line 323) | def toast_error(message: str | Var[str] = "", **kwargs: Any) -> EventS...
method toast_success (line 336) | def toast_success(message: str | Var[str] = "", **kwargs: Any) -> Even...
method toast_loading (line 349) | def toast_loading(message: str | Var[str] = "", **kwargs: Any) -> Even...
method toast_dismiss (line 362) | def toast_dismiss(id: Var[str] | str | None = None) -> EventSpec:
method create (line 386) | def create(cls, *children: Any, **props: Any) -> Component:
class ToastNamespace (line 402) | class ToastNamespace(ComponentNamespace):
FILE: reflex/components/tags/cond_tag.py
class CondTag (line 11) | class CondTag(Tag):
method __iter__ (line 23) | def __iter__(self) -> Iterator[tuple[str, Any]]:
FILE: reflex/components/tags/iter_tag.py
class IterTag (line 20) | class IterTag(Tag):
method get_iterable_var_type (line 37) | def get_iterable_var_type(self) -> GenericType:
method get_index_var (line 45) | def get_index_var(self) -> Var:
method get_arg_var (line 58) | def get_arg_var(self) -> Var:
method render_component (line 71) | def render_component(self) -> Component:
FILE: reflex/components/tags/match_tag.py
class MatchTag (line 11) | class MatchTag(Tag):
method __iter__ (line 23) | def __iter__(self) -> Iterator[tuple[str, Any]]:
FILE: reflex/components/tags/tag.py
function render_prop (line 14) | def render_prop(value: Any) -> Any:
class Tag (line 35) | class Tag:
method format_props (line 50) | def format_props(self) -> list[str]:
method set (line 58) | def set(self, **kwargs: Any):
method __iter__ (line 69) | def __iter__(self) -> Iterator[tuple[str, Any]]:
method add_props (line 83) | def add_props(self, **kwargs: Any | None) -> Tag:
method remove_props (line 108) | def remove_props(self, *args: str) -> Tag:
method is_valid_prop (line 128) | def is_valid_prop(prop: Var | None) -> bool:
FILE: reflex/components/tags/tagless.py
class Tagless (line 10) | class Tagless(Tag):
method __str__ (line 16) | def __str__(self) -> str:
method __iter__ (line 30) | def __iter__(self):
FILE: reflex/config.py
class DBConfig (line 38) | class DBConfig:
method postgresql (line 49) | def postgresql(
method postgresql_psycopg (line 79) | def postgresql_psycopg(
method sqlite (line 109) | def sqlite(
method get_url (line 126) | def get_url(self) -> str:
class BaseConfig (line 151) | class BaseConfig:
class Config (line 280) | class Config(BaseConfig):
method _post_init (line 331) | def _post_init(self, **kwargs):
method _normalize_disable_plugins (line 380) | def _normalize_disable_plugins(self):
method _add_builtin_plugins (line 416) | def _add_builtin_plugins(self):
method class_fields (line 443) | def class_fields(cls) -> set[str]:
method __init__ (line 453) | def __init__(self, **kwargs):
method json (line 465) | def json(self) -> str:
method app_module (line 478) | def app_module(self) -> ModuleType | None:
method module (line 491) | def module(self) -> str:
method update_from_env (line 501) | def update_from_env(self) -> dict[str, Any]:
method get_event_namespace (line 544) | def get_event_namespace(self) -> str:
method _replace_defaults (line 553) | def _replace_defaults(self, **kwargs):
method _set_persistent (line 585) | def _set_persistent(self, **kwargs):
function _get_config (line 599) | def _get_config() -> Config:
function get_config (line 620) | def get_config(reload: bool = False) -> Config:
FILE: reflex/constants/base.py
class Dirs (line 19) | class Dirs(SimpleNamespace):
function _reflex_version (line 67) | def _reflex_version() -> str:
class Reflex (line 79) | class Reflex(SimpleNamespace):
class ReflexHostingCLI (line 110) | class ReflexHostingCLI(SimpleNamespace):
class Templates (line 117) | class Templates(SimpleNamespace):
class Dirs (line 142) | class Dirs(SimpleNamespace):
class Javascript (line 153) | class Javascript(SimpleNamespace):
class ReactRouter (line 160) | class ReactRouter(Javascript):
class ColorMode (line 184) | class ColorMode(SimpleNamespace):
class Env (line 198) | class Env(str, Enum):
class LogLevel (line 206) | class LogLevel(str, Enum):
method from_string (line 217) | def from_string(cls, level: str | None) -> LogLevel | None:
method __le__ (line 233) | def __le__(self, other: LogLevel) -> bool:
method subprocess_level (line 245) | def subprocess_level(self):
class Ping (line 258) | class Ping(SimpleNamespace):
FILE: reflex/constants/colors.py
function format_color (line 55) | def format_color(
class Color (line 78) | class Color:
method __format__ (line 90) | def __format__(self, format_spec: str) -> str:
FILE: reflex/constants/compiler.py
class Ext (line 18) | class Ext(SimpleNamespace):
class CompileVars (line 37) | class CompileVars(SimpleNamespace):
class PageNames (line 82) | class PageNames(SimpleNamespace):
class ComponentName (line 101) | class ComponentName(Enum):
method zip (line 107) | def zip(self):
class CompileContext (line 116) | class CompileContext(str, Enum):
class Imports (line 125) | class Imports(SimpleNamespace):
class Hooks (line 135) | class Hooks(SimpleNamespace):
class HookPosition (line 140) | class HookPosition(enum.Enum):
class MemoizationDisposition (line 148) | class MemoizationDisposition(enum.Enum):
class MemoizationMode (line 158) | class MemoizationMode:
class SpecialAttributes (line 181) | class SpecialAttributes(enum.Enum):
method is_special (line 189) | def is_special(cls, attr: str) -> bool:
class ResetStylesheet (line 201) | class ResetStylesheet(SimpleNamespace):
FILE: reflex/constants/config.py
class Config (line 14) | class Config(SimpleNamespace):
class Expiration (line 23) | class Expiration(SimpleNamespace):
class GitIgnore (line 36) | class GitIgnore(SimpleNamespace):
class PyprojectToml (line 52) | class PyprojectToml(SimpleNamespace):
class RequirementsTxt (line 59) | class RequirementsTxt(SimpleNamespace):
class DefaultPorts (line 68) | class DefaultPorts(SimpleNamespace):
FILE: reflex/constants/custom_components.py
class CustomComponents (line 9) | class CustomComponents(SimpleNamespace):
FILE: reflex/constants/event.py
class Endpoint (line 7) | class Endpoint(Enum):
method __str__ (line 17) | def __str__(self) -> str:
method get_url (line 25) | def get_url(self) -> str:
class SocketEvent (line 47) | class SocketEvent(SimpleNamespace):
method __str__ (line 53) | def __str__(self) -> str:
class EventTriggers (line 62) | class EventTriggers(SimpleNamespace):
FILE: reflex/constants/installer.py
class Bun (line 13) | class Bun(SimpleNamespace):
method ROOT_PATH (line 35) | def ROOT_PATH(cls):
method DEFAULT_PATH (line 47) | def DEFAULT_PATH(cls):
class Node (line 62) | class Node(SimpleNamespace):
function _determine_react_router_version (line 77) | def _determine_react_router_version() -> str:
function _determine_react_version (line 89) | def _determine_react_version() -> str:
class PackageJson (line 101) | class PackageJson(SimpleNamespace):
class Commands (line 104) | class Commands(SimpleNamespace):
method get_prod_command (line 111) | def get_prod_command(frontend_path: str = "") -> str:
method DEPENDENCIES (line 132) | def DEPENDENCIES(cls) -> dict[str, str]:
FILE: reflex/constants/route.py
class RouteArgType (line 7) | class RouteArgType(SimpleNamespace):
class RouteVar (line 19) | class RouteVar(SimpleNamespace):
class RouteRegex (line 36) | class RouteRegex(SimpleNamespace):
class DefaultPage (line 71) | class DefaultPage(SimpleNamespace):
class Page404 (line 85) | class Page404(SimpleNamespace):
FILE: reflex/constants/state.py
class StateManagerMode (line 6) | class StateManagerMode(str, Enum):
FILE: reflex/constants/utils.py
class classproperty (line 10) | class classproperty(Generic[T, V]):
method __init__ (line 13) | def __init__(self, getter: Callable[[type[T]], V]) -> None:
method __get__ (line 21) | def __get__(self, instance: Any, owner: type[T]) -> V:
FILE: reflex/custom_components/custom_components.py
function _pyproject_toml_template (line 21) | def _pyproject_toml_template(
function _readme_template (line 62) | def _readme_template(module_name: str, package_name: str) -> str:
function _source_template (line 84) | def _source_template(component_class_name: str, module_name: str) -> str:
function _init_template (line 155) | def _init_template(module_name: str) -> str:
function _demo_app_template (line 167) | def _demo_app_template(custom_component_module_dir: str, module_name: st...
function set_loglevel (line 217) | def set_loglevel(ctx: Any, self: Any, value: str | None):
function custom_components_cli (line 231) | def custom_components_cli():
function set_directory (line 251) | def set_directory(working_directory: str | Path):
function _create_package_config (line 269) | def _create_package_config(module_name: str, package_name: str):
function _create_readme (line 286) | def _create_readme(module_name: str, package_name: str):
function _write_source_and_init_py (line 302) | def _write_source_and_init_py(
function _populate_demo_app (line 325) | def _populate_demo_app(name_variants: NameVariants):
function _get_default_library_name_parts (line 358) | def _get_default_library_name_parts() -> list[str]:
function _validate_library_name (line 404) | def _validate_library_name(library_name: str | None) -> NameVariants:
function _populate_custom_component_project (line 462) | def _populate_custom_component_project(name_variants: NameVariants):
function init (line 505) | def init(
function _pip_install_on_demand (line 565) | def _pip_install_on_demand(
function _run_commands_in_subprocess (line 592) | def _run_commands_in_subprocess(cmds: list[str]) -> bool:
function _make_pyi_files (line 613) | def _make_pyi_files():
function _run_build (line 626) | def _run_build():
function build (line 645) | def build():
function _collect_details_for_gallery (line 650) | def _collect_details_for_gallery():
function _validate_url_with_protocol_prefix (line 742) | def _validate_url_with_protocol_prefix(url: str | None) -> bool:
function _get_file_from_prompt_in_loop (line 754) | def _get_file_from_prompt_in_loop() -> tuple[bytes, str] | None:
function share_more_detail (line 783) | def share_more_detail():
function install (line 790) | def install():
FILE: reflex/environment.py
function get_default_value_for_field (line 34) | def get_default_value_for_field(field: dataclasses.Field) -> Any:
function interpret_boolean_env (line 55) | def interpret_boolean_env(value: str, field_name: str) -> bool:
function interpret_int_env (line 79) | def interpret_int_env(value: str, field_name: str) -> int:
function interpret_float_env (line 99) | def interpret_float_env(value: str, field_name: str) -> float:
function interpret_existing_path_env (line 119) | def interpret_existing_path_env(value: str, field_name: str) -> Existing...
function interpret_path_env (line 139) | def interpret_path_env(value: str, field_name: str) -> Path:
function interpret_plugin_class_env (line 152) | def interpret_plugin_class_env(value: str, field_name: str) -> type[Plug...
function interpret_plugin_env (line 192) | def interpret_plugin_env(value: str, field_name: str) -> Plugin:
function interpret_enum_env (line 216) | def interpret_enum_env(value: str, field_type: GenericType, field_name: ...
class SequenceOptions (line 238) | class SequenceOptions:
function interpret_env_var_value (line 248) | def interpret_env_var_value(
class EnvVar (line 359) | class EnvVar(Generic[T]):
method __init__ (line 366) | def __init__(self, name: str, default: Any, type_: T) -> None:
method interpret (line 378) | def interpret(self, value: str) -> T:
method getenv (line 389) | def getenv(self) -> T | None:
method is_set (line 400) | def is_set(self) -> bool:
method get (line 408) | def get(self) -> T:
method set (line 419) | def set(self, value: T | None) -> None:
function get_type_hints_environment (line 438) | def get_type_hints_environment(cls: type) -> dict[str, Any]:
class env_var (line 450) | class env_var: # noqa: N801 # pyright: ignore [reportRedeclaration]
method __init__ (line 457) | def __init__(self, default: Any, internal: bool = False) -> None:
method __set_name__ (line 467) | def __set_name__(self, owner: Any, name: str):
method __get__ (line 476) | def __get__(
function env_var (line 497) | def env_var(default: Any, internal: bool = False) -> EnvVar:
method __init__ (line 457) | def __init__(self, default: Any, internal: bool = False) -> None:
method __set_name__ (line 467) | def __set_name__(self, owner: Any, name: str):
method __get__ (line 476) | def __get__(
class PathExistsFlag (line 510) | class PathExistsFlag:
class PerformanceMode (line 517) | class PerformanceMode(enum.Enum):
class ExecutorType (line 525) | class ExecutorType(enum.Enum):
method get_executor_from_environment (line 533) | def get_executor_from_environment(cls):
class EnvironmentVariables (line 616) | class EnvironmentVariables:
function _paths_from_env_files (line 810) | def _paths_from_env_files(env_files: str) -> list[Path]:
function _load_dotenv_from_files (line 829) | def _load_dotenv_from_files(files: list[Path]):
function _paths_from_environment (line 851) | def _paths_from_environment() -> list[Path]:
function _load_dotenv_from_env (line 864) | def _load_dotenv_from_env():
FILE: reflex/event.py
class Event (line 63) | class Event:
method substate_token (line 79) | def substate_token(self) -> str:
class EventActionsMixin (line 100) | class EventActionsMixin:
method stop_propagation (line 107) | def stop_propagation(self) -> Self:
method prevent_default (line 119) | def prevent_default(self) -> Self:
method throttle (line 130) | def throttle(self, limit_ms: int) -> Self:
method debounce (line 144) | def debounce(self, delay_ms: int) -> Self:
method temporal (line 159) | def temporal(self) -> Self:
class EventHandler (line 176) | class EventHandler(EventActionsMixin):
method __hash__ (line 186) | def __hash__(self):
method get_parameters (line 194) | def get_parameters(self) -> Mapping[str, inspect.Parameter]:
method _parameters (line 205) | def _parameters(self) -> Mapping[str, inspect.Parameter]:
method __class_getitem__ (line 217) | def __class_getitem__(cls, args_spec: str) -> Annotated:
method is_background (line 229) | def is_background(self) -> bool:
method __call__ (line 237) | def __call__(self, *args: Any, **kwargs: Any) -> "EventSpec":
class EventSpec (line 307) | class EventSpec(EventActionsMixin):
method __init__ (line 323) | def __init__(
method with_args (line 345) | def with_args(self, args: tuple[tuple[Var, Var], ...]) -> "EventSpec":
method add_args (line 361) | def add_args(self, *args: Var) -> "EventSpec":
class CallableEventSpec (line 395) | class CallableEventSpec(EventSpec):
method __init__ (line 404) | def __init__(self, fn: Callable[..., EventSpec] | None = None, **kwargs):
method __call__ (line 424) | def __call__(self, *args, **kwargs) -> EventSpec:
class EventChain (line 449) | class EventChain(EventActionsMixin):
method create (line 461) | def create(
class JavascriptHTMLInputElement (line 562) | class JavascriptHTMLInputElement:
class JavascriptInputEvent (line 573) | class JavascriptInputEvent:
class JavascriptKeyboardEvent (line 583) | class JavascriptKeyboardEvent:
function input_event (line 593) | def input_event(e: ObjectVar[JavascriptInputEvent]) -> tuple[Var[str]]:
function int_input_event (line 605) | def int_input_event(e: ObjectVar[JavascriptInputEvent]) -> tuple[Var[int]]:
function float_input_event (line 617) | def float_input_event(e: ObjectVar[JavascriptInputEvent]) -> tuple[Var[f...
function checked_input_event (line 629) | def checked_input_event(e: ObjectVar[JavascriptInputEvent]) -> tuple[Var...
function on_submit_event (line 644) | def on_submit_event() -> tuple[Var[dict[str, Any]]]:
function on_submit_string_event (line 653) | def on_submit_string_event() -> tuple[Var[dict[str, str]]]:
class KeyInputInfo (line 662) | class KeyInputInfo(TypedDict):
function key_event (line 671) | def key_event(
class JavascriptMouseEvent (line 699) | class JavascriptMouseEvent:
class JavascriptPointerEvent (line 712) | class JavascriptPointerEvent(JavascriptMouseEvent):
class MouseEventInfo (line 719) | class MouseEventInfo(TypedDict):
class PointerEventInfo (line 732) | class PointerEventInfo(MouseEventInfo):
function pointer_event_spec (line 736) | def pointer_event_spec(
function no_args_event_spec (line 763) | def no_args_event_spec() -> tuple[()]:
class IdentityEventReturn (line 776) | class IdentityEventReturn(Generic[T], Protocol):
method __call__ (line 779) | def __call__(self, *values: Var[T]) -> tuple[Var[T], ...]:
function passthrough_event_spec (line 792) | def passthrough_event_spec( # pyright: ignore [reportOverlappingOverload]
function passthrough_event_spec (line 798) | def passthrough_event_spec(
function passthrough_event_spec (line 804) | def passthrough_event_spec(*event_types: type[T]) -> IdentityEventReturn...
function passthrough_event_spec (line 807) | def passthrough_event_spec(*event_types: type[T]) -> IdentityEventReturn...
class FileUpload (line 845) | class FileUpload:
method on_upload_progress_args_spec (line 853) | def on_upload_progress_args_spec(_prog: Var[dict[str, int | float | bo...
method as_event_spec (line 861) | def as_event_spec(self, handler: EventHandler) -> EventSpec:
function server_side (line 945) | def server_side(name: str, sig: inspect.Signature, **kwargs) -> EventSpec:
function redirect (line 975) | def redirect(
function redirect (line 984) | def redirect(
function redirect (line 992) | def redirect(
function console_log (line 1020) | def console_log(message: str | Var[str]) -> EventSpec:
function noop (line 1033) | def noop() -> EventSpec:
function back (line 1042) | def back() -> EventSpec:
function window_alert (line 1053) | def window_alert(message: str | Var[str]) -> EventSpec:
function set_focus (line 1065) | def set_focus(ref: str) -> EventSpec:
function blur_focus (line 1081) | def blur_focus(ref: str) -> EventSpec:
function scroll_to (line 1097) | def scroll_to(elem_id: str, align_to_top: bool | Var[bool] = True) -> Ev...
function set_value (line 1118) | def set_value(ref: str, value: Any) -> EventSpec:
function remove_cookie (line 1136) | def remove_cookie(key: str, options: dict[str, Any] | None = None) -> Ev...
function clear_local_storage (line 1156) | def clear_local_storage() -> EventSpec:
function remove_local_storage (line 1168) | def remove_local_storage(key: str) -> EventSpec:
function clear_session_storage (line 1184) | def clear_session_storage() -> EventSpec:
function remove_session_storage (line 1196) | def remove_session_storage(key: str) -> EventSpec:
function set_clipboard (line 1212) | def set_clipboard(content: str | Var[str]) -> EventSpec:
function download (line 1230) | def download(
function call_script (line 1310) | def call_script(
function call_function (line 1351) | def call_function(
function run_script (line 1387) | def run_script(
function get_event (line 1407) | def get_event(state: "BaseState", event: str):
function get_hydrate_event (line 1420) | def get_hydrate_event(state: "BaseState") -> str:
function _values_returned_from_event (line 1432) | def _values_returned_from_event(event_spec_annotations: list[Any]) -> li...
function _check_event_args_subclass_of_callback (line 1441) | def _check_event_args_subclass_of_callback(
function call_event_handler (line 1539) | def call_event_handler(
function unwrap_var_annotation (line 1630) | def unwrap_var_annotation(annotation: GenericType):
function resolve_annotation (line 1644) | def resolve_annotation(annotations: dict[str, Any], arg_name: str, spec:...
function parse_args_spec (line 1667) | def parse_args_spec(arg_spec: ArgsSpec | Sequence[ArgsSpec]):
function args_specs_from_fields (line 1697) | def args_specs_from_fields(
function check_fn_match_arg_spec (line 1722) | def check_fn_match_arg_spec(
function call_event_fn (line 1769) | def call_event_fn(
function get_handler_args (line 1833) | def get_handler_args(
function fix_events (line 1849) | def fix_events(
function get_fn_signature (line 1915) | def get_fn_signature(fn: Callable) -> inspect.Signature:
class EventVar (line 1936) | class EventVar(ObjectVar, python_types=(EventSpec, EventHandler)):
method bool (line 1939) | def bool(self) -> NoReturn:
class LiteralEventVar (line 1954) | class LiteralEventVar(VarOperationCall, LiteralVar, EventVar):
method __hash__ (line 1959) | def __hash__(self) -> int:
method create (line 1968) | def create(
class EventChainVar (line 2020) | class EventChainVar(BuilderFunctionVar, python_types=EventChain):
method bool (line 2023) | def bool(self) -> NoReturn:
class LiteralEventChainVar (line 2041) | class LiteralEventChainVar(ArgsFunctionOperationBuilder, LiteralVar, Eve...
method __hash__ (line 2046) | def __hash__(self) -> int:
method create (line 2055) | def create(
class EventCallback (line 2125) | class EventCallback(Generic[Unpack[P]], EventActionsMixin):
method __init__ (line 2128) | def __init__(self, func: Callable[[Any, Unpack[P]], Any]):
method __call__ (line 2137) | def __call__(
method __call__ (line 2142) | def __call__(
method __call__ (line 2147) | def __call__(
method __call__ (line 2154) | def __call__(
method __call__ (line 2162) | def __call__(
method __call__ (line 2170) | def __call__(self, *values) -> "EventCallback": # pyright: ignore [re...
method __get__ (line 2182) | def __get__(
method __get__ (line 2187) | def __get__(self, instance: Any, owner: Any) -> "Callable[[Unpack[P]]]...
method __get__ (line 2189) | def __get__(self, instance: Any, owner: Any) -> Callable:
class LambdaEventCallback (line 2205) | class LambdaEventCallback(Protocol[Unpack[P]]):
method __call__ (line 2211) | def __call__(self: "LambdaEventCallback[()]") -> Any: ...
method __call__ (line 2214) | def __call__(self: "LambdaEventCallback[V]", value: "Var[V]", /) -> An...
method __call__ (line 2217) | def __call__(
method __call__ (line 2222) | def __call__(
method __call__ (line 2230) | def __call__(self, *args: Var) -> Any:
class EventNamespace (line 2274) | class EventNamespace:
method __new__ (line 2329) | def __new__(
method __new__ (line 2344) | def __new__(
method __new__ (line 2356) | def __new__(
FILE: reflex/experimental/__init__.py
class ExperimentalNamespace (line 13) | class ExperimentalNamespace(SimpleNamespace):
method __getattribute__ (line 16) | def __getattribute__(self, item: str):
method run_in_thread (line 32) | def run_in_thread(self):
method register_component_warning (line 44) | def register_component_warning(component_name: str):
FILE: reflex/experimental/client_state.py
function _client_state_ref (line 25) | def _client_state_ref(var_name: str) -> str:
function _client_state_ref_dict (line 37) | def _client_state_ref_dict(var_name: str) -> str:
class ClientStateVar (line 54) | class ClientStateVar(Var):
method __hash__ (line 65) | def __hash__(self) -> int:
method create (line 79) | def create(
method value (line 185) | def value(self) -> Var:
method set_value (line 210) | def set_value(self, value: Any = NoValue) -> Var:
method set (line 247) | def set(self) -> Var:
method retrieve (line 259) | def retrieve(self, callback: EventHandler | Callable | None = None) ->...
method push (line 278) | def push(self, value: Any) -> EventSpec:
FILE: reflex/experimental/hooks.py
function _compose_react_imports (line 10) | def _compose_react_imports(tags: list[str]) -> dict[str, list[ImportVar]]:
function const (line 14) | def const(name: str | list[str], value: str | Var) -> Var:
function useCallback (line 29) | def useCallback(func: str, deps: list) -> Var: # noqa: N802
function useContext (line 45) | def useContext(context: str) -> Var: # noqa: N802
function useRef (line 60) | def useRef(default: str) -> Var: # noqa: N802
function useState (line 75) | def useState(var_name: str, default: str | None = None) -> Var: # noqa:...
FILE: reflex/istate/__init__.py
function _is_picklable (line 18) | def _is_picklable(obj: Any, dumps: Callable[[object], bytes]) -> bool:
function debug_failed_pickles (line 27) | def debug_failed_pickles(obj: object, dumps: Callable[[object], bytes]):
FILE: reflex/istate/data.py
class _FrozenDictStrStr (line 15) | class _FrozenDictStrStr(Mapping[str, str]):
method __init__ (line 18) | def __init__(self, **kwargs):
method __getitem__ (line 23) | def __getitem__(self, key: str) -> str:
method __iter__ (line 26) | def __iter__(self):
method __len__ (line 29) | def __len__(self):
method __hash__ (line 32) | def __hash__(self) -> int:
method __getstate__ (line 35) | def __getstate__(self) -> object:
method __setstate__ (line 38) | def __setstate__(self, state: object) -> None:
class _HeaderData (line 46) | class _HeaderData:
class HeaderData (line 71) | class HeaderData(_HeaderData):
method from_router_data (line 75) | def from_router_data(cls, router_data: dict) -> "HeaderData":
function _serialize_header_data (line 100) | def _serialize_header_data(obj: HeaderData) -> dict:
function serialize_frozen_dict_str_str (line 105) | def serialize_frozen_dict_str_str(obj: _FrozenDictStrStr) -> dict:
class ReflexURL (line 117) | class ReflexURL(str, _NetlocResultMixinStr):
method __new__ (line 129) | def __new__(cls, url: str):
class PageData (line 153) | class PageData:
method from_router_data (line 164) | def from_router_data(cls, router_data: dict) -> "PageData":
function _serialize_page_data (line 187) | def _serialize_page_data(obj: PageData) -> dict:
class SessionData (line 192) | class SessionData:
method from_router_data (line 200) | def from_router_data(cls, router_data: dict) -> "SessionData":
function _serialize_session_data (line 217) | def _serialize_session_data(obj: SessionData) -> dict:
class RouterData (line 222) | class RouterData:
method page (line 232) | def page(self) -> PageData:
method from_router_data (line 247) | def from_router_data(cls, router_data: dict) -> "RouterData":
function serialize_router_data (line 269) | def serialize_router_data(obj: RouterData) -> dict:
FILE: reflex/istate/manager/__init__.py
class StateModificationContext (line 19) | class StateModificationContext(TypedDict, total=False):
class StateManager (line 29) | class StateManager(ABC):
method create (line 36) | def create(cls, state: type[BaseState]):
method get_state (line 76) | async def get_state(self, token: str) -> BaseState:
method set_state (line 87) | async def set_state(
method modify_state (line 103) | async def modify_state(
method modify_state_with_links (line 118) | async def modify_state_with_links(
method close (line 146) | async def close(self): # noqa: B027
function _default_token_expiration (line 150) | def _default_token_expiration() -> int:
function reset_disk_state_manager (line 159) | def reset_disk_state_manager():
function get_state_manager (line 168) | def get_state_manager() -> StateManager:
FILE: reflex/istate/manager/disk.py
class QueueItem (line 26) | class QueueItem:
class StateManagerDisk (line 35) | class StateManagerDisk(StateManager):
method __post_init__ (line 69) | def __post_init__(self):
method states_directory (line 76) | def states_directory(self) -> Path:
method _purge_expired_states (line 84) | def _purge_expired_states(self):
method token_path (line 99) | def token_path(self, token: str) -> Path:
method load_state (line 112) | async def load_state(self, token: str) -> BaseState | None:
method populate_substates (line 131) | async def populate_substates(
method get_state (line 157) | async def get_state(
method set_state_for_substate (line 189) | async def set_state_for_substate(self, client_token: str, substate: Ba...
method _process_write_queue_delay (line 211) | async def _process_write_queue_delay(self):
method _process_write_queue (line 235) | async def _process_write_queue(self):
method _flush_write_queue (line 276) | async def _flush_write_queue(self):
method _schedule_process_write_queue (line 296) | async def _schedule_process_write_queue(self):
method set_state (line 308) | async def set_state(
method modify_state (line 335) | async def modify_state(
method close (line 359) | async def close(self):
FILE: reflex/istate/manager/memory.py
class StateManagerMemory (line 15) | class StateManagerMemory(StateManager):
method get_state (line 30) | async def get_state(self, token: str) -> BaseState:
method set_state (line 46) | async def set_state(
method modify_state (line 64) | async def modify_state(
FILE: reflex/istate/manager/redis.py
function _default_lock_expiration (line 35) | def _default_lock_expiration() -> int:
function _default_lock_warning_threshold (line 44) | def _default_lock_warning_threshold() -> int:
function _default_oplock_hold_time_ms (line 53) | def _default_oplock_hold_time_ms() -> int:
class RedisPubSubMessage (line 72) | class RedisPubSubMessage(TypedDict):
class OplockFound (line 81) | class OplockFound(Exception): # noqa: N818
class StateManagerRedis (line 86) | class StateManagerRedis(StateManager):
method __post_init__ (line 172) | def __post_init__(self):
method _get_required_state_classes (line 188) | def _get_required_state_classes(
method _get_populated_states (line 238) | def _get_populated_states(
method get_state (line 266) | async def get_state(
method set_state (line 351) | async def set_state(
method _try_modify_state (line 441) | async def _try_modify_state(
method modify_state (line 529) | async def modify_state(
method _get_state_cached (line 548) | async def _get_state_cached(self, token: str) -> AsyncIterator[BaseSta...
method _notify_next_waiter (line 593) | def _notify_next_waiter(self, key: bytes):
method _create_lease_break_task (line 609) | async def _create_lease_break_task(
method _lock_key (line 725) | def _lock_key(token: str) -> bytes:
method _try_extend_lock (line 738) | async def _try_extend_lock(self, lock_key: bytes) -> bool | None:
method _try_get_lock (line 751) | async def _try_get_lock(self, lock_key: bytes, lock_id: bytes) -> bool...
method _handle_lock_release (line 768) | async def _handle_lock_release(self, message: RedisPubSubMessage) -> N...
method _handle_lock_contention (line 779) | async def _handle_lock_contention(self, message: RedisPubSubMessage) -...
method _subscribe_lock_updates (line 800) | async def _subscribe_lock_updates(self):
method _ensure_lock_task (line 820) | def _ensure_lock_task(self) -> None:
method _ensure_lock_task_subscribed (line 829) | async def _ensure_lock_task_subscribed(self, timeout: float | None = N...
method _enable_keyspace_notifications (line 853) | async def _enable_keyspace_notifications(self):
method _lock_waiter (line 874) | async def _lock_waiter(self, lock_key: bytes) -> AsyncIterator[asyncio...
method _n_lock_waiters (line 903) | def _n_lock_waiters(self, lock_key: bytes) -> int:
method _n_lock_contenders (line 917) | async def _n_lock_contenders(self, lock_key: bytes) -> int:
method _request_lock_release (line 932) | async def _request_lock_release(
method _get_local_lease (line 958) | async def _get_local_lease(
method _wait_lock (line 985) | async def _wait_lock(self, lock_key: bytes, lock_id: bytes) -> None:
method _lock (line 1045) | async def _lock(
method close (line 1090) | async def close(self):
FILE: reflex/istate/proxy.py
class StateProxy (line 34) | class StateProxy(wrapt.ObjectProxy):
method __init__ (line 60) | def __init__(
method _is_mutable (line 93) | def _is_mutable(self) -> bool:
method __aenter__ (line 103) | async def __aenter__(self) -> Self:
method __aexit__ (line 156) | async def __aexit__(self, *exc_info: Any) -> None:
method __enter__ (line 176) | def __enter__(self):
method __exit__ (line 188) | def __exit__(self, *exc_info: Any) -> None:
method __getattr__ (line 195) | def __getattr__(self, name: str) -> Any:
method __setattr__ (line 235) | def __setattr__(self, name: str, value: Any) -> None:
method get_substate (line 262) | def get_substate(self, path: Sequence[str]) -> BaseState:
method get_state (line 282) | async def get_state(self, state_cls: type[T_STATE]) -> T_STATE:
method _as_state_update (line 306) | async def _as_state_update(self, *args, **kwargs) -> StateUpdate:
class ReadOnlyStateProxy (line 324) | class ReadOnlyStateProxy(StateProxy):
method __setattr__ (line 327) | def __setattr__(self, name: str, value: Any) -> None:
method mark_dirty (line 344) | def mark_dirty(self):
class MutableProxy (line 382) | class MutableProxy(wrapt.ObjectProxy):
method __new__ (line 417) | def __new__(cls, wrapped: Any, *args, **kwargs) -> MutableProxy:
method __init__ (line 447) | def __init__(self, wrapped: Any, state: BaseState, field_name: str):
method __repr__ (line 460) | def __repr__(self) -> str:
method _mark_dirty (line 468) | def _mark_dirty(
method _is_called_from_dataclasses_internal (line 495) | def _is_called_from_dataclasses_internal() -> bool:
method _wrap_recursive (line 512) | def _wrap_recursive(self, value: Any) -> Any:
method _wrap_recursive_decorator (line 538) | def _wrap_recursive_decorator(
method __getattr__ (line 556) | def __getattr__(self, __name: str) -> Any:
method __getitem__ (line 602) | def __getitem__(self, key: Any) -> Any:
method __iter__ (line 617) | def __iter__(self) -> Any:
method __delattr__ (line 627) | def __delattr__(self, name: str):
method __delitem__ (line 635) | def __delitem__(self, key: str):
method __setitem__ (line 643) | def __setitem__(self, key: str, value: Any):
method __setattr__ (line 652) | def __setattr__(self, name: str, value: Any):
method __copy__ (line 668) | def __copy__(self) -> Any:
method __deepcopy__ (line 676) | def __deepcopy__(self, memo: dict[int, Any] | None = None) -> Any:
method __reduce_ex__ (line 687) | def __reduce_ex__(self, protocol_version: SupportsIndex):
function _unwrap_for_pickle (line 702) | def _unwrap_for_pickle(obj: T) -> T:
function serialize_mutable_proxy (line 708) | def serialize_mutable_proxy(mp: MutableProxy):
function _json_encoder_default_wrapper (line 726) | def _json_encoder_default_wrapper(self: json.JSONEncoder, o: Any) -> Any:
class ImmutableMutableProxy (line 746) | class ImmutableMutableProxy(MutableProxy):
method _mark_dirty (line 756) | def _mark_dirty(
function is_mutable_type (line 791) | def is_mutable_type(type_: type) -> bool:
FILE: reflex/istate/shared.py
function _log_update_client_errors (line 18) | def _log_update_client_errors(task: asyncio.Task):
function _do_update_other_tokens (line 32) | def _do_update_other_tokens(
function _patch_state (line 74) | async def _patch_state(
class SharedStateBaseInternal (line 113) | class SharedStateBaseInternal(State):
method __getstate__ (line 119) | def __getstate__(self):
method _clean (line 132) | def _clean(self):
method _mark_dirty (line 145) | def _mark_dirty(self):
method _rehydrate (line 160) | def _rehydrate(self):
method _link_to (line 174) | async def _link_to(self, token: str) -> Self:
method _unlink (line 213) | async def _unlink(self):
method _internal_patch_linked_state (line 249) | async def _internal_patch_linked_state(
method _held_locks_linked_states (line 301) | def _held_locks_linked_states(self) -> list["SharedState"]:
method _modify_linked_states (line 317) | async def _modify_linked_states(
class SharedState (line 394) | class SharedState(SharedStateBaseInternal, mixin=True):
method __init_subclass__ (line 402) | def __init_subclass__(cls, **kwargs):
FILE: reflex/istate/storage.py
class ClientStorageBase (line 10) | class ClientStorageBase:
method options (line 13) | def options(self) -> dict[str, Any]:
class Cookie (line 24) | class Cookie(ClientStorageBase, str):
method __new__ (line 34) | def __new__(
class LocalStorage (line 79) | class LocalStorage(ClientStorageBase, str):
method __new__ (line 85) | def __new__(
class SessionStorage (line 115) | class SessionStorage(ClientStorageBase, str):
method __new__ (line 120) | def __new__(
FILE: reflex/istate/wrappers.py
function get_state (line 9) | async def get_state(token: str, state_cls: Any | None = None) -> ReadOnl...
FILE: reflex/middleware/hydrate_middleware.py
class HydrateMiddleware (line 18) | class HydrateMiddleware(Middleware):
method preprocess (line 21) | async def preprocess(
FILE: reflex/middleware/middleware.py
class Middleware (line 15) | class Middleware(ABC):
method preprocess (line 19) | async def preprocess(
method postprocess (line 34) | async def postprocess(
FILE: reflex/model.py
function _safe_db_url_for_logging (line 30) | def _safe_db_url_for_logging(url: str) -> str:
function _print_db_not_available (line 42) | def _print_db_not_available(*args, **kwargs):
class _ClassThatErrorsOnInit (line 50) | class _ClassThatErrorsOnInit:
method __init__ (line 51) | def __init__(self, *args, **kwargs):
function get_engine_args (line 64) | def get_engine_args(url: str | None = None) -> dict[str, Any]:
function get_engine (line 90) | def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine:
function get_async_engine (line 123) | def get_async_engine(url: str | None) -> sqlalchemy.ext.asyncio.AsyncEng...
function sqla_session (line 166) | def sqla_session(url: str | None = None) -> sqlalchemy.orm.Session:
class ModelRegistry (line 177) | class ModelRegistry:
method register (line 186) | def register(cls, model: SQLModelOrSqlAlchemyT) -> SQLModelOrSqlAlchemyT:
method get_models (line 199) | def get_models(cls, include_empty: bool = False) -> set[SQLModelOrSqlA...
method _model_metadata_is_empty (line 215) | def _model_metadata_is_empty(model: SQLModelOrSqlAlchemy) -> bool:
method get_metadata (line 227) | def get_metadata(cls) -> sqlalchemy.MetaData:
function format_revision (line 274) | def format_revision(
function get_db_status (line 308) | def get_db_status() -> dict[str, bool]:
function serialize_sqlmodel (line 331) | def serialize_sqlmodel(m: sqlmodel.SQLModel) -> dict[str, Any]:
class Model (line 353) | class Model(sqlmodel.SQLModel):
method __pydantic_init_subclass__ (line 366) | def __pydantic_init_subclass__(cls):
method create_all (line 386) | def create_all():
method get_db_engine (line 392) | def get_db_engine():
method _alembic_config (line 401) | def _alembic_config():
method _alembic_render_item (line 413) | def _alembic_render_item(
method alembic_init (line 439) | def alembic_init(cls):
method get_migration_history (line 447) | def get_migration_history(cls):
method alembic_autogenerate (line 466) | def alembic_autogenerate(
method _alembic_upgrade (line 542) | def _alembic_upgrade(
method migrate (line 567) | def migrate(cls, autogenerate: bool = False) -> bool | None:
method select (line 601) | def select(cls):
function session (line 611) | def session(url: str | None = None) -> sqlmodel.Session:
function asession (line 622) | def asession(url: str | None = None) -> AsyncSession:
FILE: reflex/page.py
function page (line 18) | def page(
class PageNamespace (line 74) | class PageNamespace:
method __new__ (line 79) | def __new__(
FILE: reflex/plugins/_screenshot.py
function _deep_copy (line 20) | def _deep_copy(state: "BaseState") -> "BaseState":
class ScreenshotPlugin (line 48) | class ScreenshotPlugin(BasePlugin):
method post_compile (line 51) | def post_compile(self, **context: "Unpack[PostCompileContext]") -> None:
method _add_active_connections_endpoint (line 62) | def _add_active_connections_endpoint(app: "App") -> None:
method _add_clone_state_endpoint (line 86) | def _add_clone_state_endpoint(app: "App") -> None:
FILE: reflex/plugins/base.py
class CommonContext (line 13) | class CommonContext(TypedDict):
class AddTaskProtocol (line 20) | class AddTaskProtocol(Protocol):
method __call__ (line 23) | def __call__(
class PreCompileContext (line 39) | class PreCompileContext(CommonContext):
class PostCompileContext (line 47) | class PostCompileContext(CommonContext):
class Plugin (line 53) | class Plugin:
method get_frontend_development_dependencies (line 56) | def get_frontend_development_dependencies(
method get_frontend_dependencies (line 69) | def get_frontend_dependencies(
method get_static_assets (line 82) | def get_static_assets(
method get_stylesheet_paths (line 95) | def get_stylesheet_paths(self, **context: Unpack[CommonContext]) -> Se...
method pre_compile (line 106) | def pre_compile(self, **context: Unpack[PreCompileContext]) -> None:
method post_compile (line 113) | def post_compile(self, **context: Unpack[PostCompileContext]) -> None:
method __repr__ (line 120) | def __repr__(self):
FILE: reflex/plugins/shared_tailwind.py
function remove_version_from_plugin (line 43) | def remove_version_from_plugin(plugin: TailwindPluginConfig) -> Tailwind...
class TailwindConfig (line 65) | class TailwindConfig(TypedDict):
function tailwind_config_js_template (line 82) | def tailwind_config_js_template(
class TailwindPlugin (line 171) | class TailwindPlugin(PluginBase):
method get_frontend_development_dependencies (line 182) | def get_frontend_development_dependencies(self, **context) -> list[str]:
method get_config (line 198) | def get_config(self) -> TailwindConfig:
method get_unversioned_config (line 219) | def get_unversioned_config(self) -> TailwindConfig:
FILE: reflex/plugins/sitemap.py
class SitemapLink (line 27) | class SitemapLink(TypedDict):
class SitemapLinkConfiguration (line 36) | class SitemapLinkConfiguration(TypedDict):
class Constants (line 45) | class Constants(SimpleNamespace):
function configuration_with_loc (line 51) | def configuration_with_loc(
function generate_xml (line 76) | def generate_xml(links: Sequence[SitemapLink]) -> str:
function is_route_dynamic (line 110) | def is_route_dynamic(route: str) -> bool:
function generate_links_for_sitemap (line 122) | def generate_links_for_sitemap(
function sitemap_task (line 182) | def sitemap_task(unevaluated_pages: Sequence["UnevaluatedPage"]) -> tupl...
class SitemapPlugin (line 197) | class SitemapPlugin(PluginBase):
method pre_compile (line 200) | def pre_compile(self, **context):
FILE: reflex/plugins/tailwind_v3.py
class Constants (line 16) | class Constants(SimpleNamespace):
function compile_config (line 42) | def compile_config(config: TailwindConfig):
function compile_root_style (line 57) | def compile_root_style():
function _index_of_element_that_has (line 72) | def _index_of_element_that_has(haystack: list[str], needle: str) -> int ...
function add_tailwind_to_postcss_config (line 79) | def add_tailwind_to_postcss_config(postcss_file_content: str) -> str:
function add_tailwind_to_css_file (line 115) | def add_tailwind_to_css_file(css_file_content: str) -> str:
class TailwindV3Plugin (line 141) | class TailwindV3Plugin(TailwindPlugin):
method get_frontend_development_dependencies (line 144) | def get_frontend_development_dependencies(self, **context) -> list[str]:
method pre_compile (line 158) | def pre_compile(self, **context):
FILE: reflex/plugins/tailwind_v4.py
class Constants (line 16) | class Constants(SimpleNamespace):
function compile_config (line 41) | def compile_config(config: TailwindConfig):
function compile_root_style (line 56) | def compile_root_style():
function _index_of_element_that_has (line 71) | def _index_of_element_that_has(haystack: list[str], needle: str) -> int ...
function add_tailwind_to_postcss_config (line 78) | def add_tailwind_to_postcss_config(postcss_file_content: str) -> str:
function add_tailwind_to_css_file (line 118) | def add_tailwind_to_css_file(css_file_content: str) -> str:
class TailwindV4Plugin (line 144) | class TailwindV4Plugin(TailwindPlugin):
method get_frontend_development_dependencies (line 147) | def get_frontend_development_dependencies(self, **context) -> list[str]:
method pre_compile (line 162) | def pre_compile(self, **context):
FILE: reflex/reflex.py
function set_loglevel (line 24) | def set_loglevel(ctx: click.Context, self: click.Parameter, value: str |...
function cli (line 39) | def cli():
function _init (line 58) | def _init(
function init (line 124) | def init(
function _run (line 133) | def _run(
function run (line 350) | def run(
function compile (line 416) | def compile(dry: bool, rich: bool):
function export (line 487) | def export(
function login (line 534) | def login():
function logout (line 551) | def logout():
function db_cli (line 562) | def db_cli():
function script_cli (line 567) | def script_cli():
function _skip_compile (line 571) | def _skip_compile():
function db_init (line 577) | def db_init():
function migrate (line 607) | def migrate():
function status (line 620) | def status():
function makemigrations (line 657) | def makemigrations(message: str | None):
function deploy (line 751) | def deploy(
function rename (line 836) | def rename(new_name: str):
function _convert_reflex_loglevel_to_reflex_cli_loglevel (line 845) | def _convert_reflex_loglevel_to_reflex_cli_loglevel(
FILE: reflex/route.py
function verify_route_validity (line 12) | def verify_route_validity(route: str) -> None:
function get_route_args (line 57) | def get_route_args(route: str) -> dict[str, str]:
function replace_brackets_with_keywords (line 99) | def replace_brackets_with_keywords(input_string: str) -> str:
function route_specificity (line 135) | def route_specificity(keyworded_route: str) -> tuple[int, int, int]:
function get_route_regex (line 154) | def get_route_regex(keyworded_route: str) -> re.Pattern:
function get_router (line 184) | def get_router(routes: list[str]) -> Callable[[str], str | None]:
FILE: reflex/state.py
function _no_chain_background_task (line 106) | def _no_chain_background_task(state: BaseState, name: str, fn: Callable)...
function _substate_key (line 143) | def _substate_key(
function _split_substate_key (line 165) | def _split_substate_key(substate_key: str) -> tuple[str, str]:
class EventHandlerSetVar (line 179) | class EventHandlerSetVar(EventHandler):
method __init__ (line 184) | def __init__(self, state_cls: type[BaseState]):
method __hash__ (line 196) | def __hash__(self):
method setvar (line 209) | def setvar(self, var_name: str, value: Any):
method __call__ (line 220) | def __call__(self, *args: Any) -> EventSpec:
function get_var_for_field (line 267) | def get_var_for_field(cls: type[BaseState], name: str, f: Field) -> Var:
function _resolve_delta (line 289) | async def _resolve_delta(delta: Delta) -> Delta:
function _override_base_method (line 315) | def _override_base_method(fn: Callable[PARAMS, RETURN]) -> Callable[PARA...
class BaseState (line 355) | class BaseState(EvenMoreBasicBaseState):
method __init__ (line 427) | def __init__(
method __repr__ (line 472) | def __repr__(self) -> str:
method _get_computed_vars (line 481) | def _get_computed_vars(cls) -> list[tuple[str, ComputedVar]]:
method _validate_module_name (line 495) | def _validate_module_name(cls) -> None:
method __init_subclass__ (line 511) | def __init_subclass__(cls, mixin: bool = False, **kwargs):
method _add_event_handler (line 654) | def _add_event_handler(
method _copy_fn (line 670) | def _copy_fn(fn: Callable) -> Callable:
method _item_is_event_handler (line 695) | def _item_is_event_handler(name: str, value: Any) -> bool:
method _evaluate (line 713) | def _evaluate(cls, f: Callable[[Self], Any], of_type: type | None = No...
method _mixins (line 766) | def _mixins(cls) -> tuple[type[BaseState], ...]:
method _handle_local_def (line 783) | def _handle_local_def(cls):
method _get_type_hints (line 799) | def _get_type_hints(cls) -> dict[str, Any]:
method _init_var_dependency_dicts (line 817) | def _init_var_dependency_dicts(cls):
method _check_overridden_methods (line 872) | def _check_overridden_methods(cls):
method _check_overridden_basevars (line 895) | def _check_overridden_basevars(cls):
method _check_overridden_computed_vars (line 908) | def _check_overridden_computed_vars(cls) -> None:
method get_skip_vars (line 923) | def get_skip_vars(cls) -> set[str]:
method get_parent_state (line 943) | def get_parent_state(cls) -> type[BaseState] | None:
method get_root_state (line 971) | def get_root_state(cls) -> type[BaseState]:
method get_substates (line 981) | def get_substates(cls) -> set[type[BaseState]]:
method get_name (line 991) | def get_name(cls) -> str:
method get_full_name (line 1002) | def get_full_name(cls) -> str:
method get_class_substate (line 1016) | def get_class_substate(cls, path: Sequence[str] | str) -> type[BaseSta...
method get_class_var (line 1044) | def get_class_var(cls, path: Sequence[str]) -> Any:
method is_user_defined (line 1064) | def is_user_defined(cls) -> bool:
method _init_var (line 1076) | def _init_var(cls, name: str, prop: Var):
method add_var (line 1103) | def add_var(cls, name: str, type_: Any, default_value: Any = None):
method _set_var (line 1148) | def _set_var(cls, name: str, prop: Var):
method _create_event_handler (line 1158) | def _create_event_handler(
method _create_setvar (line 1178) | def _create_setvar(cls):
method _create_setter (line 1183) | def _create_setter(cls, name: str, prop: Var):
method _set_default_value (line 1222) | def _set_default_value(cls, name: str, prop: Var):
method _get_var_default (line 1237) | def _get_var_default(cls, name: str, annotation_value: Any) -> Any:
method _get_base_functions (line 1258) | def _get_base_functions() -> dict[str, FunctionType]:
method _update_substate_inherited_vars (line 1271) | def _update_substate_inherited_vars(cls, vars_to_add: dict[str, Var]):
method setup_dynamic_args (line 1292) | def setup_dynamic_args(cls, args: dict[str, str]):
method _check_overwritten_dynamic_args (line 1341) | def _check_overwritten_dynamic_args(cls, args: list[str]):
method _get_attribute (line 1360) | def _get_attribute(self, name: str) -> Any:
method __setattr__ (line 1421) | def __setattr__(self, name: str, value: Any):
method reset (line 1490) | def reset(self):
method _is_client_storage (line 1514) | def _is_client_storage(cls, prop_name_or_field: str | Field) -> bool:
method _reset_client_storage (line 1535) | def _reset_client_storage(self):
method get_substate (line 1549) | def get_substate(self, path: Sequence[str]) -> BaseState:
method _get_potentially_dirty_states (line 1573) | def _get_potentially_dirty_states(cls) -> set[type[BaseState]]:
method _get_root_state (line 1587) | def _get_root_state(self) -> BaseState:
method _get_state_from_redis (line 1598) | async def _get_state_from_redis(self, state_cls: type[T_STATE]) -> T_S...
method _get_state_from_cache (line 1633) | def _get_state_from_cache(self, state_cls: type[T_STATE]) -> T_STATE:
method get_state (line 1654) | async def get_state(self, state_cls: type[T_STATE]) -> T_STATE:
method get_var_value (line 1674) | async def get_var_value(self, var: Var[VAR_TYPE]) -> VAR_TYPE:
method _get_event_handler (line 1713) | def _get_event_handler(self, event: Event | str) -> tuple[BaseState, E...
method _process (line 1738) | async def _process(self, event: Event) -> AsyncIterator[StateUpdate]:
method _check_valid (line 1762) | def _check_valid(self, handler: EventHandler, events: Any) -> Any:
method _as_state_update (line 1805) | async def _as_state_update(
method _process_event (line 1865) | async def _process_event(
method _mark_dirty_computed_vars (line 2003) | def _mark_dirty_computed_vars(self) -> None:
method _expired_computed_vars (line 2030) | def _expired_computed_vars(self) -> set[str]:
method _dirty_computed_vars (line 2042) | def _dirty_computed_vars(
method get_delta (line 2061) | def get_delta(self) -> Delta:
method _get_resolved_delta (line 2097) | async def _get_resolved_delta(self) -> Delta:
method _mark_dirty (line 2105) | def _mark_dirty(self):
method _update_was_touched (line 2119) | def _update_was_touched(self):
method _get_was_touched (line 2130) | def _get_was_touched(self) -> bool:
method _clean (line 2144) | def _clean(self):
method get_value (line 2159) | def get_value(self, key: str) -> Any:
method dict (line 2192) | def dict(
method __aenter__ (line 2245) | async def __aenter__(self) -> Self:
method __aexit__ (line 2255) | async def __aexit__(self, *exc_info: Any) -> None:
method __getstate__ (line 2265) | def __getstate__(self):
method __setstate__ (line 2291) | def __setstate__(self, state: dict[str, Any]):
method _check_state_size (line 2304) | def _check_state_size(
method _to_schema (line 2334) | def _to_schema(cls) -> str:
method _serialize (line 2357) | def _serialize(self) -> bytes:
method _deserialize (line 2409) | def _deserialize(
function _serialize_type (line 2439) | def _serialize_type(type_: Any) -> str:
function is_serializable (line 2453) | def is_serializable(value: Any) -> bool:
class State (line 2471) | class State(BaseState):
method _get_state_from_redis (line 2480) | async def _get_state_from_redis(self, state_cls: type[T_STATE]) -> T_S...
method set_is_hydrated (line 2509) | def set_is_hydrated(self, value: bool) -> None:
function dynamic (line 2521) | def dynamic(func: Callable[[T], Component]):
class FrontendEventExceptionState (line 2564) | class FrontendEventExceptionState(State):
method handle_frontend_exception (line 2585) | def handle_frontend_exception(
class UpdateVarsInternalState (line 2617) | class UpdateVarsInternalState(State):
method update_vars_internal (line 2620) | async def update_vars_internal(self, vars: dict[str, Any]) -> None:
class OnLoadInternalState (line 2641) | class OnLoadInternalState(State):
method on_load_internal (line 2650) | def on_load_internal(self) -> list[Event | EventSpec | event.EventCall...
class ComponentState (line 2685) | class ComponentState(State, mixin=True):
method __init__ (line 2727) | def __init__(self, *args, **kwargs):
method __init_subclass__ (line 2745) | def __init_subclass__(cls, mixin: bool = True, **kwargs):
method get_component (line 2755) | def get_component(cls, *children, **props) -> Component:
method create (line 2769) | def create(cls, *children, **props) -> Component:
class StateUpdate (line 2800) | class StateUpdate:
method json (line 2812) | def json(self) -> str:
function code_uses_state_contexts (line 2821) | def code_uses_state_contexts(javascript_code: str) -> bool:
function reload_state_module (line 2833) | def reload_state_module(
FILE: reflex/style.py
function _color_mode_var (line 32) | def _color_mode_var(_js_expr: str, _var_type: type = str) -> Var:
function set_color_mode (line 52) | def set_color_mode(
function media_query (line 97) | def media_query(breakpoint_expr: str):
function convert_item (line 109) | def convert_item(
function convert_list (line 141) | def convert_list(
function convert (line 165) | def convert(
function format_style_key (line 225) | def format_style_key(key: str) -> tuple[str, ...]:
class Style (line 244) | class Style(dict[str, Any]):
method __init__ (line 247) | def __init__(self, style_dict: dict[str, Any] | None = None, **kwargs):
method update (line 264) | def update(self, style_dict: dict | None, **kwargs):
method __setitem__ (line 284) | def __setitem__(self, key: str, value: Any):
method __or__ (line 300) | def __or__(self, other: Style | dict) -> Style:
function _format_emotion_style_pseudo_selector (line 321) | def _format_emotion_style_pseudo_selector(key: str) -> str:
function format_as_emotion (line 342) | def format_as_emotion(style_dict: dict[str, Any]) -> Style | None:
function convert_dict_to_style_and_format_emotion (line 390) | def convert_dict_to_style_and_format_emotion(
FILE: reflex/testing.py
class chdir (line 80) | class chdir(contextlib.AbstractContextManager): # noqa: N801
method __init__ (line 83) | def __init__(self, path: str | Path):
method __enter__ (line 92) | def __enter__(self):
method __exit__ (line 97) | def __exit__(self, *excinfo):
class AppHarness (line 107) | class AppHarness:
method create (line 128) | def create(
method get_state_name (line 176) | def get_state_name(self, state_cls_name: str) -> str:
method get_full_state_name (line 189) | def get_full_state_name(self, path: list[str]) -> str:
method _get_globals_from_signature (line 203) | def _get_globals_from_signature(self, func: Any) -> dict[str, Any]:
method _get_source_from_app_source (line 225) | def _get_source_from_app_source(self, app_source: Any) -> str:
method _initialize_app (line 242) | def _initialize_app(self):
method _reload_state_module (line 298) | def _reload_state_module(self):
method _get_backend_shutdown_handler (line 302) | def _get_backend_shutdown_handler(self):
method _start_backend (line 336) | def _start_backend(self, port: int = 0):
method _reset_backend_state_manager (line 356) | async def _reset_backend_state_manager(self):
method _start_frontend (line 397) | def _start_frontend(self):
method _wait_frontend (line 422) | def _wait_frontend(self):
method start (line 457) | def start(self) -> Self:
method get_app_global_source (line 470) | def get_app_global_source(key: str, value: Any):
method __enter__ (line 486) | def __enter__(self) -> Self:
method stop (line 494) | def stop(self) -> None:
method __exit__ (line 533) | def __exit__(self, *excinfo) -> None:
method _poll_for (line 542) | def _poll_for(
method _poll_for_async (line 572) | async def _poll_for_async(
method _poll_for_servers (line 600) | def _poll_for_servers(self, timeout: TimeoutType = None) -> socket.soc...
method frontend (line 633) | def frontend(
method get_state (line 715) | async def get_state(self, token: str) -> BaseState:
method set_state (line 745) | async def set_state(self, token: str, **kwargs) -> None:
method modify_state (line 773) | async def modify_state(self, token: str) -> AsyncIterator[BaseState]:
method token_manager (line 807) | def token_manager(self) -> TokenManager:
method poll_for_content (line 820) | def poll_for_content(
method poll_for_value (line 847) | def poll_for_value(
method poll_for_clients (line 877) | def poll_for_clients(self, timeout: TimeoutType = None) -> dict[str, B...
method poll_for_or_raise_timeout (line 907) | def poll_for_or_raise_timeout(
method expect (line 939) | def expect(
class SimpleHTTPRequestHandlerCustomErrors (line 958) | class SimpleHTTPRequestHandlerCustomErrors(SimpleHTTPRequestHandler):
method __init__ (line 961) | def __init__(self, *args, error_page_map: dict[int, Path], **kwargs):
method send_error (line 972) | def send_error(
class Subdir404TCPServer (line 998) | class Subdir404TCPServer(socketserver.TCPServer):
method __init__ (line 1001) | def __init__(
method finish_request (line 1020) | def finish_request(self, request: socket.socket, client_address: tuple...
class AppHarnessProd (line 1036) | class AppHarnessProd(AppHarness):
method _run_frontend (line 1047) | def _run_frontend(self):
method _start_frontend (line 1067) | def _start_frontend(self):
method _wait_frontend (line 1097) | def _wait_frontend(self):
method _start_backend (line 1103) | def _start_backend(self):
method _poll_for_servers (line 1124) | def _poll_for_servers(self, timeout: TimeoutType = None) -> socket.soc...
method stop (line 1130) | def stop(self):
FILE: reflex/utils/build.py
function set_env_json (line 17) | def set_env_json():
function _zip (line 29) | def _zip(
function zip_app (line 120) | def zip_app(
function _duplicate_index_html_to_parent_directory (line 167) | def _duplicate_index_html_to_parent_directory(directory: Path):
function build (line 190) | def build():
function setup_frontend (line 255) | def setup_frontend(
function setup_frontend_prod (line 270) | def setup_frontend_prod(
function _looks_like_venv_directory (line 282) | def _looks_like_venv_directory(directory_to_check: str | Path) -> bool:
FILE: reflex/utils/codespaces.py
function redirect_script (line 19) | def redirect_script() -> str:
function codespaces_port_forwarding_domain (line 78) | def codespaces_port_forwarding_domain() -> str | None:
function is_running_in_codespaces (line 87) | def is_running_in_codespaces() -> bool:
function codespaces_auto_redirect (line 96) | def codespaces_auto_redirect() -> list[Component]:
function auth_codespace (line 107) | def auth_codespace(_request: Request) -> HTMLResponse:
FILE: reflex/utils/compat.py
function windows_hot_reload_lifespan_hack (line 12) | async def windows_hot_reload_lifespan_hack():
function annotations_from_namespace (line 36) | def annotations_from_namespace(namespace: Mapping[str, Any]) -> dict[str...
class ModelMetaclassLazyAnnotations (line 60) | class ModelMetaclassLazyAnnotations(ModelMetaclass):
method __new__ (line 63) | def __new__(mcs, name: str, bases: tuple, namespace: dict, **kwargs):
function sqlmodel_field_has_primary_key (line 82) | def sqlmodel_field_has_primary_key(field_info: "FieldInfo") -> bool:
FILE: reflex/utils/console.py
function set_log_level (line 55) | def set_log_level(log_level: LogLevel | None):
function is_debug (line 76) | def is_debug() -> bool:
function print (line 85) | def print(msg: str, *, dedupe: bool = False, **kwargs):
function _print_stderr (line 100) | def _print_stderr(msg: str, *, dedupe: bool = False, **kwargs):
function log_file_console (line 116) | def log_file_console():
function should_use_log_file_console (line 138) | def should_use_log_file_console() -> bool:
function print_to_log_file (line 149) | def print_to_log_file(msg: str, *, dedupe: bool = False, **kwargs):
function debug (line 160) | def debug(msg: str, *, dedupe: bool = False, **kwargs):
function info (line 182) | def info(msg: str, *, dedupe: bool = False, **kwargs):
function success (line 200) | def success(msg: str, *, dedupe: bool = False, **kwargs):
function log (line 218) | def log(msg: str, *, dedupe: bool = False, **kwargs):
function rule (line 236) | def rule(title: str, **kwargs):
function warn (line 246) | def warn(msg: str, *, dedupe: bool = False, **kwargs):
function _exclude_paths_from_frame_info (line 265) | def _exclude_paths_from_frame_info() -> list[Path]:
function _get_first_non_framework_frame (line 293) | def _get_first_non_framework_frame() -> FrameType | None:
function deprecate (line 304) | def deprecate(
function error (line 348) | def error(msg: str, *, dedupe: bool = False, **kwargs):
function ask (line 366) | def ask(
function progress (line 389) | def progress():
function status (line 402) | def status(*args, **kwargs):
function timing (line 416) | def timing(msg: str):
class PoorProgress (line 432) | class PoorProgress:
method __init__ (line 435) | def __init__(self):
method add_task (line 442) | def add_task(self, task: str, total: int):
method advance (line 457) | def advance(self, task: TaskID, advance: int = 1):
method start (line 469) | def start(self):
method stop (line 472) | def stop(self):
FILE: reflex/utils/decorator.py
function once (line 11) | def once(f: Callable[[], T]) -> Callable[[], T]:
function once_unless_none (line 32) | def once_unless_none(f: Callable[[], T | None]) -> Callable[[], T | None]:
function debug (line 55) | def debug(f: Callable[P, T]) -> Callable[P, T]:
function _write_cached_procedure_file (line 76) | def _write_cached_procedure_file(payload: str, cache_file: Path, value: ...
function _read_cached_procedure_file (line 83) | def _read_cached_procedure_file(cache_file: Path) -> tuple[str | None, o...
function cached_procedure (line 97) | def cached_procedure(
function cache_result_in_disk (line 135) | def cache_result_in_disk(
FILE: reflex/utils/exceptions.py
class ReflexError (line 11) | class ReflexError(Exception):
class ConfigError (line 15) | class ConfigError(ReflexError):
class InvalidStateManagerModeError (line 19) | class InvalidStateManagerModeError(ReflexError, ValueError):
class ReflexRuntimeError (line 23) | class ReflexRuntimeError(ReflexError, RuntimeError):
class UploadTypeError (line 27) | class UploadTypeError(ReflexError, TypeError):
class EnvVarValueError (line 31) | class EnvVarValueError(ReflexError, ValueError):
class ComponentTypeError (line 35) | class ComponentTypeError(ReflexError, TypeError):
class ChildrenTypeError (line 39) | class ChildrenTypeError(ComponentTypeError):
method __init__ (line 42) | def __init__(self, component: str, child: Any):
class EventHandlerTypeError (line 55) | class EventHandlerTypeError(ReflexError, TypeError):
class EventHandlerValueError (line 59) | class EventHandlerValueError(ReflexError, ValueError):
class StateValueError (line 63) | class StateValueError(ReflexError, ValueError):
class VarNameError (line 67) | class VarNameError(ReflexError, NameError):
class VarTypeError (line 71) | class VarTypeError(ReflexError, TypeError):
class VarValueError (line 75) | class VarValueError(ReflexError, ValueError):
class VarAttributeError (line 79) | class VarAttributeError(ReflexError, AttributeError):
class UntypedVarError (line 83) | class UntypedVarError(ReflexError, TypeError):
method __init__ (line 86) | def __init__(self, var: Var, action: str, doc_link: str = ""):
class UntypedComputedVarError (line 112) | class UntypedComputedVarError(ReflexError, TypeError):
method __init__ (line 115) | def __init__(self, var_name: str):
class ComputedVarSignatureError (line 124) | class ComputedVarSignatureError(ReflexError, TypeError):
method __init__ (line 127) | def __init__(self, var_name: str, signature: str):
class MissingAnnotationError (line 137) | class MissingAnnotationError(ReflexError, TypeError):
method __init__ (line 140) | def __init__(self, var_name: str):
class UploadValueError (line 149) | class UploadValueError(ReflexError, ValueError):
class PageValueError (line 153) | class PageValueError(ReflexError, ValueError):
class RouteValueError (line 157) | class RouteValueError(ReflexError, ValueError):
class VarOperationTypeError (line 161) | class VarOperationTypeError(ReflexError, TypeError):
class VarDependencyError (line 165) | class VarDependencyError(ReflexError, ValueError):
class InvalidStylePropError (line 169) | class InvalidStylePropError(ReflexError, TypeError):
class ImmutableStateError (line 173) | class ImmutableStateError(ReflexError):
class LockExpiredError (line 177) | class LockExpiredError(ReflexError):
class MatchTypeError (line 181) | class MatchTypeError(ReflexError, TypeError):
class EventHandlerArgTypeMismatchError (line 185) | class EventHandlerArgTypeMismatchError(ReflexError, TypeError):
class EventFnArgMismatchError (line 189) | class EventFnArgMismatchError(ReflexError, TypeError):
class DynamicRouteArgShadowsStateVarError (line 193) | class DynamicRouteArgShadowsStateVarError(ReflexError, NameError):
class ComputedVarShadowsStateVarError (line 197) | class ComputedVarShadowsStateVarError(ReflexError, NameError):
class ComputedVarShadowsBaseVarsError (line 201) | class ComputedVarShadowsBaseVarsError(ReflexError, NameError):
class EventHandlerShadowsBuiltInStateMethodError (line 205) | class EventHandlerShadowsBuiltInStateMethodError(ReflexError, NameError):
class GeneratedCodeHasNoFunctionDefsError (line 209) | class GeneratedCodeHasNoFunctionDefsError(ReflexError):
class PrimitiveUnserializableToJSONError (line 213) | class PrimitiveUnserializableToJSONError(ReflexError, ValueError):
class InvalidLifespanTaskTypeError (line 217) | class InvalidLifespanTaskTypeError(ReflexError, TypeError):
class DynamicComponentMissingLibraryError (line 221) | class DynamicComponentMissingLibraryError(ReflexError, ValueError):
class SetUndefinedStateVarError (line 225) | class SetUndefinedStateVarError(ReflexError, AttributeError):
class StateSchemaMismatchError (line 229) | class StateSchemaMismatchError(ReflexError, TypeError):
class EnvironmentVarValueError (line 233) | class EnvironmentVarValueError(ReflexError, ValueError):
class DynamicComponentInvalidSignatureError (line 237) | class DynamicComponentInvalidSignatureError(ReflexError, TypeError):
class InvalidPropValueError (line 241) | class InvalidPropValueError(ReflexError):
class StateTooLargeError (line 245) | class StateTooLargeError(ReflexError):
class StateSerializationError (line 249) | class StateSerializationError(ReflexError):
class StateMismatchError (line 253) | class StateMismatchError(ReflexError, ValueError):
class SystemPackageMissingError (line 257) | class SystemPackageMissingError(ReflexError):
method __init__ (line 260) | def __init__(self, package: str):
class EventDeserializationError (line 277) | class EventDeserializationError(ReflexError, ValueError):
class InvalidLockWarningThresholdError (line 281) | class InvalidLockWarningThresholdError(ReflexError):
class UnretrievableVarValueError (line 285) | class UnretrievableVarValueError(ReflexError):
FILE: reflex/utils/exec.py
function get_package_json_and_hash (line 31) | def get_package_json_and_hash(package_json_path: Path) -> tuple[PackageJ...
class PackageJson (line 49) | class PackageJson(TypedDict):
class Change (line 56) | class Change(NamedTuple):
function format_change (line 63) | def format_change(name: str, change: Change) -> str:
function get_different_packages (line 85) | def get_different_packages(
function kill (line 129) | def kill(proc_pid: int):
function notify_frontend (line 148) | def notify_frontend(url: str, backend_present: bool):
function notify_backend (line 160) | def notify_backend():
function run_process_and_launch_url (line 170) | def run_process_and_launch_url(
function run_frontend (line 236) | def run_frontend(root: Path, port: str, backend_present: bool = True):
function notify_app_running (line 262) | def notify_app_running():
function run_frontend_prod (line 267) | def run_frontend_prod(root: Path, port: str, backend_present: bool = True):
function _warn_user_about_uvicorn (line 290) | def _warn_user_about_uvicorn():
function should_use_granian (line 296) | def should_use_granian():
function get_app_module (line 313) | def get_app_module():
function get_app_instance (line 322) | def get_app_instance():
function get_app_file (line 331) | def get_app_file() -> Path:
function get_app_instance_from_file (line 352) | def get_app_instance_from_file() -> str:
function run_backend (line 361) | def run_backend(
function _has_child_file (line 393) | def _has_child_file(directory: Path, file_name: str) -> bool:
function get_reload_paths (line 406) | def get_reload_paths() -> Sequence[Path]:
function run_uvicorn_backend (line 483) | def run_uvicorn_backend(host: str, port: int, loglevel: LogLevel):
function run_granian_backend (line 524) | def run_granian_backend(host: str, port: int, loglevel: LogLevel):
function run_backend_prod (line 565) | def run_backend_prod(
function _get_backend_workers (line 592) | def _get_backend_workers():
function run_uvicorn_backend_prod (line 598) | def run_uvicorn_backend_prod(host: str, port: int, loglevel: LogLevel):
function run_granian_backend_prod (line 657) | def run_granian_backend_prod(host: str, port: int, loglevel: LogLevel):
function output_system_info (line 696) | def output_system_info():
function is_testing_env (line 744) | def is_testing_env() -> bool:
function is_in_app_harness (line 753) | def is_in_app_harness() -> bool:
function is_prod_mode (line 762) | def is_prod_mode() -> bool:
function should_prerender_routes (line 772) | def should_prerender_routes() -> bool:
function get_compile_context (line 783) | def get_compile_context() -> constants.CompileContext:
FILE: reflex/utils/export.py
function export (line 11) | def export(
FILE: reflex/utils/format.py
function length_of_largest_common_substring (line 30) | def length_of_largest_common_substring(str1: str, str2: str) -> int:
function get_close_char (line 60) | def get_close_char(open: str, close: str | None = None) -> str:
function is_wrapped (line 81) | def is_wrapped(text: str, open: str, close: str | None = None) -> bool:
function wrap (line 111) | def wrap(
function indent (line 140) | def indent(text: str, indent_level: int = 2) -> str:
function to_snake_case (line 156) | def to_snake_case(text: str) -> str:
function to_camel_case (line 172) | def to_camel_case(text: str, treat_hyphens_as_underscores: bool = True) ...
function to_title_case (line 194) | def to_title_case(text: str, sep: str = "") -> str:
function to_kebab_case (line 207) | def to_kebab_case(text: str) -> str:
function make_default_page_title (line 222) | def make_default_page_title(app_name: str, route: str) -> str:
function _escape_js_string (line 244) | def _escape_js_string(string: str) -> str:
function _wrap_js_string (line 276) | def _wrap_js_string(string: str) -> str:
function format_string (line 289) | def format_string(string: str) -> str:
function format_var (line 301) | def format_var(var: Var) -> str:
function format_route (line 313) | def format_route(route: str) -> str:
function format_match (line 331) | def format_match(
function format_prop (line 364) | def format_prop(
function format_props (line 420) | def format_props(*single_props, **key_value_props) -> list[str]:
function get_event_handler_parts (line 442) | def get_event_handler_parts(handler: EventHandler) -> tuple[str, str]:
function format_event_handler (line 472) | def format_event_handler(handler: EventHandler) -> str:
function format_event (line 487) | def format_event(event_spec: EventSpec) -> str:
function format_queue_events (line 524) | def format_queue_events(
function format_query_params (line 594) | def format_query_params(router_data: dict[str, Any]) -> dict[str, str]:
function format_state_name (line 607) | def format_state_name(state_name: str) -> str:
function format_ref (line 622) | def format_ref(ref: str) -> str:
function format_library_name (line 636) | def format_library_name(library_fullname: str | dict[str, Any]) -> str:
function json_dumps (line 671) | def json_dumps(obj: Any, **kwargs) -> str:
function collect_form_dict_names (line 689) | def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]:
function format_array_ref (line 711) | def format_array_ref(refs: str, idx: Var | None) -> str:
function format_data_editor_column (line 727) | def format_data_editor_column(col: str | dict):
function format_data_editor_cell (line 760) | def format_data_editor_cell(cell: Any):
FILE: reflex/utils/frontend_skeleton.py
function initialize_gitignore (line 17) | def initialize_gitignore(
function initialize_requirements_txt (line 44) | def initialize_requirements_txt() -> bool:
function initialize_web_directory (line 94) | def initialize_web_directory():
function update_react_router_config (line 127) | def update_react_router_config(prerender_routes: bool = False):
function _update_react_router_config (line 150) | def _update_react_router_config(config: Config, prerender_routes: bool =...
function _compile_package_json (line 170) | def _compile_package_json():
function initialize_package_json (line 186) | def initialize_package_json():
function _compile_vite_config (line 192) | def _compile_vite_config(config: Config):
function initialize_vite_config (line 207) | def initialize_vite_config():
function initialize_bun_config (line 213) | def initialize_bun_config():
function initialize_npmrc (line 227) | def initialize_npmrc():
function init_reflex_json (line 241) | def init_reflex_json(project_hash: int | None):
FILE: reflex/utils/imports.py
function merge_parsed_imports (line 10) | def merge_parsed_imports(
function merge_imports (line 28) | def merge_imports(
function parse_imports (line 62) | def parse_imports(
function collapse_imports (line 83) | def collapse_imports(
class ImportVar (line 107) | class ImportVar:
method name (line 129) | def name(self) -> str:
FILE: reflex/utils/js_runtimes.py
function check_node_version (line 20) | def check_node_version() -> bool:
function _get_version_of_executable (line 32) | def _get_version_of_executable(
function get_node_version (line 64) | def get_node_version() -> version.Version | None:
function get_bun_version (line 73) | def get_bun_version(bun_path: Path | None = None) -> version.Version | N...
function npm_escape_hatch (line 85) | def npm_escape_hatch() -> bool:
function prefer_npm_over_bun (line 94) | def prefer_npm_over_bun() -> bool:
function get_nodejs_compatible_package_managers (line 105) | def get_nodejs_compatible_package_managers(
function is_outdated_nodejs_installed (line 141) | def is_outdated_nodejs_installed():
function get_js_package_executor (line 158) | def get_js_package_executor(raise_on_none: bool = False) -> Sequence[Seq...
function download_and_run (line 195) | def download_and_run(url: str, *args, show_status: bool = False, **env):
function install_bun (line 233) | def install_bun():
function validate_bun (line 295) | def validate_bun(bun_path: Path | None = None):
function validate_frontend_dependencies (line 325) | def validate_frontend_dependencies(init: bool = True):
function remove_existing_bun_installation (line 349) | def remove_existing_bun_installation():
function install_frontend_packages (line 360) | def install_frontend_packages(packages: set[str], config: Config):
FILE: reflex/utils/lazy_loader.py
function attach (line 26) | def attach(
FILE: reflex/utils/misc.py
function get_module_path (line 13) | def get_module_path(module_name: str) -> Path | None:
function run_in_thread (line 52) | async def run_in_thread(func: Callable) -> Any:
function with_cwd_in_syspath (line 77) | def with_cwd_in_syspath():
function preload_color_theme (line 96) | def preload_color_theme():
FILE: reflex/utils/monitoring.py
function is_pyleak_enabled (line 27) | def is_pyleak_enabled() -> bool:
function monitor_sync (line 40) | def monitor_sync():
function monitor_async (line 75) | async def monitor_async():
function monitor_loopblocks (line 120) | def monitor_loopblocks(
function monitor_loopblocks (line 126) | def monitor_loopblocks(
function monitor_loopblocks (line 132) | def monitor_loopblocks(
function monitor_loopblocks (line 137) | def monitor_loopblocks(func: Callable) -> Callable:
FILE: reflex/utils/net.py
function _httpx_verify_kwarg (line 14) | def _httpx_verify_kwarg() -> bool:
function _wrap_https_func (line 29) | def _wrap_https_func(
function _wrap_https_lazy_func (line 67) | def _wrap_https_lazy_func(
function _is_ipv4_supported (line 91) | def _is_ipv4_supported() -> bool:
function _is_ipv6_supported (line 107) | def _is_ipv6_supported() -> bool:
function _should_use_ipv6 (line 123) | def _should_use_ipv6() -> bool:
function _httpx_local_address_kwarg (line 132) | def _httpx_local_address_kwarg() -> str:
function _httpx_client (line 146) | def _httpx_client():
FILE: reflex/utils/path_ops.py
function chmod_rm (line 19) | def chmod_rm(path: Path):
function rm (line 32) | def rm(path: str | Path):
function copy_tree (line 46) | def copy_tree(
function cp (line 71) | def cp(
function mv (line 100) | def mv(src: str | Path, dest: str | Path, overwrite: bool = True) -> bool:
function mkdir (line 121) | def mkdir(path: str | Path):
function ls (line 130) | def ls(path: str | Path) -> list[Path]:
function ln (line 142) | def ln(src: str | Path, dest: str | Path, overwrite: bool = False) -> bool:
function which (line 166) | def which(program: str | Path) -> Path | None:
function use_system_bun (line 179) | def use_system_bun() -> bool:
function get_node_bin_path (line 188) | def get_node_bin_path() -> Path | None:
function get_node_path (line 197) | def get_node_path() -> Path | None:
function get_npm_path (line 206) | def get_npm_path() -> Path | None:
function get_bun_path (line 215) | def get_bun_path() -> Path | None:
function update_json_file (line 227) | def update_json_file(file_path: str | Path, update_dict: dict[str, int |...
function find_replace (line 259) | def find_replace(directory: str | Path, find: str, replace: str):
function samefile (line 276) | def samefile(file1: Path, file2: Path) -> bool:
function update_directory_tree (line 292) | def update_directory_tree(src: Path, dest: Path):
FILE: reflex/utils/prerequisites.py
class AppInfo (line 36) | class AppInfo(NamedTuple):
function get_web_dir (line 43) | def get_web_dir() -> Path:
function get_states_dir (line 54) | def get_states_dir() -> Path:
function get_backend_dir (line 65) | def get_backend_dir() -> Path:
function check_latest_package_version (line 74) | def check_latest_package_version(package_name: str):
function get_or_set_last_reflex_version_check_datetime (line 102) | def get_or_set_last_reflex_version_check_datetime():
function set_last_reflex_run_time (line 122) | def set_last_reflex_run_time():
function windows_check_onedrive_in_path (line 131) | def windows_check_onedrive_in_path() -> bool:
function _check_app_name (line 140) | def _check_app_name(config: Config):
function get_app (line 171) | def get_app(reload: bool = False) -> ModuleType:
function get_and_validate_app (line 217) | def get_and_validate_app(
function get_compiled_app (line 246) | def get_compiled_app(
function _can_colorize (line 272) | def _can_colorize() -> bool:
function compile_or_validate_app (line 332) | def compile_or_validate_app(
function get_redis (line 368) | def get_redis() -> Redis | None:
function get_redis_sync (line 388) | def get_redis_sync() -> RedisSync | None:
function parse_redis_url (line 408) | def parse_redis_url() -> str | None:
function get_redis_status (line 426) | async def get_redis_status() -> dict[str, bool | None]:
function validate_app_name (line 453) | def validate_app_name(app_name: str | None = None) -> str:
function get_project_hash (line 485) | def get_project_hash(raise_on_fail: bool = False) -> int | None:
function check_running_mode (line 501) | def check_running_mode(frontend: bool, backend: bool) -> tuple[bool, bool]:
function assert_in_reflex_dir (line 516) | def assert_in_reflex_dir():
function needs_reinit (line 529) | def needs_reinit() -> bool:
function _is_app_compiled_with_same_reflex_version (line 559) | def _is_app_compiled_with_same_reflex_version() -> bool:
function ensure_reflex_installation_id (line 567) | def ensure_reflex_installation_id() -> int | None:
function initialize_reflex_user_directory (line 599) | def initialize_reflex_user_directory():
function initialize_frontend_dependencies (line 606) | def initialize_frontend_dependencies():
function check_db_used (line 621) | def check_db_used() -> bool:
function check_redis_used (line 630) | def check_redis_used() -> bool:
function check_db_initialized (line 639) | def check_db_initialized() -> bool:
function check_schema_up_to_date (line 657) | def check_schema_up_to_date():
function get_user_tier (line 681) | def get_user_tier():
FILE: reflex/utils/processes.py
function kill (line 28) | def kill(pid: int):
function get_num_workers (line 37) | def get_num_workers() -> int:
function _can_bind_at_port (line 62) | def _can_bind_at_port(
function _can_bind_at_any_port (line 86) | def _can_bind_at_any_port(address_family: socket.AddressFamily | int) ->...
function is_process_on_port (line 104) | def is_process_on_port(
function handle_port (line 126) | def handle_port(service_name: str, port: int, auto_increment: bool) -> int:
function new_process (line 184) | def new_process(
function new_process (line 193) | def new_process(
function new_process (line 201) | def new_process(
function run_concurrently_context (line 262) | def run_concurrently_context(
function run_concurrently (line 301) | def run_concurrently(*fns: Callable | tuple) -> None:
function stream_logs (line 311) | def stream_logs(
function show_logs (line 395) | def show_logs(message: str, process: subprocess.Popen):
function show_status (line 406) | def show_status(
function show_progress (line 440) | def show_progress(message: str, process: subprocess.Popen, checkpoints: ...
function atexit_handler (line 462) | def atexit_handler():
function get_command_with_loglevel (line 467) | def get_command_with_loglevel(command: list[str]) -> list[str]:
function run_process_with_fallbacks (line 486) | def run_process_with_fallbacks(
function execute_command_and_return_output (line 541) | def execute_command_and_return_output(command: str) -> str | None:
FILE: reflex/utils/pyi_generator.py
function _walk_files (line 100) | def _walk_files(path: str | Path):
function _relative_to_pwd (line 117) | def _relative_to_pwd(path: Path) -> Path:
function _get_type_hint (line 131) | def _get_type_hint(
function _get_source (line 242) | def _get_source(obj: Any) -> str:
function _get_class_prop_comments (line 255) | def _get_class_prop_comments(clz: type[Component]) -> Mapping[str, tuple...
function _get_full_argspec (line 302) | def _get_full_argspec(func: Callable) -> inspect.FullArgSpec:
function _get_signature_return_annotation (line 315) | def _get_signature_return_annotation(func: Callable) -> Any:
function _get_module_star_imports (line 328) | def _get_module_star_imports(module_name: str) -> Mapping[str, Any]:
function _get_module_selected_imports (line 349) | def _get_module_selected_imports(
function _get_class_annotation_globals (line 366) | def _get_class_annotation_globals(target_class: type) -> Mapping[str, Any]:
function _get_class_event_triggers (line 382) | def _get_class_event_triggers(target_class: type) -> frozenset[str]:
function _generate_imports (line 394) | def _generate_imports(
function _generate_docstrings (line 414) | def _generate_docstrings(clzs: list[type[Component]], props: list[str]) ...
function _extract_func_kwargs_as_ast_nodes (line 441) | def _extract_func_kwargs_as_ast_nodes(
function _extract_class_props_as_ast_nodes (line 470) | def _extract_class_props_as_ast_nodes(
function type_to_ast (line 539) | def type_to_ast(typ: Any, cls: type) -> ast.expr:
function _get_parent_imports (line 614) | def _get_parent_imports(func: Callable) -> Mapping[str, tuple[str, ...]]:
function _generate_component_create_functiondef (line 640) | def _generate_component_create_functiondef(
function _generate_staticmethod_call_functiondef (line 824) | def _generate_staticmethod_call_functiondef(
function _generate_namespace_call_functiondef (line 876) | def _generate_namespace_call_functiondef(
class StubGenerator (line 927) | class StubGenerator(ast.NodeTransformer):
method __init__ (line 930) | def __init__(
method _remove_docstring (line 954) | def _remove_docstring(
method _current_class_is_component (line 973) | def _current_class_is_component(self) -> type[Component] | None:
method visit_Module (line 987) | def visit_Module(self, node: ast.Module) -> ast.Module:
method visit_Import (line 999) | def visit_Import(
method visit_ImportFrom (line 1018) | def visit_ImportFrom(
method visit_ClassDef (line 1035) | def visit_ClassDef(self, node: ast.ClassDef) -> ast.ClassDef:
method visit_FunctionDef (line 1102) | def visit_FunctionDef(self, node: ast.FunctionDef) -> Any:
method visit_Assign (line 1137) | def visit_Assign(self, node: ast.Assign) -> ast.Assign | None:
method visit_AnnAssign (line 1167) | def visit_AnnAssign(self, node: ast.AnnAssign) -> ast.AnnAssign | None:
class InitStubGenerator (line 1195) | class InitStubGenerator(StubGenerator):
method visit_Import (line 1198) | def visit_Import(
function _path_to_module_name (line 1212) | def _path_to_module_name(path: Path) -> str:
function _write_pyi_file (line 1224) | def _write_pyi_file(module_path: Path, source: str) -> str:
function _get_init_lazy_imports (line 1243) | def _get_init_lazy_imports(mod: tuple | ModuleType, new_tree: ast.AST):
function _scan_file (line 1304) | def _scan_file(module_path: Path) -> tuple[str, str] | None:
class PyiGenerator (line 1347) | class PyiGenerator:
method _scan_files (line 1357) | def _scan_files(self, files: list[Path]):
method scan_all (line 1389) | def scan_all(
FILE: reflex/utils/redir.py
function open_browser (line 9) | def open_browser(target_url: "SplitResult") -> None:
function reflex_build_redirect (line 28) | def reflex_build_redirect() -> None:
function reflex_templates (line 37) | def reflex_templates():
FILE: reflex/utils/registry.py
function latency (line 10) | def latency(registry: str) -> int:
function average_latency (line 31) | def average_latency(registry: str, attempts: int = 3) -> int:
function _best_registry_file_path (line 46) | def _best_registry_file_path() -> Path:
function _get_best_registry (line 56) | def _get_best_registry() -> str:
function get_npm_registry (line 74) | def get_npm_registry() -> str:
FILE: reflex/utils/rename.py
function rename_path_up_tree (line 13) | def rename_path_up_tree(full_path: str | Path, old_name: str, new_name: ...
function rename_app (line 50) | def rename_app(new_app_name: str, loglevel: constants.LogLevel):
function rename_imports_and_app_name (line 90) | def rename_imports_and_app_name(file_path: str | Path, old_name: str, ne...
function process_directory (line 132) | def process_directory(
FILE: reflex/utils/serializers.py
function serializer (line 39) | def serializer(
function serializer (line 47) | def serializer(
function serializer (line 54) | def serializer(
function serialize (line 125) | def serialize(
function serialize (line 131) | def serialize(value: Any, get_type: Literal[False]) -> SerializedType | ...
function serialize (line 135) | def serialize(value: Any) -> SerializedType | None: ...
function serialize (line 138) | def serialize(
function get_serializer (line 172) | def get_serializer(type_: type) -> Serializer | None:
function get_serializer_type (line 196) | def get_serializer_type(type_: type) -> type | None:
function has_serializer (line 219) | def has_serializer(type_: type, into_type: type | None = None) -> bool:
function can_serialize (line 235) | def can_serialize(type_: type, into_type: type | None = None) -> bool:
function serialize_type (line 253) | def serialize_type(value: type) -> str:
function serialize_base (line 266) | def serialize_base(value: Base) -> dict:
function serialize_base_model_v1 (line 287) | def serialize_base_model_v1(model: BaseModelV1) -> dict:
function serialize_base_model_v2 (line 301) | def serialize_base_model_v2(model: BaseModelV2) -> dict:
function serialize_set (line 314) | def serialize_set(value: set) -> list:
function serialize_sequence (line 327) | def serialize_sequence(value: Sequence) -> list:
function serialize_mapping (line 340) | def serialize_mapping(value: Mapping) -> dict:
function serialize_datetime (line 353) | def serialize_datetime(dt: date | datetime | time | timedelta) -> str:
function serialize_path (line 366) | def serialize_path(path: Path) -> str:
function serialize_enum (line 379) | def serialize_enum(en: Enum) -> str:
function serialize_uuid (line 392) | def serialize_uuid(uuid: UUID) -> str:
function serialize_decimal (line 405) | def serialize_decimal(value: decimal.Decimal) -> float:
function serialize_color (line 418) | def serialize_color(color: Color) -> str:
function format_dataframe_values (line 433) | def format_dataframe_values(df: DataFrame) -> list[list[Any]]:
function serialize_dataframe (line 448) | def serialize_dataframe(df: DataFrame) -> dict:
function serialize_figure (line 468) | def serialize_figure(figure: Figure) -> dict:
function serialize_template (line 480) | def serialize_template(template: layout.Template) -> dict:
function serialize_image (line 503) | def serialize_image(image: Img) -> str:
FILE: reflex/utils/tasks.py
function _run_forever (line 11) | async def _run_forever(
function ensure_task (line 58) | def ensure_task(
FILE: reflex/utils/telemetry.py
class CpuInfo (line 27) | class CpuInfo:
function format_address_width (line 35) | def format_address_width(address_width: str | None) -> int | None:
function _retrieve_cpu_info (line 50) | def _retrieve_cpu_info() -> CpuInfo | None:
function get_cpu_info (line 106) | def get_cpu_info() -> CpuInfo | None:
function get_os (line 122) | def get_os() -> str:
function get_detailed_platform_str (line 131) | def get_detailed_platform_str() -> str:
function get_python_version (line 140) | def get_python_version() -> str:
function get_reflex_version (line 150) | def get_reflex_version() -> str:
function get_cpu_count (line 159) | def get_cpu_count() -> int:
function get_reflex_enterprise_version (line 168) | def get_reflex_enterprise_version() -> str | None:
function _raise_on_missing_project_hash (line 180) | def _raise_on_missing_project_hash() -> bool:
class _Properties (line 194) | class _Properties(TypedDict):
class _DefaultEvent (line 210) | class _DefaultEvent(TypedDict):
class _Event (line 217) | class _Event(_DefaultEvent):
function _get_event_defaults (line 224) | def _get_event_defaults() -> _DefaultEvent | None:
function get_event_defaults (line 264) | def get_event_defaults() -> _DefaultEvent | None:
function _prepare_event (line 273) | def _prepare_event(event: str, **kwargs) -> _Event | None:
function _send_event (line 307) | def _send_event(event_data: _Event) -> bool:
function _send (line 318) | def _send(event: str, telemetry_enabled: bool | None, **kwargs) -> bool:
function send (line 340) | def send(event: str, telemetry_enabled: bool | None = None, **kwargs):
function send_error (line 366) | def send_error(error: Exception, context: str):
FILE: reflex/utils/templates.py
class Template (line 16) | class Template:
function create_config (line 24) | def create_config(app_name: str):
function initialize_app_directory (line 37) | def initialize_app_directory(
function initialize_default_app (line 100) | def initialize_default_app(app_name: str):
function create_config_init_app_from_remote_template (line 110) | def create_config_init_app_from_remote_template(app_name: str, template_...
function validate_and_create_app_using_remote_template (line 194) | def validate_and_create_app_using_remote_template(
function fetch_app_templates (line 237) | def fetch_app_templates(version: str) -> dict[str, Template]:
function fetch_remote_templates (line 291) | def fetch_remote_templates(
function prompt_for_template_options (line 315) | def prompt_for_template_options(templates: list[Template]) -> str:
function initialize_app (line 359) | def initialize_app(app_name: str, template: str | None = None) -> str | ...
function get_init_cli_prompt_options (line 411) | def get_init_cli_prompt_options() -> list[Template]:
FILE: reflex/utils/token_manager.py
function _get_new_token (line 23) | def _get_new_token() -> str:
class SocketRecord (line 33) | class SocketRecord:
class LostAndFoundRecord (line 41) | class LostAndFoundRecord:
class TokenManager (line 48) | class TokenManager(ABC):
method __init__ (line 51) | def __init__(self):
method token_to_sid (line 61) | def token_to_sid(self) -> MappingProxyType[str, str]:
method enumerate_tokens (line 71) | async def enumerate_tokens(self) -> AsyncIterator[str]:
method link_token_to_sid (line 81) | async def link_token_to_sid(self, token: str, sid: str) -> str | None:
method disconnect_token (line 93) | async def disconnect_token(self, token: str, sid: str) -> None:
method create (line 102) | def create(cls) -> TokenManager:
method disconnect_all (line 115) | async def disconnect_all(self):
class LocalTokenManager (line 128) | class LocalTokenManager(TokenManager):
method __init__ (line 131) | def __init__(self):
method link_token_to_sid (line 135) | async def link_token_to_sid(self, token: str, sid: str) -> str | None:
method disconnect_token (line 163) | async def disconnect_token(self, token: str, sid: str) -> None:
class RedisTokenManager (line 175) | class RedisTokenManager(LocalTokenManager):
method __init__ (line 184) | def __init__(self, redis: Redis):
method _get_redis_key (line 205) | def _get_redis_key(self, token: str) -> str:
method enumerate_tokens (line 216) | async def enumerate_tokens(self) -> AsyncIterator[str]:
method _handle_socket_record_del (line 232) | async def _handle_socket_record_del(
method _subscribe_socket_record_updates (line 249) | async def _subscribe_socket_record_updates(self) -> None:
method _ensure_socket_record_task (line 278) | def _ensure_socket_record_task(self) -> None:
method link_token_to_sid (line 287) | async def link_token_to_sid(self, token: str, sid: str) -> str | None:
method disconnect_token (line 339) | async def disconnect_token(self, token: str, sid: str) -> None:
method _get_lost_and_found_key (line 363) | def _get_lost_and_found_key(instance_id: str) -> str:
method _subscribe_lost_and_found_updates (line 374) | async def _subscribe_lost_and_found_updates(
method ensure_lost_and_found_task (line 392) | def ensure_lost_and_found_task(
method _get_token_owner (line 409) | async def _get_token_owner(self, token: str, refresh: bool = False) ->...
method emit_lost_and_found (line 438) | async def emit_lost_and_found(
FILE: reflex/utils/types.py
class _ArgsSpec0 (line 72) | class _ArgsSpec0(Protocol):
method __call__ (line 73) | def __call__(self) -> Sequence[Var]: ...
class _ArgsSpec1 (line 76) | class _ArgsSpec1(Protocol):
method __call__ (line 77) | def __call__(self, var1: VAR1, /) -> Sequence[Var]: ... # pyright: ig...
class _ArgsSpec2 (line 80) | class _ArgsSpec2(Protocol):
method __call__ (line 81) | def __call__(self, var1: VAR1, var2: VAR2, /) -> Sequence[Var]: ... #...
class _ArgsSpec3 (line 84) | class _ArgsSpec3(Protocol):
method __call__ (line 85) | def __call__(self, var1: VAR1, var2: VAR2, var3: VAR3, /) -> Sequence[...
class _ArgsSpec4 (line 88) | class _ArgsSpec4(Protocol):
method __call__ (line 89) | def __call__(
class _ArgsSpec5 (line 99) | class _ArgsSpec5(Protocol):
method __call__ (line 100) | def __call__(
class _ArgsSpec6 (line 111) | class _ArgsSpec6(Protocol):
method __call__ (line 112) | def __call__(
class _ArgsSpec7 (line 124) | class _ArgsSpec7(Protocol):
method __call__ (line 125) | def __call__(
class Unset (line 166) | class Unset:
method __repr__ (line 172) | def __repr__(self) -> str:
method __bool__ (line 180) | def __bool__(self) -> bool:
function _get_origin_cached (line 190) | def _get_origin_cached(tp: Any):
function get_origin (line 194) | def get_origin(tp: Any):
function is_generic_alias (line 211) | def is_generic_alias(cls: GenericType) -> bool:
function get_type_hints (line 224) | def get_type_hints(obj: Any) -> dict[str, Any]:
function _unionize (line 236) | def _unionize(args: list[GenericType]) -> GenericType:
function unionize (line 244) | def unionize(*args: GenericType) -> type:
function is_none (line 256) | def is_none(cls: GenericType) -> bool:
function is_union (line 268) | def is_union(cls: GenericType) -> bool:
function is_literal (line 283) | def is_literal(cls: GenericType) -> bool:
function has_args (line 296) | def has_args(cls: type) -> bool:
function is_optional (line 317) | def is_optional(cls: GenericType) -> bool:
function is_classvar (line 333) | def is_classvar(a_type: Any) -> bool:
function value_inside_optional (line 351) | def value_inside_optional(cls: GenericType) -> GenericType:
function get_field_type (line 367) | def get_field_type(cls: GenericType, field_name: str) -> GenericType | N...
function get_property_hint (line 397) | def get_property_hint(attr: Any | None) -> GenericType | None:
function get_attribute_access_type (line 412) | def get_attribute_access_type(cls: GenericType, name: str) -> GenericTyp...
function get_base_class (line 530) | def get_base_class(cls: GenericType) -> type:
function _breakpoints_satisfies_typing (line 556) | def _breakpoints_satisfies_typing(cls_check: GenericType, instance: Any)...
function _issubclass (line 587) | def _issubclass(cls: GenericType, cls_check: GenericType, instance: Any ...
function does_obj_satisfy_typed_dict (line 637) | def does_obj_satisfy_typed_dict(
function _isinstance (line 693) | def _isinstance(
function is_dataframe (line 865) | def is_dataframe(value: type) -> bool:
function is_valid_var_type (line 879) | def is_valid_var_type(type_: type) -> bool:
function is_backend_base_variable (line 906) | def is_backend_base_variable(name: str, cls: type[BaseState]) -> bool:
function check_type_in_allowed_types (line 959) | def check_type_in_allowed_types(value_type: type, allowed_types: Iterabl...
function check_prop_in_allowed_types (line 972) | def check_prop_in_allowed_types(prop: Any, allowed_types: Iterable) -> b...
function is_encoded_fstring (line 989) | def is_encoded_fstring(value: Any) -> bool:
function validate_literal (line 1001) | def validate_literal(key: str, value: Any, expected_type: type, comp_nam...
function safe_issubclass (line 1031) | def safe_issubclass(cls: Any, cls_check: Any | tuple[Any, ...]):
function typehint_issubclass (line 1047) | def typehint_issubclass(
function resolve_annotations (line 1188) | def resolve_annotations(
function get_default_value_for_type (line 1230) | def get_default_value_for_type(t: GenericType) -> Any:
function is_immutable (line 1277) | def is_immutable(i: Any) -> bool:
FILE: reflex/vars/base.py
function _pydantic_validator (line 95) | def _pydantic_validator(*args, **kwargs):
class VarSubclassEntry (line 103) | class VarSubclassEntry:
class VarData (line 119) | class VarData:
method __init__ (line 143) | def __init__(
method old_school_imports (line 191) | def old_school_imports(self) -> ImportDict:
method merge (line 199) | def merge(*all: VarData | None) -> VarData | None:
method __bool__ (line 271) | def __bool__(self) -> bool:
method from_state (line 288) | def from_state(cls, state: type[BaseState] | str, field_name: str = ""...
function _decode_var_immutable (line 316) | def _decode_var_immutable(value: str) -> tuple[VarData | None, str]:
function can_use_in_object_var (line 354) | def can_use_in_object_var(cls: GenericType) -> bool:
class MetaclassVar (line 372) | class MetaclassVar(type):
method __setattr__ (line 375) | def __setattr__(cls, name: str, value: Any):
class Var (line 391) | class Var(Generic[VAR_TYPE], metaclass=MetaclassVar):
method __str__ (line 403) | def __str__(self) -> str:
method _var_is_local (line 412) | def _var_is_local(self) -> bool:
method _var_is_string (line 421) | def _var_is_string(self) -> bool:
method __init_subclass__ (line 429) | def __init_subclass__(
method __post_init__ (line 476) | def __post_init__(self):
method __hash__ (line 500) | def __hash__(self) -> int:
method _get_all_var_data (line 508) | def _get_all_var_data(self) -> VarData | None:
method __deepcopy__ (line 516) | def __deepcopy__(self, memo: dict[int, Any]) -> Self:
method equals (line 527) | def equals(self, other: Var) -> bool:
method _replace (line 543) | def _replace(
method _replace (line 551) | def _replace(
method _replace (line 558) | def _replace(
method create (line 604) | def create( # pyright: ignore[reportOverlappingOverload]
method create (line 612) | def create( # pyright: ignore[reportOverlappingOverload]
method create (line 620) | def create(
method create (line 628) | def create(
method create (line 636) | def create(
method create (line 644) | def create( # pyright: ignore [reportOverlappingOverload]
method create (line 652) | def create( # pyright: ignore [reportOverlappingOverload]
method create (line 660) | def create( # pyright: ignore [reportOverlappingOverload]
method create (line 668) | def create( # pyright: ignore[reportOverlappingOverload]
method create (line 676) | def create(
method create (line 684) | def create(
method create (line 692) | def create(
method create (line 699) | def create(
method __format__ (line 719) | def __format__(self, format_spec: str) -> str:
method to (line 736) | def to(self, output: type[str]) -> StringVar: ... # pyright: ignore[r...
method to (line 739) | def to(self, output: type[bool]) -> BooleanVar: ...
method to (line 742) | def to(self, output: type[int]) -> NumberVar[int]: ...
method to (line 745) | def to(self, output: type[float]) -> NumberVar[float]: ...
method to
Condensed preview — 488 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,769K chars).
[
{
"path": ".devcontainer/devcontainer.json",
"chars": 404,
"preview": "{\n \"image\": \"mcr.microsoft.com/devcontainers/python:3.14-trixie\",\n \"postCreateCommand\": \"/bin/bash -c 'python -m pip i"
},
{
"path": ".github/CODEOWNERS",
"chars": 24,
"preview": "@reflex-dev/reflex-team\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 598,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: \"\"\nassignees: \"\"\n---\n\n**Describe the bug**\nA clear"
},
{
"path": ".github/ISSUE_TEMPLATE/build_issue.md",
"chars": 403,
"preview": "---\nname: Build Issue\nabout: Report an issue related to reflex.build\ntitle: \"[BUILD] \" # This acts as a hint, but users "
},
{
"path": ".github/ISSUE_TEMPLATE/cloud_issue.md",
"chars": 403,
"preview": "---\nname: Cloud Issue\nabout: Report an issue related to Reflex Cloud\ntitle: \"[CLOUD] \" # This acts as a hint, but users "
},
{
"path": ".github/ISSUE_TEMPLATE/custom_component_request.md",
"chars": 607,
"preview": "---\nname: Custom Component Request\nabout: Suggest a new custom component for Reflex\ntitle: \"\"\nlabels: \"custom component "
},
{
"path": ".github/ISSUE_TEMPLATE/enhancement_request.md",
"chars": 471,
"preview": "---\nname: Enhancement Request\nabout: Suggest an enhancement for an existing Reflex feature.\ntitle: \"\"\nlabels: \"enhanceme"
},
{
"path": ".github/ISSUE_TEMPLATE/enterprise_issue.md",
"chars": 423,
"preview": "---\nname: Enterprise Issue\nabout: Report an issue related to Reflex Enterprise\ntitle: \"[ENTERPRISE] \" # This acts as a h"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 349,
"preview": "---\nname: Feature Request\nabout: Suggest a new feature for Reflex\ntitle: \"\"\nlabels: \"feature request\"\nassignees: \"\"\n---\n"
},
{
"path": ".github/actions/setup_build_env/action.yml",
"chars": 1434,
"preview": "# Entry conditions:\n# - `setup/checkout` has already happened\n# - working dir is the root directory of your project (e.g"
},
{
"path": ".github/codeql-config.yml",
"chars": 84,
"preview": "paths:\n - .github\n - reflex\n - reflex/.templates\npaths-ignore:\n - \"**/tests/**\"\n"
},
{
"path": ".github/pull_request_template.md",
"chars": 1374,
"preview": "### All Submissions:\n\n- [ ] Have you followed the guidelines stated in [CONTRIBUTING.md](https://github.com/reflex-dev/r"
},
{
"path": ".github/workflows/check_node_latest.yml",
"chars": 824,
"preview": "name: integration-node-latest\npermissions:\n contents: read\n\non:\n push:\n branches:\n - main\n pull_request:\n "
},
{
"path": ".github/workflows/check_outdated_dependencies.yml",
"chars": 3160,
"preview": "name: check-outdated-dependencies\npermissions:\n contents: read\n\non:\n push: # This will trigger the action when a pull "
},
{
"path": ".github/workflows/codeql.yml",
"chars": 4863,
"preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
},
{
"path": ".github/workflows/dependency-review.yml",
"chars": 579,
"preview": "name: \"Dependency Review\"\non: [pull_request]\n\npermissions:\n contents: read\n\njobs:\n dependency-review:\n runs-on: ubu"
},
{
"path": ".github/workflows/integration_app_harness.yml",
"chars": 1640,
"preview": "name: integration-app-harness\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github.event.pull_request.id }}\n cancel"
},
{
"path": ".github/workflows/integration_tests.yml",
"chars": 7318,
"preview": "name: integration-tests\n\non:\n push:\n branches: [\"main\"]\n paths-ignore:\n - \"**/*.md\"\n pull_request:\n bran"
},
{
"path": ".github/workflows/performance.yml",
"chars": 907,
"preview": "name: performance-tests\npermissions:\n contents: read\n\non:\n push:\n branches:\n - \"main\" # or \"master\"\n paths-"
},
{
"path": ".github/workflows/pre-commit.yml",
"chars": 846,
"preview": "name: pre-commit\npermissions:\n contents: read\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github.event.pull_reque"
},
{
"path": ".github/workflows/publish.yml",
"chars": 675,
"preview": "name: Publish to PyPI\n\non:\n workflow_dispatch:\n\njobs:\n publish:\n runs-on: ubuntu-latest\n environment:\n name"
},
{
"path": ".github/workflows/reflex_init_in_docker_test.yml",
"chars": 1015,
"preview": "name: reflex-init-in-docker-test\npermissions:\n contents: read\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github."
},
{
"path": ".github/workflows/unit_tests.yml",
"chars": 3200,
"preview": "name: unit-tests\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github.event.pull_request.id }}\n cancel-in-progress:"
},
{
"path": ".gitignore",
"chars": 270,
"preview": "**/.DS_Store\n**/*.pyc\nassets/external/*\ndist/*\nexamples/\n.web\n.states\n.idea\n.vscode\n.coverage\n.coverage.*\n.venv\nvenv\nreq"
},
{
"path": ".python-version",
"chars": 4,
"preview": "3.14"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5280,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": "CONTRIBUTING.md",
"chars": 3606,
"preview": "# Reflex Contributing Guidelines\n\nFor an extensive guide on the different ways to contribute to Reflex see our [Contribu"
},
{
"path": "LICENSE",
"chars": 11358,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "MCP_README.md",
"chars": 340,
"preview": "# Reflex MCP Server\n\nThe Reflex MCP Server provides comprehensive access to Reflex framework documentation and component"
},
{
"path": "README.md",
"chars": 11087,
"preview": "<div align=\"center\">\n<img src=\"https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/reflex.svg\" alt=\"Ref"
},
{
"path": "SECURITY.md",
"chars": 289,
"preview": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported |\n| -------- | ------------------ |\n| >= 0.7.0"
},
{
"path": "docker-example/README.md",
"chars": 1152,
"preview": "# Reflex Docker Examples\n\nThis directory contains several examples of how to deploy Reflex apps using docker.\n\nIn all ca"
},
{
"path": "docker-example/production-app-platform/.dockerignore",
"chars": 50,
"preview": ".web\n.git\n__pycache__/*\nDockerfile\nuploaded_files\n"
},
{
"path": "docker-example/production-app-platform/Dockerfile",
"chars": 2286,
"preview": "# This docker file is intended to be used with container hosting services\n#\n# After deploying this image, get the URL po"
},
{
"path": "docker-example/production-app-platform/README.md",
"chars": 4055,
"preview": "# production-app-platform\n\nThis example deployment is intended for use with App hosting platforms, like\nAzure, AWS, or G"
},
{
"path": "docker-example/production-compose/.dockerignore",
"chars": 95,
"preview": ".web\n.git\n__pycache__/*\nDockerfile\nCaddy.Dockerfile\ncompose.yaml\ncompose.*.yaml\nuploaded_files\n"
},
{
"path": "docker-example/production-compose/Caddy.Dockerfile",
"chars": 111,
"preview": "FROM library/caddy\n\nCOPY --from=local/reflex-app /app/.web/build/client /srv\nADD Caddyfile /etc/caddy/Caddyfile"
},
{
"path": "docker-example/production-compose/Caddyfile",
"chars": 204,
"preview": "{$DOMAIN}\n\nencode gzip\n\n@backend_routes path /_event/* /ping /_upload /_upload/*\nhandle @backend_routes {\n\treverse_proxy"
},
{
"path": "docker-example/production-compose/Dockerfile",
"chars": 1631,
"preview": "# This docker file is intended to be used with docker compose to deploy a production\n# instance of a Reflex app.\n\n# Stag"
},
{
"path": "docker-example/production-compose/README.md",
"chars": 2717,
"preview": "# production-compose\n\nThis example production deployment uses automatic TLS with Caddy serving static\nfiles for the fron"
},
{
"path": "docker-example/production-compose/compose.prod.yaml",
"chars": 559,
"preview": "# Use this override file to run the app in prod mode with postgres and redis\n# docker compose -f compose.yaml -f com"
},
{
"path": "docker-example/production-compose/compose.tools.yaml",
"chars": 439,
"preview": "# Use this override file with `compose.prod.yaml` to run admin tools\n# for production services.\n# docker compose -f "
},
{
"path": "docker-example/production-compose/compose.yaml",
"chars": 964,
"preview": "# Base compose file production deployment of reflex app with Caddy webserver\n# providing TLS termination and reverse pro"
},
{
"path": "docker-example/production-one-port/.dockerignore",
"chars": 40,
"preview": ".web\n!.web/bun.lockb\n!.web/package.json\n"
},
{
"path": "docker-example/production-one-port/Caddyfile",
"chars": 209,
"preview": ":{$PORT}\n\nencode gzip\n\n@backend_routes path /_event/* /ping /_upload /_upload/*\nhandle @backend_routes {\n\treverse_proxy "
},
{
"path": "docker-example/production-one-port/Dockerfile",
"chars": 2139,
"preview": "# This Dockerfile is used to deploy a single-container Reflex app instance\n# to services like Render, Railway, Heroku, G"
},
{
"path": "docker-example/production-one-port/README.md",
"chars": 1186,
"preview": "# production-one-port\n\nThis docker deployment runs Reflex in prod mode, exposing a single HTTP port:\n\n- `8080` (`$PORT`)"
},
{
"path": "docker-example/simple-one-port/.dockerignore",
"chars": 50,
"preview": ".web\n.git\n__pycache__/*\nDockerfile\nuploaded_files\n"
},
{
"path": "docker-example/simple-one-port/Caddyfile",
"chars": 209,
"preview": ":{$PORT}\n\nencode gzip\n\n@backend_routes path /_event/* /ping /_upload /_upload/*\nhandle @backend_routes {\n\treverse_proxy "
},
{
"path": "docker-example/simple-one-port/Dockerfile",
"chars": 1497,
"preview": "# This Dockerfile is used to deploy a single-container Reflex app instance\n# to services like Render, Railway, Heroku, G"
},
{
"path": "docker-example/simple-one-port/README.md",
"chars": 1107,
"preview": "# simple-one-port\n\nThis docker deployment runs Reflex in prod mode, exposing a single HTTP port:\n\n- `8080` (`$PORT`) - C"
},
{
"path": "docker-example/simple-two-port/.dockerignore",
"chars": 50,
"preview": ".web\n.git\n__pycache__/*\nDockerfile\nuploaded_files\n"
},
{
"path": "docker-example/simple-two-port/Dockerfile",
"chars": 822,
"preview": "# This Dockerfile is used to deploy a simple single-container Reflex app instance.\nFROM python:3.13\n\nRUN apt-get update "
},
{
"path": "docker-example/simple-two-port/README.md",
"chars": 1106,
"preview": "# simple-two-port\n\nThis docker deployment runs Reflex in prod mode, exposing two HTTP ports:\n\n- `3000` - node server usi"
},
{
"path": "docs/DEBUGGING.md",
"chars": 592,
"preview": "# Debugging\n\nIt is possible to run Reflex apps in dev mode under a debugger.\n\n1. Run Reflex as a module: `python -m refl"
},
{
"path": "docs/de/README.md",
"chars": 10632,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ Performante, anpa"
},
{
"path": "docs/es/README.md",
"chars": 10338,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ Aplicaciones web "
},
{
"path": "docs/in/README.md",
"chars": 10276,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex_dark.svg#gh-light-mode-only\" alt=\"Reflex लोगो\" width=\"300px\">\n<img sr"
},
{
"path": "docs/it/README.md",
"chars": 10218,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ App web performan"
},
{
"path": "docs/ja/README.md",
"chars": 7960,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ 即時デプロイが可能な、Pure P"
},
{
"path": "docs/kr/README.md",
"chars": 7925,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ 순수 Python으로 고성능 사"
},
{
"path": "docs/pe/README.md",
"chars": 10000,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ برنامه های تحت وب"
},
{
"path": "docs/pt/pt_br/README.md",
"chars": 10342,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ Web apps customiz"
},
{
"path": "docs/tr/README.md",
"chars": 10247,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ Saf Python'da per"
},
{
"path": "docs/vi/README.md",
"chars": 9786,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ Ứng dụng web hiệu"
},
{
"path": "docs/zh/zh_cn/README.md",
"chars": 7194,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n### **✨ 使用 Python 创建高效且可自"
},
{
"path": "docs/zh/zh_tw/README.md",
"chars": 7149,
"preview": "<div align=\"center\">\n<img src=\"/docs/images/reflex.svg\" alt=\"Reflex Logo\" width=\"300px\">\n<hr>\n\n**✨ 使用 Python 建立高效且可自訂的網頁"
},
{
"path": "pyi_hashes.json",
"chars": 10405,
"preview": "{\n \"reflex/__init__.pyi\": \"0a3ae880e256b9fd3b960e12a2cb51a7\",\n \"reflex/components/__init__.pyi\": \"ac05995852baa81062ba"
},
{
"path": "pyproject.toml",
"chars": 6401,
"preview": "[project]\nname = \"reflex\"\nversion = \"0.9.0dev1\"\ndescription = \"Web apps in pure Python.\"\nlicense.text = \"Apache-2.0\"\naut"
},
{
"path": "reflex/.templates/apps/blank/code/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "reflex/.templates/apps/blank/code/blank.py",
"chars": 898,
"preview": "\"\"\"Welcome to Reflex! This file outlines the steps to create a basic app.\"\"\"\n\nimport reflex as rx\n\nfrom rxconfig import "
},
{
"path": "reflex/.templates/web/.gitignore",
"chars": 417,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n/_static\n\n# dependencies\n/node_mo"
},
{
"path": "reflex/.templates/web/app/entry.client.js",
"chars": 264,
"preview": "import { startTransition } from \"react\";\nimport { hydrateRoot } from \"react-dom/client\";\nimport { HydratedRouter } from "
},
{
"path": "reflex/.templates/web/app/routes.js",
"chars": 254,
"preview": "import { route } from \"@react-router/dev/routes\";\nimport { flatRoutes } from \"@react-router/fs-routes\";\n\nexport default "
},
{
"path": "reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js",
"chars": 1198,
"preview": "import { useTheme } from \"$/utils/react-theme\";\nimport { createElement, useEffect } from \"react\";\nimport { ColorModeCont"
},
{
"path": "reflex/.templates/web/components/shiki/code.js",
"chars": 1144,
"preview": "import { useEffect, useState, createElement } from \"react\";\nimport { codeToHtml } from \"shiki\";\n\n/**\n * Code component t"
},
{
"path": "reflex/.templates/web/jsconfig.json",
"chars": 118,
"preview": "{\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"$/*\": [\"*\"],\n \"@/*\": [\"public/*\"]\n }\n }\n}\n"
},
{
"path": "reflex/.templates/web/postcss.config.js",
"chars": 86,
"preview": "export default {\n plugins: {\n \"postcss-import\": {},\n autoprefixer: {},\n },\n};\n"
},
{
"path": "reflex/.templates/web/react-router.config.js",
"chars": 84,
"preview": "export default {\n future: {\n unstable_optimizeDeps: true,\n },\n ssr: false,\n};\n"
},
{
"path": "reflex/.templates/web/styles/__reflex_style_reset.css",
"chars": 8707,
"preview": "@layer __reflex_base {\n /*\n 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/"
},
{
"path": "reflex/.templates/web/utils/helpers/dataeditor.js",
"chars": 1623,
"preview": "import { GridCellKind } from \"@glideapps/glide-data-grid\";\n\nexport function getDEColumn(columns, col) {\n let c = column"
},
{
"path": "reflex/.templates/web/utils/helpers/debounce.js",
"chars": 528,
"preview": "const debounce_timeout_id = {};\n\n/**\n * Generic debounce helper\n *\n * @param {string} name - the name of the event to de"
},
{
"path": "reflex/.templates/web/utils/helpers/paste.js",
"chars": 2885,
"preview": "import { useEffect, useRef } from \"react\";\n\nconst handle_paste_data = (clipboardData) =>\n new Promise((resolve, reject)"
},
{
"path": "reflex/.templates/web/utils/helpers/range.js",
"chars": 1091,
"preview": "/**\n * Simulate the python range() builtin function.\n * inspired by https://dev.to/guyariely/using-python-range-in-javas"
},
{
"path": "reflex/.templates/web/utils/helpers/throttle.js",
"chars": 566,
"preview": "const in_throttle = {};\n\n/**\n * Generic throttle helper\n *\n * @param {string} name - the name of the event to throttle\n "
},
{
"path": "reflex/.templates/web/utils/helpers/upload.js",
"chars": 4814,
"preview": "import JSON5 from \"json5\";\nimport env from \"$/env.json\";\n\n/**\n * Upload files to the server.\n *\n * @param state The stat"
},
{
"path": "reflex/.templates/web/utils/react-theme.js",
"chars": 2713,
"preview": "import {\n createContext,\n useContext,\n useState,\n useEffect,\n createElement,\n useRef,\n useMemo,\n} from \"react\";\n\n"
},
{
"path": "reflex/.templates/web/utils/state.js",
"chars": 35571,
"preview": "// State management for Reflex web apps.\nimport io from \"socket.io-client\";\nimport JSON5 from \"json5\";\nimport env from \""
},
{
"path": "reflex/.templates/web/vite-plugin-safari-cachebust.js",
"chars": 5300,
"preview": "/* vite-plugin-safari-cachebust.js\n *\n * Rewrite modulepreload <link> tags and ESM imports to include a cache-busting\n *"
},
{
"path": "reflex/__init__.py",
"chars": 10366,
"preview": "\"\"\"Import all classes and functions the end user will need to make an app.\n\nAnything imported here will be available in "
},
{
"path": "reflex/__main__.py",
"chars": 108,
"preview": "\"\"\"reflex package invocation entry point.\"\"\"\n\nfrom .reflex import cli\n\nif __name__ == \"__main__\":\n cli()\n"
},
{
"path": "reflex/admin.py",
"chars": 434,
"preview": "\"\"\"The Reflex Admin Dashboard.\"\"\"\n\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass, field\nfrom typ"
},
{
"path": "reflex/app.py",
"chars": 82325,
"preview": "\"\"\"The main Reflex app.\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nimport concurrent.futures\nimport contextl"
},
{
"path": "reflex/app_mixins/__init__.py",
"chars": 137,
"preview": "\"\"\"Reflex AppMixins package.\"\"\"\n\nfrom .lifespan import LifespanMixin\nfrom .middleware import MiddlewareMixin\nfrom .mixin"
},
{
"path": "reflex/app_mixins/lifespan.py",
"chars": 4296,
"preview": "\"\"\"Mixin that allow tasks to run during the whole app lifespan.\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\ni"
},
{
"path": "reflex/app_mixins/middleware.py",
"chars": 2848,
"preview": "\"\"\"Middleware Mixin that allow to add middleware to the app.\"\"\"\n\nfrom __future__ import annotations\n\nimport dataclasses\n"
},
{
"path": "reflex/app_mixins/mixin.py",
"chars": 305,
"preview": "\"\"\"Default mixin for all app mixins.\"\"\"\n\nimport dataclasses\n\n\n@dataclasses.dataclass\nclass AppMixin:\n \"\"\"Define the b"
},
{
"path": "reflex/assets.py",
"chars": 4670,
"preview": "\"\"\"Helper functions for adding assets to the app.\"\"\"\n\nimport inspect\nfrom pathlib import Path\n\nfrom reflex import consta"
},
{
"path": "reflex/base.py",
"chars": 2327,
"preview": "\"\"\"Define the base Reflex class.\"\"\"\n\nfrom importlib.util import find_spec\n\nif find_spec(\"pydantic\") and find_spec(\"pydan"
},
{
"path": "reflex/compiler/__init__.py",
"chars": 27,
"preview": "\"\"\"The Reflex compiler.\"\"\"\n"
},
{
"path": "reflex/compiler/compiler.py",
"chars": 29362,
"preview": "\"\"\"Compiler for the reflex apps.\"\"\"\n\nfrom __future__ import annotations\n\nimport sys\nfrom collections.abc import Callable"
},
{
"path": "reflex/compiler/templates.py",
"chars": 21527,
"preview": "\"\"\"Templates to use in the reflex compiler.\"\"\"\n\nfrom __future__ import annotations\n\nimport json\nfrom collections.abc imp"
},
{
"path": "reflex/compiler/utils.py",
"chars": 19970,
"preview": "\"\"\"Common utility functions used in the compiler.\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nimport concurre"
},
{
"path": "reflex/components/__init__.py",
"chars": 588,
"preview": "\"\"\"Import all the components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.utils import lazy_loader\n\n_SUBMODULES:"
},
{
"path": "reflex/components/base/__init__.py",
"chars": 690,
"preview": "\"\"\"Base components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.utils import lazy_loader\n\n_SUBMODULES: set[str] "
},
{
"path": "reflex/components/base/app_wrap.py",
"chars": 514,
"preview": "\"\"\"Top-level component that wraps the entire app.\"\"\"\n\nfrom reflex.components.base.fragment import Fragment\nfrom reflex.c"
},
{
"path": "reflex/components/base/bare.py",
"chars": 8285,
"preview": "\"\"\"A bare component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Iterator, Sequence\nfrom typing "
},
{
"path": "reflex/components/base/body.py",
"chars": 129,
"preview": "\"\"\"Display the page body.\"\"\"\n\nfrom reflex.components.el import elements\n\n\nclass Body(elements.Body):\n \"\"\"A body compo"
},
{
"path": "reflex/components/base/document.py",
"chars": 636,
"preview": "\"\"\"Document components.\"\"\"\n\nfrom reflex.components.component import Component\n\n\nclass ReactRouterLib(Component):\n \"\"\""
},
{
"path": "reflex/components/base/error_boundary.py",
"chars": 7528,
"preview": "\"\"\"A React Error Boundary component that catches unhandled frontend exceptions.\"\"\"\n\nfrom __future__ import annotations\n\n"
},
{
"path": "reflex/components/base/fragment.py",
"chars": 342,
"preview": "\"\"\"React fragments to enable bare returns of component trees from functions.\"\"\"\n\nfrom reflex.components.component import"
},
{
"path": "reflex/components/base/link.py",
"chars": 937,
"preview": "\"\"\"Display the title of the current page.\"\"\"\n\nfrom reflex.components.el.elements.base import BaseHTML\nfrom reflex.vars.b"
},
{
"path": "reflex/components/base/meta.py",
"chars": 1211,
"preview": "\"\"\"Display the title of the current page.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.components.base.bare impor"
},
{
"path": "reflex/components/base/script.py",
"chars": 2288,
"preview": "\"\"\"Wrapper for the script element. Uses the Helmet component to manage the head.\"\"\"\n\nfrom __future__ import annotations\n"
},
{
"path": "reflex/components/base/strict_mode.py",
"chars": 251,
"preview": "\"\"\"Module for the StrictMode component.\"\"\"\n\nfrom reflex.components.component import Component\n\n\nclass StrictMode(Compone"
},
{
"path": "reflex/components/component.py",
"chars": 97727,
"preview": "\"\"\"Base component definitions.\"\"\"\n\nfrom __future__ import annotations\n\nimport contextlib\nimport copy\nimport dataclasses\n"
},
{
"path": "reflex/components/core/__init__.py",
"chars": 1418,
"preview": "\"\"\"Core Reflex components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.utils import lazy_loader\n\n_SUBMODULES: se"
},
{
"path": "reflex/components/core/auto_scroll.py",
"chars": 3815,
"preview": "\"\"\"A component that automatically scrolls to the bottom when new content is added.\"\"\"\n\nfrom __future__ import annotation"
},
{
"path": "reflex/components/core/banner.py",
"chars": 18471,
"preview": "\"\"\"Banner components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex import constants\nfrom reflex.components.base.f"
},
{
"path": "reflex/components/core/breakpoints.py",
"chars": 2600,
"preview": "\"\"\"Breakpoints utility.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import TypeVar\n\nbreakpoints_values = [\"30em\""
},
{
"path": "reflex/components/core/clipboard.py",
"chars": 3339,
"preview": "\"\"\"Global on_paste handling for Reflex app.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Sequence"
},
{
"path": "reflex/components/core/colors.py",
"chars": 1564,
"preview": "\"\"\"The colors used in Reflex are a wrapper around https://www.radix-ui.com/colors.\"\"\"\n\nfrom reflex.constants.base import"
},
{
"path": "reflex/components/core/cond.py",
"chars": 5531,
"preview": "\"\"\"Create a list of components from an iterable.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any, overloa"
},
{
"path": "reflex/components/core/debounce.py",
"chars": 5054,
"preview": "\"\"\"Wrapper around react-debounce-input.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any\n\nfrom reflex.comp"
},
{
"path": "reflex/components/core/foreach.py",
"chars": 6060,
"preview": "\"\"\"Create a list of components from an iterable.\"\"\"\n\nfrom __future__ import annotations\n\nimport functools\nimport inspect"
},
{
"path": "reflex/components/core/helmet.py",
"chars": 220,
"preview": "\"\"\"Helmet component module.\"\"\"\n\nfrom reflex.components.component import Component\n\n\nclass Helmet(Component):\n \"\"\"A he"
},
{
"path": "reflex/components/core/html.py",
"chars": 1303,
"preview": "\"\"\"A html component.\"\"\"\n\nfrom reflex.components.el.elements.typography import Div\nfrom reflex.vars.base import Var\n\n\ncla"
},
{
"path": "reflex/components/core/layout/__init__.py",
"chars": 30,
"preview": "\"\"\"Core layout components.\"\"\"\n"
},
{
"path": "reflex/components/core/match.py",
"chars": 9886,
"preview": "\"\"\"rx.match.\"\"\"\n\nimport textwrap\nfrom typing import Any, cast\n\nfrom reflex.components.base import Fragment\nfrom reflex.c"
},
{
"path": "reflex/components/core/responsive.py",
"chars": 1911,
"preview": "\"\"\"Responsive components.\"\"\"\n\nfrom reflex.components.radix.themes.layout.box import Box\n\n\n# Add responsive styles shortc"
},
{
"path": "reflex/components/core/sticky.py",
"chars": 3776,
"preview": "\"\"\"Components for displaying the Reflex sticky logo.\"\"\"\n\nfrom reflex.components.component import ComponentNamespace\nfrom"
},
{
"path": "reflex/components/core/upload.py",
"chars": 15174,
"preview": "\"\"\"A file upload component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Callable, Sequence\nfrom "
},
{
"path": "reflex/components/core/window_events.py",
"chars": 3954,
"preview": "\"\"\"Window event listener component for Reflex.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any, cast\n\nimp"
},
{
"path": "reflex/components/datadisplay/__init__.py",
"chars": 438,
"preview": "\"\"\"Data grid components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.utils import lazy_loader\n\n_SUBMOD_ATTRS: di"
},
{
"path": "reflex/components/datadisplay/code.py",
"chars": 12618,
"preview": "\"\"\"A code component.\"\"\"\n\nfrom __future__ import annotations\n\nimport dataclasses\nfrom typing import ClassVar, Literal\n\nfr"
},
{
"path": "reflex/components/datadisplay/dataeditor.py",
"chars": 18116,
"preview": "\"\"\"Data Editor component from glide-data-grid.\"\"\"\n\nfrom __future__ import annotations\n\nimport dataclasses\nfrom collectio"
},
{
"path": "reflex/components/datadisplay/logo.py",
"chars": 1993,
"preview": "\"\"\"A Reflex logo component.\"\"\"\n\nimport reflex as rx\n\nSVG_COLOR = rx.color_mode_cond(\"#110F1F\", \"white\")\n\n\ndef svg_logo(c"
},
{
"path": "reflex/components/datadisplay/shiki_code_block.py",
"chars": 24028,
"preview": "\"\"\"Shiki syntax hghlighter component.\"\"\"\n\nfrom __future__ import annotations\n\nimport dataclasses\nimport re\nfrom collecti"
},
{
"path": "reflex/components/dynamic.py",
"chars": 7408,
"preview": "\"\"\"Components that are dynamically generated on the backend.\"\"\"\n\nfrom typing import TYPE_CHECKING, Union\n\nfrom reflex im"
},
{
"path": "reflex/components/el/__init__.py",
"chars": 621,
"preview": "\"\"\"The el package exports raw HTML elements.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.utils import lazy_loade"
},
{
"path": "reflex/components/el/element.py",
"chars": 582,
"preview": "\"\"\"Base class definition for raw HTML elements.\"\"\"\n\nfrom typing import ClassVar\n\nfrom reflex.components.component import"
},
{
"path": "reflex/components/el/elements/__init__.py",
"chars": 2767,
"preview": "\"\"\"Element classes.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex.utils import lazy_loader\n\n_MAPPING = {\n \"form"
},
{
"path": "reflex/components/el/elements/base.py",
"chars": 3069,
"preview": "\"\"\"Base classes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.el.element import Element\nfrom reflex.vars.base "
},
{
"path": "reflex/components/el/elements/forms.py",
"chars": 21961,
"preview": "\"\"\"Forms classes.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Iterator\nfrom hashlib import md5\nf"
},
{
"path": "reflex/components/el/elements/inline.py",
"chars": 4126,
"preview": "\"\"\"Inline classes.\"\"\"\n\nfrom typing import ClassVar, Literal\n\nfrom reflex.vars.base import Var\n\nfrom .base import BaseHTM"
},
{
"path": "reflex/components/el/elements/media.py",
"chars": 26204,
"preview": "\"\"\"Media classes.\"\"\"\n\nfrom typing import Any, Literal\n\nfrom reflex import Component, ComponentNamespace\nfrom reflex.comp"
},
{
"path": "reflex/components/el/elements/metadata.py",
"chars": 2316,
"preview": "\"\"\"Metadata classes.\"\"\"\n\nfrom reflex.components.el.element import Element\nfrom reflex.components.el.elements.inline impo"
},
{
"path": "reflex/components/el/elements/other.py",
"chars": 1378,
"preview": "\"\"\"Other classes.\"\"\"\n\nfrom reflex.vars.base import Var\n\nfrom .base import BaseHTML\n\n\nclass Details(BaseHTML):\n \"\"\"Dis"
},
{
"path": "reflex/components/el/elements/scripts.py",
"chars": 1223,
"preview": "\"\"\"Scripts classes.\"\"\"\n\nfrom reflex.components.el.elements.inline import ReferrerPolicy\nfrom reflex.components.el.elemen"
},
{
"path": "reflex/components/el/elements/sectioning.py",
"chars": 1516,
"preview": "\"\"\"Sectioning classes.\"\"\"\n\nfrom .base import BaseHTML\n\n\nclass Body(BaseHTML):\n \"\"\"Display the body element.\"\"\"\n\n t"
},
{
"path": "reflex/components/el/elements/tables.py",
"chars": 2176,
"preview": "\"\"\"Tables classes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.vars.base import Var\n\nfrom .base import BaseHTML\n\n\nclass "
},
{
"path": "reflex/components/el/elements/typography.py",
"chars": 2567,
"preview": "\"\"\"Typography classes.\"\"\"\n\nfrom typing import ClassVar, Literal\n\nfrom reflex.vars.base import Var\n\nfrom .base import Bas"
},
{
"path": "reflex/components/field.py",
"chars": 5948,
"preview": "\"\"\"Shared field infrastructure for components and props.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc im"
},
{
"path": "reflex/components/gridjs/__init__.py",
"chars": 88,
"preview": "\"\"\"Grid components.\"\"\"\n\nfrom .datatable import DataTable\n\ndata_table = DataTable.create\n"
},
{
"path": "reflex/components/gridjs/datatable.py",
"chars": 4224,
"preview": "\"\"\"Table components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Sequence\nfrom typing import Any"
},
{
"path": "reflex/components/literals.py",
"chars": 527,
"preview": "\"\"\"Literal custom type used by Reflex.\"\"\"\n\nfrom typing import Literal\n\n# Base Literals\nLiteralInputType = Literal[\n \""
},
{
"path": "reflex/components/lucide/__init__.py",
"chars": 73,
"preview": "\"\"\"Lucide Icon Component.\"\"\"\n\nfrom .icon import Icon\n\nicon = Icon.create\n"
},
{
"path": "reflex/components/lucide/icon.py",
"chars": 36666,
"preview": "\"\"\"Lucide Icon component.\"\"\"\n\nfrom reflex.components.component import Component\nfrom reflex.utils import console, format"
},
{
"path": "reflex/components/markdown/__init__.py",
"chars": 71,
"preview": "\"\"\"Markdown components.\"\"\"\n\nfrom .markdown import markdown as markdown\n"
},
{
"path": "reflex/components/markdown/markdown.py",
"chars": 21075,
"preview": "\"\"\"Markdown component.\"\"\"\n\nfrom __future__ import annotations\n\nimport dataclasses\nimport textwrap\nfrom collections.abc i"
},
{
"path": "reflex/components/moment/__init__.py",
"chars": 92,
"preview": "\"\"\"Moment.js component.\"\"\"\n\nfrom .moment import Moment, MomentDelta\n\nmoment = Moment.create\n"
},
{
"path": "reflex/components/moment/moment.py",
"chars": 4263,
"preview": "\"\"\"Moment component for humanized date rendering.\"\"\"\n\nimport dataclasses\nfrom datetime import date, datetime, time, time"
},
{
"path": "reflex/components/plotly/__init__.py",
"chars": 650,
"preview": "\"\"\"Plotly components.\"\"\"\n\nfrom reflex.components.component import ComponentNamespace\n\nfrom .plotly import (\n Plotly,\n"
},
{
"path": "reflex/components/plotly/plotly.py",
"chars": 15151,
"preview": "\"\"\"Component for displaying a plotly graph.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING, An"
},
{
"path": "reflex/components/props.py",
"chars": 14972,
"preview": "\"\"\"A class that holds props to be passed or applied to a component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collect"
},
{
"path": "reflex/components/radix/__init__.py",
"chars": 474,
"preview": "\"\"\"Namespace for components provided by @radix-ui packages.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex import R"
},
{
"path": "reflex/components/radix/primitives/__init__.py",
"chars": 468,
"preview": "\"\"\"Radix primitive components (https://www.radix-ui.com/primitives).\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex"
},
{
"path": "reflex/components/radix/primitives/accordion.py",
"chars": 16165,
"preview": "\"\"\"Radix accordion components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Sequence\nfrom typing "
},
{
"path": "reflex/components/radix/primitives/base.py",
"chars": 1862,
"preview": "\"\"\"The base component for Radix primitives.\"\"\"\n\nfrom typing import Any\n\nfrom reflex.components.component import Componen"
},
{
"path": "reflex/components/radix/primitives/dialog.py",
"chars": 5358,
"preview": "\"\"\"Interactive components provided by @radix-ui/react-dialog.\"\"\"\n\nfrom typing import Any, ClassVar\n\nfrom reflex.componen"
},
{
"path": "reflex/components/radix/primitives/drawer.py",
"chars": 8830,
"preview": "\"\"\"Drawer components based on Radix primitives.\"\"\"\n\n# Based on Vaul: https://github.com/emilkowalski/vaul\n# Style based "
},
{
"path": "reflex/components/radix/primitives/form.py",
"chars": 4801,
"preview": "\"\"\"Radix form component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any, Literal\n\nfrom reflex.components"
},
{
"path": "reflex/components/radix/primitives/progress.py",
"chars": 3988,
"preview": "\"\"\"Progress.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any\n\nfrom reflex.components.component import Com"
},
{
"path": "reflex/components/radix/primitives/slider.py",
"chars": 4833,
"preview": "\"\"\"Radix slider components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Sequence\nfrom typing imp"
},
{
"path": "reflex/components/radix/themes/__init__.py",
"chars": 492,
"preview": "\"\"\"Namespace for components provided by the @radix-ui/themes library.\"\"\"\n\nfrom __future__ import annotations\n\nfrom refle"
},
{
"path": "reflex/components/radix/themes/base.py",
"chars": 8296,
"preview": "\"\"\"Base classes for radix-themes components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any, ClassVar, L"
},
{
"path": "reflex/components/radix/themes/color_mode.py",
"chars": 6513,
"preview": "\"\"\"A switch component for toggling color_mode.\n\nTo style components based on color mode, use style props with `color_mod"
},
{
"path": "reflex/components/radix/themes/components/__init__.py",
"chars": 423,
"preview": "\"\"\"Radix themes components.\"\"\"\n\nfrom __future__ import annotations\n\nfrom reflex import RADIX_THEMES_COMPONENTS_MAPPING\nf"
},
{
"path": "reflex/components/radix/themes/components/alert_dialog.py",
"chars": 3312,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component"
},
{
"path": "reflex/components/radix/themes/components/aspect_ratio.py",
"chars": 402,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom reflex.components.radix.themes.base import RadixThemesC"
},
{
"path": "reflex/components/radix/themes/components/avatar.py",
"chars": 1092,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.core.brea"
},
{
"path": "reflex/components/radix/themes/components/badge.py",
"chars": 950,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.core.brea"
},
{
"path": "reflex/components/radix/themes/components/button.py",
"chars": 1254,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.core.brea"
},
{
"path": "reflex/components/radix/themes/components/callout.py",
"chars": 2493,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nimport reflex as rx\nfrom reflex."
},
{
"path": "reflex/components/radix/themes/components/card.py",
"chars": 774,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.core.brea"
},
{
"path": "reflex/components/radix/themes/components/checkbox.py",
"chars": 4367,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component"
},
{
"path": "reflex/components/radix/themes/components/checkbox_cards.py",
"chars": 1409,
"preview": "\"\"\"Components for the Radix CheckboxCards component.\"\"\"\n\nfrom types import SimpleNamespace\nfrom typing import Literal\n\nf"
},
{
"path": "reflex/components/radix/themes/components/checkbox_group.py",
"chars": 1594,
"preview": "\"\"\"Components for the CheckboxGroup component of Radix Themes.\"\"\"\n\nfrom collections.abc import Sequence\nfrom types impor"
},
{
"path": "reflex/components/radix/themes/components/context_menu.py",
"chars": 12886,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import ClassVar, Literal\n\nfrom reflex.components"
},
{
"path": "reflex/components/radix/themes/components/data_list.py",
"chars": 1913,
"preview": "\"\"\"Components for the DataList component of Radix Themes.\"\"\"\n\nfrom types import SimpleNamespace\nfrom typing import Liter"
},
{
"path": "reflex/components/radix/themes/components/dialog.py",
"chars": 2737,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component"
},
{
"path": "reflex/components/radix/themes/components/dropdown_menu.py",
"chars": 10338,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import ClassVar, Literal\n\nfrom reflex.components"
},
{
"path": "reflex/components/radix/themes/components/hover_card.py",
"chars": 3252,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component"
},
{
"path": "reflex/components/radix/themes/components/icon_button.py",
"chars": 3151,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Liter"
},
{
"path": "reflex/components/radix/themes/components/inset.py",
"chars": 1183,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.core.brea"
},
{
"path": "reflex/components/radix/themes/components/popover.py",
"chars": 4061,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component"
},
{
"path": "reflex/components/radix/themes/components/progress.py",
"chars": 2403,
"preview": "\"\"\"Progress from Radix Themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component import Component\nfrom re"
},
{
"path": "reflex/components/radix/themes/components/radio.py",
"chars": 865,
"preview": "\"\"\"Radio component from Radix Themes.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.core.breakpoints import Res"
},
{
"path": "reflex/components/radix/themes/components/radio_cards.py",
"chars": 3080,
"preview": "\"\"\"Radio component from Radix Themes.\"\"\"\n\nfrom types import SimpleNamespace\nfrom typing import ClassVar, Literal\n\nfrom r"
},
{
"path": "reflex/components/radix/themes/components/radio_group.py",
"chars": 6916,
"preview": "\"\"\"Interactive components provided by @radix-ui/themes.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc imp"
}
]
// ... and 288 more files (download for full content)
About this extraction
This page contains the full source code of the reflex-dev/reflex GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 488 files (3.4 MB), approximately 911.3k tokens, and a symbol index with 4412 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.