<?phpnew class extends \Livewire\Component { public int $step = 1; #[\Livewire\Attributes\Computed] public function plans() { return [ ['value' => 'starter', 'name' => 'Starter', 'description' => 'Core features for small teams.', 'price' => '$15', 'discount' => null], ['value' => 'pro', 'name' => 'Pro', 'description' => 'Advanced tools and reporting.', 'price' => '$29', 'discount' => '20% off today'], ['value' => 'ultra', 'name' => 'Ultra', 'description' => 'Advanced features and support.', 'price' => '$39', 'discount' => '25% off today'], ]; } #[\Livewire\Attributes\Computed] public function addons() { return [ ['name' => 'Priority support', 'description' => 'Get help faster via email and phone', 'price' => '$3'], ['name' => 'Advanced reporting', 'description' => 'Unlock custom reports and analytics.', 'price' => '$6'], ]; } #[\Livewire\Attributes\Computed] public function countries() { return [ 'US' => 'United States', 'CA' => 'Canada', 'GB' => 'United Kingdom', 'DE' => 'Germany', 'FR' => 'France', 'AU' => 'Australia', ]; } #[\Livewire\Attributes\Computed] public function cards() { return [ ['logo' => 'visa', 'type' => 'Debit', 'last4' => '3535', 'expires' => '05/28', 'lastUsed' => true], ['logo' => 'mastercard', 'type' => 'Credit', 'last4' => '2457', 'expires' => '07/27', 'lastUsed' => false], ]; }}?><div class="min-h-dvh bg-zinc-50 px-4 py-6 sm:px-8 lg:px-20 lg:py-10 dark:bg-zinc-900"> <flux:breadcrumbs> <flux:breadcrumbs.item href="#" separator="slash">Get paid plan</flux:breadcrumbs.item> <flux:breadcrumbs.item separator="slash">Trial</flux:breadcrumbs.item> </flux:breadcrumbs> <flux:heading level="1" size="xl" class="mt-4">Start your free trial now</flux:heading> <div class="mt-8 flex flex-col items-start gap-6 lg:flex-row lg:gap-10"> <flux:card body="divided" class="w-full max-lg:order-last lg:w-96 lg:shrink-0"> <flux:card.header> <flux:card.heading size="lg">Your plan details</flux:card.heading> </flux:card.header> <flux:card.body class="space-y-4"> <div class="flex justify-between"> <flux:text>Plan</flux:text> <flux:heading>Starter</flux:heading> </div> <div class="flex justify-between"> <flux:text>Billing</flux:text> <flux:heading>Monthly</flux:heading> </div> <div class="flex justify-between"> <flux:text>Price per seat</flux:text> <flux:heading>$15</flux:heading> </div> <div class="flex justify-between"> <flux:text>Seats</flux:text> <flux:heading>1</flux:heading> </div> <flux:separator variant="subtle" /> <div class="flex justify-between"> <flux:heading>Due today</flux:heading> <flux:heading>$0</flux:heading> </div> <div class="flex justify-between"> <flux:heading>After 14-day trial</flux:heading> <flux:heading>$15<span class="font-normal text-zinc-500 dark:text-zinc-400">/mo</span></flux:heading> </div> </flux:card.body> <flux:card.footer> <flux:text size="sm">You won’t be charged until your free trial ends on <flux:text variant="strong" size="sm" inline>July 1, 2026</flux:text>.</flux:text> </flux:card.footer> </flux:card> <flux:card body="divided" class="w-full min-w-0 flex-1"> <flux:card.body class="space-y-6"> {{-- Each segment fills in as the steps are completed... --}} <div class="flex gap-1"> @foreach (range(1, 4) as $segment) <div @class([ 'h-1.5 flex-1 rounded-full', 'bg-zinc-800 dark:bg-white' => $segment <= $step, 'bg-zinc-200 dark:bg-white/10' => $segment > $step, ])></div> @endforeach </div> <div> @if ($step > 1) <flux:button wire:click="$set('step', {{ $step - 1 }})" variant="subtle" size="sm" icon="chevron-left" inset="left" class="mb-2">Back</flux:button> @endif <flux:heading level="2" size="xl"> {{ match ($step) { 1 => 'Choose your plan', 2 => 'Seats and workspace', 3 => 'Your details', 4 => 'Payment details' } }} </flux:heading> </div> @if ($step === 1) <flux:radio.group label="Billing frequency" variant="segmented"> <flux:radio value="monthly" label="Monthly" checked /> <flux:radio value="quarterly" label="Quarterly" /> <flux:radio value="yearly" label="Yearly" /> </flux:radio.group> <flux:radio.group label="Available plans" variant="cards" class="flex-col"> @foreach ($this->plans as $plan) <flux:radio :value="$plan['value']" :checked="$loop->first"> <flux:radio.indicator /> <div class="flex flex-1 justify-between gap-x-4 gap-y-2 max-sm:flex-col sm:items-center"> <div> <div class="flex items-center gap-2"> <flux:heading size="lg">{{ $plan['name'] }}</flux:heading> @if ($plan['discount']) <flux:badge size="sm" color="lime" class="max-sm:hidden">{{ $plan['discount'] }}</flux:badge> @endif </div> <flux:text class="mt-1">{{ $plan['description'] }}</flux:text> </div> <div class="flex items-baseline gap-1 whitespace-nowrap"> <flux:heading size="lg">{{ $plan['price'] }}</flux:heading> <flux:text>seat/month</flux:text> </div> </div> </flux:radio> @endforeach </flux:radio.group> <div> <flux:label badge="Optional">Add-ons</flux:label> <div class="mt-3 divide-y divide-zinc-200 rounded-lg border border-zinc-200 dark:divide-white/10 dark:border-white/10"> @foreach ($this->addons as $addon) <div class="flex items-center justify-between gap-4 px-4 py-3"> <div> <flux:heading>{{ $addon['name'] }}</flux:heading> <flux:text size="sm" class="mt-1">{{ $addon['description'] }}</flux:text> </div> <div class="flex items-center gap-6 max-sm:flex-col-reverse max-sm:items-end max-sm:gap-2"> <flux:heading class="whitespace-nowrap">{{ $addon['price'] }}<span class="font-normal text-zinc-500 dark:text-zinc-400">/seat/mo</span></flux:heading> <flux:switch :aria-label="$addon['name']" /> </div> </div> @endforeach </div> </div> <flux:field> <flux:label>Promo code</flux:label> <flux:input.group> <flux:input placeholder="Enter code" /> <flux:button>Apply</flux:button> </flux:input.group> </flux:field> @elseif ($step === 2) <flux:field> <flux:label>Seats count</flux:label> <flux:input.group class="max-w-48"> <flux:button icon="minus" aria-label="Remove a seat" /> <flux:input value="1" class:input="text-center" aria-label="Seats count" /> <flux:button icon="plus" aria-label="Add a seat" /> </flux:input.group> </flux:field> <flux:input label="Workspace name" placeholder="Workspace name" /> <flux:select variant="listbox" label="Company size" placeholder="Choose company size"> <flux:select.option>1–10 employees</flux:select.option> <flux:select.option>11–50 employees</flux:select.option> <flux:select.option>51–200 employees</flux:select.option> <flux:select.option>201–1,000 employees</flux:select.option> <flux:select.option>1,000+ employees</flux:select.option> </flux:select> <div class="space-y-3"> <div class="flex items-center justify-between"> <flux:label badge="Optional">Invite team members</flux:label> <flux:switch checked aria-label="Invite team members" /> </div> <div class="flex gap-3"> <flux:input type="email" placeholder="[email protected]" aria-label="Email address" class="flex-1" /> <flux:select variant="listbox" aria-label="Role" class="w-32"> <flux:select.option value="member" selected>Member</flux:select.option> <flux:select.option value="admin">Admin</flux:select.option> </flux:select> </div> <flux:button variant="ghost" size="sm" icon="plus" inset="left">Add member</flux:button> </div> @elseif ($step === 3) <div class="grid gap-x-4 gap-y-6 sm:grid-cols-2"> <flux:input label="Full name" placeholder="John Doe" /> <flux:input type="email" label="Work email" placeholder="[email protected]" /> <flux:select variant="listbox" label="Country"> @foreach ($this->countries as $code => $country) <flux:select.option :value="$code" :label="$country" :selected="$code === 'US'"> <div class="flex items-center gap-2"> <flux:flag :country="$code" size="xs" /> {{ $country }} </div> </flux:select.option> @endforeach </flux:select> <flux:field> <flux:label badge="Optional">Phone number</flux:label> <flux:phone country="US" placeholder="(555) 555-1234" aria-label="Phone number" /> </flux:field> <flux:input label="Job title" placeholder="Product manager" /> <flux:input label="Company name" placeholder="Acme Inc." /> <div class="sm:col-span-2"> <flux:select variant="listbox" label="Time zone"> <flux:select.option value="America/Los_Angeles">Pacific Time — UTC−08:00 / UTC−07:00</flux:select.option> <flux:select.option value="America/Denver">Mountain Time — UTC−07:00 / UTC−06:00</flux:select.option> <flux:select.option value="America/Chicago">Central Time — UTC−06:00 / UTC−05:00</flux:select.option> <flux:select.option value="America/New_York" selected>Eastern Time — UTC−05:00 / UTC−04:00</flux:select.option> <flux:select.option value="Europe/London">London — UTC+00:00 / UTC+01:00</flux:select.option> </flux:select> </div> </div> <flux:field variant="inline"> <flux:checkbox /> <flux:label>I agree to the <flux:link href="#">Terms of Service</flux:link> and <flux:link href="#">Privacy Policy</flux:link>.</flux:label> </flux:field> @else <div class="space-y-3"> <flux:label>Saved payment methods</flux:label> @foreach ($this->cards as $card) <div class="flex items-center gap-4 rounded-lg border border-zinc-200 py-1 ps-3 pe-1 dark:border-white/10"> <img src="https://fluxui.dev/img/demos/checkout/{{ $card['logo'] }}.svg" alt="" class="h-4 w-6 rounded-sm bg-white"> <div class="flex items-center gap-2"> <flux:heading class="whitespace-nowrap">{{ $card['type'] }} ···· {{ $card['last4'] }}</flux:heading> @if ($card['lastUsed']) <flux:badge size="sm" class="max-sm:hidden">Last used</flux:badge> @endif </div> <flux:text size="sm" class="flex-1 text-end whitespace-nowrap">Expires {{ $card['expires'] }}</flux:text> <flux:dropdown align="end"> <flux:button variant="ghost" size="sm" icon="ellipsis-vertical" aria-label="Card options" /> <flux:menu> <flux:menu.item icon="check">Use this card</flux:menu.item> <flux:menu.item icon="pencil-square">Edit</flux:menu.item> <flux:menu.separator /> <flux:menu.item icon="trash" variant="danger">Remove</flux:menu.item> </flux:menu> </flux:dropdown> </div> @endforeach </div> <flux:separator text="or add a new card" /> <div class="grid gap-x-4 gap-y-6 sm:grid-cols-2"> <flux:input label="Card number" placeholder="1234 1234 1234 1234" icon:trailing="credit-card" /> <div class="grid grid-cols-2 gap-4"> <flux:input label="Expiration" placeholder="MM / YY" /> <flux:input label="Security code" placeholder="CVC" icon:trailing="question-mark-circle" /> </div> <flux:input label="Name on card" placeholder="John Doe" /> <flux:input label="Billing address" placeholder="123 Main St." /> <flux:input label="City" placeholder="New York" /> <flux:input label="ZIP / Postal code" placeholder="10000" /> <flux:select variant="listbox" label="Country"> @foreach ($this->countries as $code => $country) <flux:select.option :value="$code" :label="$country" :selected="$code === 'US'"> <div class="flex items-center gap-2"> <flux:flag :country="$code" size="xs" /> {{ $country }} </div> </flux:select.option> @endforeach </flux:select> </div> <flux:checkbox label="Use this card for future payments" /> @endif @if ($step < 4) <flux:button wire:click="$set('step', {{ $step + 1 }})" variant="primary" icon:trailing="arrow-right" class="w-full">Continue</flux:button> @else <flux:button variant="primary" class="w-full">Start free trial</flux:button> @endif </flux:card.body> <flux:card.footer> <flux:heading>Need help?</flux:heading> <flux:card.actions> <flux:button variant="ghost" size="sm" icon:trailing="arrow-up-right">Contact support</flux:button> </flux:card.actions> </flux:card.footer> </flux:card> </div></div>