├── .prettierignore ├── src ├── python-fastui │ ├── fastui │ │ ├── py.typed │ │ ├── components │ │ │ ├── py.typed │ │ │ ├── tables.py │ │ │ ├── display.py │ │ │ └── forms.py │ │ ├── base.py │ │ ├── auth │ │ │ ├── __init__.py │ │ │ └── shared.py │ │ ├── class_name.py │ │ ├── __main__.py │ │ ├── events.py │ │ ├── dev.py │ │ ├── __init__.py │ │ ├── types.py │ │ └── generate_typescript.py │ ├── requirements │ │ ├── lint.in │ │ ├── all.txt │ │ ├── test.in │ │ ├── render.txt │ │ ├── lint.txt │ │ ├── pyproject.txt │ │ └── test.txt │ ├── README.md │ ├── tests │ │ ├── test_dev.py │ │ ├── test_prebuilt_html.py │ │ ├── test_auth_shared.py │ │ ├── test_json_schema.py │ │ ├── test_components.py │ │ └── test_tables_display.py │ ├── LICENSE │ └── pyproject.toml ├── npm-fastui-prebuilt │ ├── src │ │ ├── vite-env.d.ts │ │ ├── main.tsx │ │ ├── App.tsx │ │ └── main.scss │ ├── README.md │ ├── typedoc.json │ ├── tsconfig.node.json │ ├── tsconfig.json │ ├── index.html │ ├── package.json │ ├── LICENSE │ └── vite.config.ts ├── npm-fastui │ ├── README.md │ ├── src │ │ ├── components │ │ │ ├── Code.tsx │ │ │ ├── Markdown.tsx │ │ │ ├── text.tsx │ │ │ ├── PageTitle.tsx │ │ │ ├── paragraph.tsx │ │ │ ├── Iframe.tsx │ │ │ ├── div.tsx │ │ │ ├── button.tsx │ │ │ ├── LinkList.tsx │ │ │ ├── spinner.tsx │ │ │ ├── video.tsx │ │ │ ├── FireEvent.tsx │ │ │ ├── Json.tsx │ │ │ ├── error.tsx │ │ │ ├── modal.tsx │ │ │ ├── toast.tsx │ │ │ ├── footer.tsx │ │ │ ├── image.tsx │ │ │ ├── CodeLazy.tsx │ │ │ ├── Custom.tsx │ │ │ ├── pagination.tsx │ │ │ ├── heading.tsx │ │ │ ├── navbar.tsx │ │ │ ├── link.tsx │ │ │ ├── details.tsx │ │ │ ├── table.tsx │ │ │ ├── MarkdownLazy.tsx │ │ │ ├── form.tsx │ │ │ ├── ServerLoad.tsx │ │ │ └── index.tsx │ │ ├── Defaults.tsx │ │ ├── hooks │ │ │ ├── config.ts │ │ │ ├── eventContext.tsx │ │ │ ├── error.tsx │ │ │ ├── className.ts │ │ │ └── locationContext.tsx │ │ ├── controller.tsx │ │ ├── index.tsx │ │ ├── dev.tsx │ │ └── events.ts │ ├── tsconfig.json │ ├── typedoc.json │ ├── package.json │ └── LICENSE └── npm-fastui-bootstrap │ ├── README.md │ ├── typedoc.json │ ├── tsconfig.json │ ├── src │ ├── footer.tsx │ ├── modal.tsx │ ├── toast.tsx │ ├── navbar.tsx │ ├── pagination.tsx │ └── index.tsx │ ├── package.json │ └── LICENSE ├── screenshot.png ├── docs ├── guide.md ├── assets │ ├── favicon.png │ └── logo-white.svg ├── extra │ └── tweaks.css ├── api │ ├── typescript_components.md │ └── python_components.md └── plugins.py ├── typedoc.base.json ├── typedoc.json ├── requirements ├── docs.in └── docs.txt ├── .gitignore ├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── tsconfig.json ├── demo ├── README.md ├── auth_user.py ├── __init__.py ├── shared.py ├── main.py ├── tests.py ├── tables.py ├── auth.py └── forms.py ├── pyproject.toml ├── LICENSE ├── .eslintrc.cjs ├── .pre-commit-config.yaml ├── package.json ├── Makefile ├── bump_npm.py └── mkdocs.yml /.prettierignore: -------------------------------------------------------------------------------- 1 | htmlcov/ 2 | -------------------------------------------------------------------------------- /src/python-fastui/fastui/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/python-fastui/fastui/components/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/python-fastui/requirements/lint.in: -------------------------------------------------------------------------------- 1 | ruff 2 | pyright 3 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pydantic/FastUI/HEAD/screenshot.png -------------------------------------------------------------------------------- /src/npm-fastui-prebuilt/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /docs/guide.md: -------------------------------------------------------------------------------- 1 | !!! warning "🚧 Work in Progress" 2 | This page is a work in progress. 3 | -------------------------------------------------------------------------------- /docs/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pydantic/FastUI/HEAD/docs/assets/favicon.png -------------------------------------------------------------------------------- /src/npm-fastui/README.md: -------------------------------------------------------------------------------- 1 | # FastUI 2 | 3 | React frontend for [FastUI](https://github.com/pydantic/FastUI). 4 | -------------------------------------------------------------------------------- /typedoc.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "includeVersion": true 4 | } 5 | -------------------------------------------------------------------------------- /src/npm-fastui-prebuilt/README.md: -------------------------------------------------------------------------------- 1 | # FastUI pre-build 2 | 3 | Pre-built files for [FastUI](https://github.com/pydantic/FastUI). 4 | -------------------------------------------------------------------------------- /src/python-fastui/requirements/all.txt: -------------------------------------------------------------------------------- 1 | -r ./lint.txt 2 | -r ./test.txt 3 | -r ./pyproject.txt 4 | uvicorn[standard] 5 | httpx 6 | -------------------------------------------------------------------------------- /src/npm-fastui-bootstrap/README.md: -------------------------------------------------------------------------------- 1 | # FastUI Bootstrap 2 | 3 | Bootstrap components for [FastUI](https://github.com/pydantic/FastUI). 4 | -------------------------------------------------------------------------------- /src/npm-fastui/src/components/Code.tsx: -------------------------------------------------------------------------------- 1 | import { lazy } from 'react' 2 | 3 | export const CodeComp = lazy(() => import('./CodeLazy')) 4 | -------------------------------------------------------------------------------- /src/python-fastui/requirements/test.in: -------------------------------------------------------------------------------- 1 | coverage 2 | pytest 3 | pytest-pretty 4 | dirty-equals 5 | pytest-asyncio 6 | httpx 7 | PyJWT 8 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["./typedoc.base.json"], 3 | "entryPointStrategy": "packages", 4 | "entryPoints": ["./src/*"] 5 | } 6 | -------------------------------------------------------------------------------- /requirements/docs.in: -------------------------------------------------------------------------------- 1 | mkdocs 2 | mkdocs-material 3 | mkdocs-simple-hooks 4 | mkdocstrings[python] 5 | mkdocs-redirects 6 | mkdocs-material-extensions 7 | -------------------------------------------------------------------------------- /src/npm-fastui/src/components/Markdown.tsx: -------------------------------------------------------------------------------- 1 | import { lazy } from 'react' 2 | 3 | export const MarkdownComp = lazy(() => import('./MarkdownLazy')) 4 | -------------------------------------------------------------------------------- /src/npm-fastui-bootstrap/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../typedoc.base.json"], 3 | "entryPointStrategy": "expand", 4 | "entryPoints": ["src"] 5 | } 6 | -------------------------------------------------------------------------------- /src/npm-fastui-prebuilt/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../typedoc.base.json"], 3 | "entryPointStrategy": "expand", 4 | "entryPoints": ["src"] 5 | } 6 | -------------------------------------------------------------------------------- /src/npm-fastui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist" 5 | }, 6 | "include": ["src"] 7 | } 8 | -------------------------------------------------------------------------------- /src/python-fastui/requirements/render.txt: -------------------------------------------------------------------------------- 1 | # this is used by render to install dependencies 2 | -r ./pyproject.txt 3 | src/python-fastui 4 | uvicorn[standard] 5 | httpx 6 | PyJWT 7 | -------------------------------------------------------------------------------- /src/npm-fastui/src/components/text.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react' 2 | 3 | import type { Text } from '../models' 4 | 5 | export const TextComp: FC = ({ text }) => <>{text} 6 | -------------------------------------------------------------------------------- /docs/extra/tweaks.css: -------------------------------------------------------------------------------- 1 | /* Revert hue value to that of pre mkdocs-material v9.4.0 */ 2 | [data-md-color-scheme='slate'] { 3 | --md-hue: 230; 4 | --md-default-bg-color: hsla(230, 15%, 21%, 1); 5 | } 6 | -------------------------------------------------------------------------------- /src/npm-fastui-bootstrap/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "paths": { 6 | "fastui": ["../npm-fastui/src"] 7 | } 8 | }, 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /src/npm-fastui-prebuilt/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /src/python-fastui/fastui/base.py: -------------------------------------------------------------------------------- 1 | from pydantic import AliasGenerator, ConfigDict 2 | from pydantic import BaseModel as _BaseModel 3 | from pydantic.alias_generators import to_camel 4 | 5 | 6 | class BaseModel(_BaseModel): 7 | model_config = ConfigDict(alias_generator=AliasGenerator(serialization_alias=to_camel)) 8 | -------------------------------------------------------------------------------- /src/npm-fastui-prebuilt/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | 4 | import App from './App' 5 | import './main.scss' 6 | 7 | ReactDOM.createRoot(document.getElementById('root')!).render( 8 | 9 | 10 | , 11 | ) 12 | -------------------------------------------------------------------------------- /src/npm-fastui/src/components/PageTitle.tsx: -------------------------------------------------------------------------------- 1 | import { FC, useEffect } from 'react' 2 | 3 | import type { PageTitle } from '../models' 4 | 5 | export const PageTitleComp: FC = (props) => { 6 | const { text } = props 7 | 8 | useEffect(() => { 9 | document.title = text 10 | }, [text]) 11 | 12 | return <> 13 | } 14 | -------------------------------------------------------------------------------- /src/npm-fastui-prebuilt/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "paths": { 5 | "fastui": ["../npm-fastui/src"], 6 | "fastui-bootstrap": ["../npm-fastui-bootstrap/src"] 7 | } 8 | }, 9 | "include": ["src"], 10 | "references": [{ "path": "./tsconfig.node.json" }] 11 | } 12 | -------------------------------------------------------------------------------- /docs/api/typescript_components.md: -------------------------------------------------------------------------------- 1 | # TypeScript Components 2 | 3 | !!! warning "🚧 Work in Progress" 4 | This page is a work in progress. 5 | 6 | 8 | 10 | -------------------------------------------------------------------------------- /src/npm-fastui/src/Defaults.tsx: -------------------------------------------------------------------------------- 1 | import { FC, ReactNode } from 'react' 2 | 3 | export const DefaultNotFound: FC<{ url: string }> = ({ url }) =>
Page not found: {url}
4 | 5 | // default here does nothing 6 | export const DefaultTransition: FC<{ children: ReactNode; transitioning: boolean }> = ({ children }) => ( 7 |
{children}
8 | ) 9 | -------------------------------------------------------------------------------- /src/npm-fastui/src/components/paragraph.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react' 2 | 3 | import type { Paragraph } from '../models' 4 | 5 | import { useClassName } from '../hooks/className' 6 | 7 | export const ParagraphComp: FC = (props) => { 8 | const { text } = props 9 | 10 | return

{text}

11 | } 12 | -------------------------------------------------------------------------------- /src/npm-fastui/src/components/Iframe.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react' 2 | 3 | import type { Iframe } from '../models' 4 | 5 | export const IframeComp: FC