Skip to content

Beautiful Open-Source Form Builder

8.2 KB
Raw Blame
<template>
  <div class="mx-auto max-w-266">
    <div class="text-center">
      <h2
        class="text-4xl sm:text-5xl sm:leading-14 tracking-[-1%] font-semibold text-gray-950"
      >
        Feature Comparison
      </h2>
      <p
        class="mt-4 text-base font-normal tracking-[-1.1%] leading-7 text-gray-600"
      >
        Compare the features of the different plans and choose the one that best
        suits your needs.
      </p>
    </div>

    <p class="mt-4 text-center text-sm text-neutral-600">
      Prices per month, billed {{ yearly ? "annually" : "monthly" }}.
    </p>

    <div class="relative mt-12 sm:mt-16 overflow-x-auto">
      <div class="sticky top-0 z-20 bg-white">
        <table class="w-full min-w-108.75 table-fixed border-collapse">
          <colgroup>
            <col class="w-[34%]">
            <col class="w-[16.5%]">
            <col class="w-[16.5%]">
            <col class="w-[16.5%]">
            <col class="w-[16.5%]">
          </colgroup>
          <thead>
            <tr class="border-b border-neutral-200">
              <th class="bg-white py-4 pr-6 text-left text-sm font-semibold text-gray-600 shadow-[0_1px_0_0_rgba(229,229,229,1)]">
                &nbsp;
              </th>
              <th
                v-for="(plan, planIndex) in plans"
                :key="planIndex"
                class="bg-white p-6 text-center shadow-[0_1px_0_0_rgba(229,229,229,1)]"
              >
                <div class="text-xl leading-7 font-medium text-gray-950">
                  {{ plan.label }}
                </div>
                <div
                  class="mt-0.5 text-base leading-7 tracking-[-1.1%] font-medium text-gray-600"
                >
                  ({{ plan.priceLabel }})
                </div>
              </th>
            </tr>
          </thead>
        </table>
      </div>

      <table class="w-full min-w-108.75 table-fixed border-collapse">
        <colgroup>
          <col class="w-[34%]">
          <col class="w-[16.5%]">
          <col class="w-[16.5%]">
          <col class="w-[16.5%]">
          <col class="w-[16.5%]">
        </colgroup>
        <tbody>
          <template v-for="section in sections" :key="section.title">
            <tr class="bg-white border-b border-neutral-200">
              <th
                colspan="5"
                class="pt-8 pb-4 pr-6 text-left text-xl leading-7 font-medium text-gray-950"
              >
                {{ section.title }}
              </th>
            </tr>

            <tr
              v-for="(row, rowIndex) in section.rows"
              :key="rowIndex"
              class="bg-white"
            >
              <th
                class="py-5 pr-6 text-left text-sm leading-5 tracking-[-0.6%] font-medium text-gray-700"
              >
                {{ row.label }}
              </th>

              <td
                v-for="(plan, planIndex) in plans"
                :key="planIndex"
                class="py-5 px-6 text-center"
              >
                <div class="flex items-center justify-center gap-2">
                  <template v-if="row.values?.[planIndex] === true">
                    <Icon
                      class="w-5 h-5 text-emerald-600"
                      name="heroicons:check-20-solid"
                    />
                  </template>

                  <template
                    v-else-if="
                      row.values?.[planIndex] === false ||
                      row.values?.[planIndex] == null
                    "
                  >
                    <span class="text-sm font-medium text-gray-300">—</span>
                  </template>

                  <template v-else-if="row.values?.[planIndex] === 'soon'">
                    <Icon
                      title="Coming soon..."
                      class="w-5 h-5 text-amber-500"
                      name="heroicons:clock-20-solid"
                    />
                  </template>

                  <template v-else>
                    <span class="text-sm font-medium text-gray-700">
                      {{ row.values?.[planIndex] }}
                    </span>
                  </template>
                </div>
              </td>
            </tr>
          </template>
        </tbody>
      </table>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  yearly: {
    type: Boolean,
    default: true,
  },
})

