diff --git a/src/python-fastui/fastui/components/__init__.py b/src/python-fastui/fastui/components/__init__.py index dfe370fc..692e57ac 100644 --- a/src/python-fastui/fastui/components/__init__.py +++ b/src/python-fastui/fastui/components/__init__.py @@ -231,30 +231,33 @@ class Custom(_p.BaseModel, extra='forbid'): type: _t.Literal['Custom'] = 'Custom' -AnyComponent = _t.Union[ - Text, - Paragraph, - PageTitle, - Div, - Page, - Heading, - Markdown, - Code, - Json, - Button, - Link, - LinkList, - Navbar, - Modal, - ServerLoad, - Image, - Iframe, - Custom, - Table, - Pagination, - Display, - Details, - Form, - FormField, - ModelForm, +AnyComponent = _te.Annotated[ + _t.Union[ + Text, + Paragraph, + PageTitle, + Div, + Page, + Heading, + Markdown, + Code, + Json, + Button, + Link, + LinkList, + Navbar, + Modal, + ServerLoad, + Image, + Iframe, + Custom, + Table, + Pagination, + Display, + Details, + Form, + FormField, + ModelForm, + ], + _p.Field(discriminator='type'), ]