Pricing
PricingTier and PricingGroup create common SaaS pricing sections with responsive cards.
Quick Start
from faststrap import PricingGroup, PricingTier
PricingGroup(
PricingTier("Starter", 19, features=["3 projects", "Email support"]),
PricingTier(
"Pro",
49,
features=["Unlimited projects", "Priority support"],
highlighted=True,
),
title="Choose your plan",
subtitle="Start small and scale when you need more.",
)
Parameters
PricingTier
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
str |
required | Tier name. |
price |
str \| int |
required | Price display value. |
period |
str |
"month" |
Billing period label. |
features |
list[str] \| None |
None |
Feature bullet list. |
button_text |
str |
"Get Started" |
CTA button text. |
button_href |
str |
"#" |
CTA link. |
highlighted |
bool |
False |
Adds stronger border/shadow and solid CTA. |
**kwargs |
Any |
Extra card attributes. |
PricingGroup
| Parameter | Type | Default | Description |
|---|---|---|---|
*tiers |
Any |
Pricing tier elements. | |
title |
str |
"Choose Your Plan" |
Section heading. |
subtitle |
str \| None |
None |
Optional section copy. |
header_cls / title_cls / subtitle_cls |
str \| None |
None |
Header styling hooks. |
row_cls / col_cls |
str \| None |
None |
Layout styling hooks. |
header_attrs / title_attrs / subtitle_attrs |
dict \| None |
None |
Extra header attributes. |
row_attrs / col_attrs |
dict \| None |
None |
Extra grid attributes. |
**kwargs |
Any |
Extra root attributes. |
API Reference
faststrap.components.patterns.pricing.PricingTier(name, price, period='month', features=None, button_text='Get Started', button_href='#', highlighted=False, **kwargs)
A single pricing tier card.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Tier name (e.g., "Pro", "Enterprise") |
required |
price
|
str | int
|
Price amount |
required |
period
|
str
|
Billing period (e.g., "month", "year") |
'month'
|
features
|
list[str] | None
|
List of feature strings |
None
|
button_text
|
str
|
CTA button text |
'Get Started'
|
button_href
|
str
|
CTA button link |
'#'
|
highlighted
|
bool
|
Whether to highlight this tier |
False
|
**kwargs
|
Any
|
Additional attributes |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
Card component with pricing content |
Note
Marked as @beta - API may change in future releases.
Source code in src/faststrap/components/patterns/pricing.py
faststrap.components.patterns.pricing.PricingGroup(*tiers, title='Choose Your Plan', subtitle=None, header_cls=None, title_cls=None, subtitle_cls=None, row_cls=None, col_cls=None, header_attrs=None, title_attrs=None, subtitle_attrs=None, row_attrs=None, col_attrs=None, **kwargs)
Group of pricing tiers in a responsive grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*tiers
|
Any
|
PricingTier components |
()
|
title
|
str
|
Section title |
'Choose Your Plan'
|
subtitle
|
str | None
|
Optional subtitle |
None
|
header_cls
|
str | None
|
Additional classes for the section header |
None
|
title_cls
|
str | None
|
Additional classes for the title element |
None
|
subtitle_cls
|
str | None
|
Additional classes for the subtitle element |
None
|
row_cls
|
str | None
|
Additional classes for the row wrapper |
None
|
col_cls
|
str | None
|
Additional classes for each column wrapper |
None
|
header_attrs
|
dict[str, Any] | None
|
Extra attributes for the section header |
None
|
title_attrs
|
dict[str, Any] | None
|
Extra attributes for the title element |
None
|
subtitle_attrs
|
dict[str, Any] | None
|
Extra attributes for the subtitle element |
None
|
row_attrs
|
dict[str, Any] | None
|
Extra attributes for the row wrapper |
None
|
col_attrs
|
dict[str, Any] | None
|
Extra attributes for each column wrapper |
None
|
**kwargs
|
Any
|
Additional attributes |
{}
|
Returns:
| Type | Description |
|---|---|
Div
|
Div with pricing tiers in grid |
Note
Marked as @beta - API may change in future releases.
Source code in src/faststrap/components/patterns/pricing.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |