PricingPlans
A responsive group of plans, side by side or stacked.
Examples
Billing cycle switch
The prices are .NET state: the switch is disabled until the page is interactive.
Starter
For side projects and small teams.
$0/month
- 3 projects
- Community support
- 1 GB storage
Pro
Most popularFor growing teams that ship every week.
$29/month
Billed monthly, cancel anytime.
- Unlimited projects
- Priority support
- 100 GB storage
- Audit log
Team
For organizations with compliance needs.
$99/month
- Everything in Pro
- Single sign-on
- Dedicated manager
- 1 TB storage
Razor
<div class="flex w-full flex-col items-center gap-8">
@* The prices are .NET state, so the switch works once the page is interactive and stays disabled until then. *@
<KlyToggleGroup Items="Cycles" AriaLabel="Billing cycle" Value="@(_yearly ? YearlyValue : MonthlyValue)" ValueChanged="Pick" Disabled="@(!RendererInfo.IsInteractive)" />
<KlyPricingPlans>
<KlyPricingPlan Title="Starter" Description="For side projects and small teams." Price="@Price(0, 0)" BillingCycle="@Cycle"
Features="@(["3 projects", "Community support", "1 GB storage"])" ButtonLabel="Start for free" ButtonHref="/docs" />
<KlyPricingPlan Title="Pro" Badge="Most popular" Description="For growing teams that ship every week." Highlight Scale
Price="@Price(29, 24)" BillingCycle="@Cycle" Terms="@(_yearly ? "Billed yearly, 2 months free." : "Billed monthly, cancel anytime.")"
Features="@(["Unlimited projects", "Priority support", "100 GB storage", "Audit log"])" ButtonLabel="Get Pro" ButtonHref="/docs" />
<KlyPricingPlan Title="Team" Description="For organizations with compliance needs." Price="@Price(99, 79)" BillingCycle="@Cycle"
Features="@(["Everything in Pro", "Single sign-on", "Dedicated manager", "1 TB storage"])" ButtonLabel="Contact sales" ButtonHref="/docs" />
</KlyPricingPlans>
</div>
@code {
private bool _yearly;
private string Cycle => _yearly ? "/month, billed yearly" : "/month";
private static readonly string[] MonthlyValue = ["monthly"];
private static readonly string[] YearlyValue = ["yearly"];
private static readonly KlyToggleItem[] Cycles = [new("monthly", "Monthly"), new("yearly", "Yearly")];
private string Price(int monthly, int yearly) => $"${(_yearly ? yearly : monthly)}";
private void Pick(IReadOnlyList<string>? value) => _yearly = value?.Contains("yearly") == true;
}Stacked
Pro
PopularFor teams that ship every week.
$29/month
- Unlimited projects
- Priority support
- 100 GB storage
Razor
<KlyPricingPlans Orientation="KlyOrientation.Vertical" Class="max-w-4xl">
<KlyPricingPlan Title="Hobby" Orientation="KlyOrientation.Horizontal" Description="Everything you need to try it out." Price="$0" BillingCycle="/month"
Features="@(["3 projects", "Community support"])" ButtonLabel="Start for free" ButtonHref="/docs" />
<KlyPricingPlan Title="Pro" Orientation="KlyOrientation.Horizontal" Badge="Popular" Highlight Description="For teams that ship every week." Price="$29" BillingCycle="/month"
Features="@(["Unlimited projects", "Priority support", "100 GB storage"])" ButtonLabel="Get Pro" ButtonHref="/docs" />
</KlyPricingPlans>API
KlyPricingPlans
Responsive grid of KlyPricingPlan cards.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Orientation |
KlyOrientation |
KlyOrientation. |
Horizontal places the plans next to each other in a responsive grid, vertical stacks them in one column. Values: Horizontal, Vertical. |
Ui |
PricingPlansUi |
Per-instance class overrides of the slots of the pricing plans, see PricingPlansUi . They are merged after the theme and the Class parameter wins on the root slot. |
Slots
| Name | Type | Description |
|---|---|---|
ChildContent |
RenderFragment |
The KlyPricingPlan cards. |
Ui slots
Ui takes a PricingPlansUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyPricingPlans , after the theme and the app configuration. |