Learning Paths
Faststrap serves several kinds of Python developer. The same component library can support a polished product interface, a data-heavy internal tool, or an ML workflow without forcing every project to adopt the same visual or JavaScript layer.
Beginners: Build A First App
Follow this order when FastHTML and Faststrap are both new:
- Read Installation and Quick Start.
- Learn the render model and asset lifecycle in the Architecture Guide.
- Start with Button, Card, Input, and Grid.
- Add server-driven behavior with HTMX Integration and the preset overview.
- Add validation, accessibility, and deployment only as the app needs them.
The recommended first application shape is intentionally small:
from fasthtml.common import FastHTML
from faststrap import Button, Card, Container, add_bootstrap
app = FastHTML()
add_bootstrap(app)
@app.get("/")
def home():
return Container(
Card("Your first Faststrap page", footer=Button("Continue")),
)
Frontend And Product Developers
Use the Component Index to choose a composable primitive before writing custom markup. A practical route is:
NavbarorSidebarNavbarfor application navigation.PageHeader,Stack,Cluster, andCenterfor page composition.FormGroup,FormBuilder,DataTable, andFilterBarfor workflows.Toast,ModernToast,Modal, andErrorDialogfor feedback.theme_variant_css()and Theming for brand identity.- Custom Components when a reusable surface is genuinely missing.
Use HTMX presets before adding custom JavaScript for search, polling, lazy loading, loading states, confirmation, and server responses. Use an integration when the browser or a third-party library is the actual source of complexity.
Data Science Developers
Faststrap is useful when Python already owns the data and workflow logic, but the result still needs a real routed web interface:
DataTablefor searchable, sortable, paginated records; use server-side mode for large datasets.MetricCard,TrendCard,KPICard,DataCard, andRecordDetailfor experiment and operational summaries.Chart,Figure,MapView,Markdown,Math,Mermaid, andJsonViewerfor outputs and explanations.FilterBar,DateRangePicker,MultiSelect,RangeSlider, andExportButtonfor exploration controls.PollUntil,AutoRefresh,SSETarget, andSSEStreamfor jobs, progress, and live feeds.
The core remains dependency-conscious. Optional renderers and browser libraries should be installed only when the project needs them; consult each component page for dependency and security boundaries.
ML And AI Application Developers
Start with the data-tool path, then add explicit workflow surfaces:
TrainingProgress,LiveMetric, and roadmap components are planned rather than current core APIs; do not import them until they appear in a release.- Today, compose
Progress,MetricCard,DataTable,CodeBlock,JsonViewer,ResultCard,NotificationCenter, andSSETargetfor training or inference workflows. - Use the Component Registry to let tooling discover available UI primitives instead of guessing component names.
- Keep agent-facing actions explicit in application routes. Faststrap's registry describes UI components; it is not an authorization system or a substitute for route validation.
Senior Developers And Maintainers
Read these in order when you need predictable extension and release behavior:
- Architecture for the FastHTML-to-HTML render and asset model.
- Component Defaults for
UNSET, process-global configuration, and reset behavior. - Custom Components for registration, attribute conversion, and class composition.
- Registry API for metadata and AI/tooling discovery.
- Performance, Security, and Testing before deployment.
- Upgrading and
CHANGELOG.mdwhen moving between releases.
Coverage And Stability
The Component Index is the complete registered UI inventory for the current source tree. Individual pages explain public behavior; generated API blocks expose exact signatures. Stability markers in source and the Stability Policy indicate how much compatibility protection an API receives.
Documentation examples are copy-ready, but they are not authorization, database, or deployment policies. Test route behavior, permissions, responsive rendering, and browser interactions in the application that consumes Faststrap.