Upgrading
This guide highlights the main changes to watch when upgrading Faststrap applications.
From v0.6.x To v0.7.x
Faststrap v0.7.x adds a major component wave, optional integrations, and a safer defaults model.
Component Defaults And UNSET
Faststrap now distinguishes omitted values from explicit None.
from faststrap import Button, set_component_defaults
set_component_defaults("Button", size="lg")
Button("Large by default")
Button("Normal size here", size=None)
When writing wrapper components, default overridable options to UNSET instead of None.
See Component Defaults.
New Components
The v0.7.x wave includes:
ResultCardAvatarandAvatarGroupStatusBadgeandBadgeGroupInlineEditorTimelineandTimelineItemStepperandStepperStepCalendarDatePickerFormWizardandWizardStepCommandPaletteandCommandItemLiveValidationFieldandValidationMessage
Optional Integrations
Optional integrations remain outside the core dependency path:
Chart.js and GSAP integrations load frontend assets from CDN by default and do not require extra Python packages. faststrap[markdown] installs the optional Python dependencies needed by the Markdown renderer. Core Fx animations remain the default lightweight motion system. GSAP is opt-in.
Pydantic Forms
Use FormBuilder.from_pydantic() for new code.
Form.from_pydantic() remains as a compatibility alias but emits a deprecation warning when called. The builder requires Pydantic v2.
Tables
Table, THead, TBody, TRow, and TCell remain the primary table API.
If your app also imports native FastHTML table primitives, optional aliases are available:
DataTable Pagination
Large DataTable paginators now render a bounded page window with ellipses instead of every page link. If you relied on every page number being present in the DOM, update that behavior.
Button Type Default
Rendered <button> elements now default to type="button" to avoid accidental form submission.
Use type="submit" explicitly for submit buttons:
Upgrade Checklist
- Run your app and inspect forms that depend on implicit submit behavior.
- Replace new code using
Form.from_pydantic()withFormBuilder.from_pydantic(). - Review custom wrapper components and use
UNSETwhere defaults should flow through. - Run
faststrap doctorto catch common setup issues. - Run your test suite and
mkdocs buildif you publish docs.