const { getPlanPrice, getTierDisplayName } = useBillingUpsell()

const formatPlanPrice = (plan) => {
  const price = getPlanPrice(plan, props.yearly)
  if (price == null) return null
  return price === 0 ? "$0" : `$${Math.round(price)}/mo`
}

const plans = computed(() => [
  {
    key: "free",
    label: getTierDisplayName("free"),
    priceLabel: formatPlanPrice("free"),
  },
  {
    key: "pro",
    label: getTierDisplayName("pro"),
    priceLabel: formatPlanPrice("pro"),
  },
  {
    key: "business",
    label: getTierDisplayName("business"),
    priceLabel: formatPlanPrice("business"),
  },
  {
    key: "enterprise",
    label: getTierDisplayName("enterprise"),
    priceLabel: formatPlanPrice("enterprise"),
  },
])

const sections = [
  {
    title: "Core Form Capabilities",
    rows: [
      {
        label: "Unlimited forms & submissions",
        values: [true, true, true, true],
      },
      {
        label: "File uploads",
        values: ["10MB", "50MB", "1GB", "(configurable)"],
      },
      {
        label: "Form logic & validation",
        values: [true, true, true, true],
      },
      {
        label: "Computed fields (calculations)",
        values: [true, true, true, true],
      },
      {
        label: "Pre-fills, URL params",
        values: [true, true, true, true],
      },
    ],
  },
  {
    title: "Collaboration",
    rows: [
      {
        label: "Multi-user access",
        values: [
          "(all admins)",
          "(all admins)",
          "(roles & permissions)",
          "(roles + SSO)",
        ],
      },
      {
        label: "Workspaces",
        values: ["1", "Unlimited", "Unlimited", "Unlimited"],
      },
    ],
  },
  {
    title: "Branding",
    rows: [
      {
        label: "Branding removal",
        values: [false, true, true, true],
      },
      {
        label: "Custom domain",
        values: [false, true, true, true],
      },
      {
        label: "Custom SEO, link previews & favicon",
        values: [false, true, true, true],
      },
      {
        label: "Advanced branding (CSS/fonts)",
        values: [false, false, true, true],
      },
      {
        label: "White-label hosting",
        values: [false, false, false, true],
      },
    ],
  },
  {
    title: "Delivery",
    rows: [
      {
        label: "Custom SMTP",
        values: [false, true, true, true],
      },
    ],
  },
  {
    title: "Security & Access Control",
    rows: [
      {
        label: "Security (password/IP/expiry)",
        values: [false, true, true, true],
      },
      {
        label: "Advanced SSO (SAML/LDAP)",
        values: [false, false, false, true],
      },
    ],
  },
  {
    title: "Integrations",
    rows: [
      {
        label: "Basic integrations (Email, Webhook, Zapier, Google Sheets)",
        values: [true, true, true, true],
      },
      {
        label: "Slack, Discord, Telegram notifications",
        values: [false, true, true, true],
      },
      {
        label: "Advanced integrations (HubSpot, Salesforce, Airtable)",
        values: [false, false, true, true],
      },
    ],
  },
  {
    title: "Data & Insights",
    rows: [
      {
        label: "Analytics dashboard",
        values: [false, true, true, true],
      },
      {
        label: "Partial submissions / draft saving",
        values: [false, false, true, true],
      },
    ],
  },
  {
    title: "Compliance",
    rows: [
      {
        label: "Audit logs & compliance",
        values: [false, false, false, true],
      },
      {
        label: "External storage (S3, GCS)",
        values: [false, false, false, true],
      },
    ],
  },
  {
    title: "Support & Services",
    rows: [
      {
        label: "Priority support",
        values: [false, false, true, "(SLA)"],
      },
      {
        label: "SLA & onboarding",
        values: [false, false, false, true],
      },
    ],
  },
]
</script>