class Billing(ClientState):
period: str = field(default="yearly")
def billing_period() -> None:
period = Billing().period
yearly = period == "yearly"
with ui.card(padding="md", classes="w-full max-w-sm"), ui.vstack(gap="md"):
ui.heading("Team plan", level=3, size="md")
with ui.radio_group(value=period, direction="row"):
ui.radio("monthly", label="Monthly")
ui.radio("yearly", label="Yearly")
with ui.hstack(gap="sm", align="end"):
ui.heading("€" + yearly.then_else(PRICES["yearly"], PRICES["monthly"]),
level=3, size="3xl")
ui.text("per seat / month", color="muted")
ui.badge("You save €60 per seat each year", color="success",
variant="soft", visible=yearly)
ui.badge("Cancel any time", color="secondary", variant="soft",
visible=~yearly)
ui.button("Start free trial", classes="w-full")