Landing sections JS behaviour

FAQ section

The frequently asked questions in a single-open accordion: opening one closes the rest, and the height unfurls softly through a 0fr→1fr grid row — no jumps; the side column carries the talk-to-sales CTA and the “all questions” link closes the page.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

Frequently asked

What teams ask before they start

Six honest answers about the trial, the data and the exit. Anything else, a human in Dublin or Singapore answers within the hour.

All questions

No card, 14 full days. You get one reminder email on day 12 and nothing ever auto-charges — the workspace simply waits for you to pick a plan.

In the region you pick when signing up — Frankfurt, Dublin or Singapore — and it never leaves it. Encrypted at rest with AES-256 and in flight with TLS 1.3.

Yes. Changes are prorated to the minute and only the difference shows up on the next invoice. No restarts, no migration, no downtime.

One click: a full JSON and CSV export of every workspace, then hard deletion of everything within 30 days — confirmed by email, with the log attached.

SAML and OIDC single sign-on ships with Scale; Okta and Active Directory are first-class. SCIM user provisioning is on the roadmap for this quarter.

The Dublin and Singapore desks cover 24/7 between them. First response is under 4 hours on Growth and under 1 hour on Scale, measured — not promised.

Average first response, last 90 days: 38 minutes.

Important props

Important props
Prop Type Default What it does
open index | null null The open question’s id; clicking its own row closes it, and opening another keeps only that one open.
transition grid-rows '0fr → 1fr · 300ms' Each item’s body sits in a 0fr grid row and grows to 1fr when opened — height animation with zero JavaScript measuring.
icon rotate '0 → 45°' The + icon rotates 45° into an × as it opens; the spin rides the same curve as the height.
aside slot 'heading + CTA' The side column: the heading, a short line, the talk-to-sales button with a mail icon and the “all questions” link with an arrow.

Snippet

<section class="secfq" x-data="{ open: null }">
    <div class="secfq-side">
        <p class="secfq-eyebrow">Frequently asked</p>
        <h2>What teams ask before they start</h2>
        <button type="button" class="secfq-cta">✉ Talk to sales</button>
        <a class="secfq-all" href="#">All questions →</a>
    </div>

    <!-- single-open accordion: opening one closes the rest -->
    <div class="secfq-list">
        <div class="secfq-item" :data-open="String(open === 0)">
            <button type="button" class="secfq-q" :aria-expanded="String(open === 0)"
                x-on:click="open = open === 0 ? null : 0">
                <span>Does the trial need a credit card?</span><i class="secfq-plus" aria-hidden="true"></i>
            </button>
            <div class="secfq-a"><div class="secfq-pad"><p>No card, 14 full days. Nothing ever auto-charges.</p></div></div>
        </div>
    </div>
</section>

<style>
.secfq { display: grid; grid-template-columns: 20rem 1fr; gap: 3rem; padding: 3rem 1.5rem; }
.secfq-item { display: grid; grid-template-rows: auto 0fr;
              transition: grid-template-rows .3s cubic-bezier(.2, 0, 0, 1); }
.secfq-item[data-open='true'] { grid-template-rows: auto 1fr; }
.secfq-a { overflow: hidden; }
.secfq-plus { position: relative; inline-size: 1rem; aspect-ratio: 1; transition: rotate .3s; }
.secfq-plus::before, .secfq-plus::after { content: ''; position: absolute; inset-block-start: 50%;
    inset-inline-start: 0; inline-size: 100%; block-size: 2px; background: currentColor; }
.secfq-plus::after { rotate: 90deg; }
.secfq-item[data-open='true'] .secfq-plus { rotate: 45deg; }
@media (max-width: 720px) { .secfq { grid-template-columns: 1fr; } }
</style>
// app/Pages/Faq.jsx — Inertia (React) page; renders the React
// snippet below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import FaqSection from '@/components/FaqSection';

export default function Faq() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <main className="nx-page">
        <FaqSection />
      </main>
    </NabuXUIProvider>
  );
}
// FaqSection.jsx — single-open accordion, 0fr→1fr height animation
import { useState } from 'react';
import '@nabuxai/ui-core/css';

const FAQS = [
  { id: 'trial', q: 'Does the trial need a credit card?',
    a: 'No card, 14 full days. You get one reminder email on day 12 and nothing ever auto-charges.' },
  { id: 'data', q: 'Where does our data live?',
    a: 'In the region you pick — Frankfurt, Dublin or Singapore. Encrypted at rest with AES-256 and in flight with TLS 1.3.' },
  { id: 'plan', q: 'Can we switch plans mid-month?',
    a: 'Yes. Changes are prorated to the minute and only the difference shows up on the next invoice.' },
  { id: 'exit', q: 'What does leaving look like?',
    a: 'One click: a full JSON and CSV export of every workspace, then hard deletion within 30 days.' },
];

export default function FaqSection() {
  const [open, setOpen] = useState('trial');
  const toggle = (id) => setOpen((v) => (v === id ? null : id));

  return (
    <>
      <style>{`
        .scf { display: grid; grid-template-columns: 19rem 1fr; gap: 3rem; padding: 3rem 1.5rem;
               font: 400 .9375rem/1.6 'Inter', sans-serif; color: #1C1917; }
        .scf-eyebrow { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em;
                       text-transform: uppercase; color: #78716C; }
        .scf-side h2 { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
        .scf-cta { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem;
                   border: none; border-radius: .8rem; background: #4F46E5; color: #fff;
                   font: 600 .85rem/1 inherit; cursor: pointer; }
        .scf-all { display: inline-block; margin-block-start: 1rem; color: #4F46E5; font-weight: 600; }
        .scf-item { display: grid; grid-template-rows: auto 0fr;
                    transition: grid-template-rows .3s cubic-bezier(.2, 0, 0, 1); }
        .scf-item[data-open='true'] { grid-template-rows: auto 1fr; }
        .scf-q { display: flex; align-items: center; gap: 1rem; inline-size: 100%; padding: 1.1rem .25rem;
                 border: none; border-block-end: 1px solid #E7E5E4; background: transparent;
                 font: 650 .95rem/1.4 'Inter', sans-serif; color: inherit; cursor: pointer; text-align: start; }
        .scf-a { overflow: hidden; }
        .scf-a > div { padding: 0 .25rem 1.1rem; color: #57534E; }
        .scf-plus { flex: none; position: relative; inline-size: 1rem; aspect-ratio: 1;
                    margin-inline-start: auto; transition: rotate .3s cubic-bezier(.2, 0, 0, 1); }
        .scf-plus::before, .scf-plus::after { content: ''; position: absolute; inset-block-start: calc(50% - 1px);
                   inset-inline-start: 0; inline-size: 100%; block-size: 2px; background: currentColor; }
        .scf-plus::after { rotate: 90deg; }
        .scf-item[data-open='true'] .scf-plus { rotate: 45deg; }
        @media (max-width: 720px) { .scf { grid-template-columns: 1fr; gap: 1.5rem; } }
      `}</style>
      <section className="scf">
        <div className="scf-side">
          <p className="scf-eyebrow">Frequently asked</p>
          <h2>What teams ask before they start</h2>
          <button type="button" className="scf-cta">✉ Talk to sales</button>
          <a className="scf-all" href="#">All questions →</a>
        </div>
        <div>
          {FAQS.map((f) => (
            // data-open drives the 0fr → 1fr row transition; no height measuring.
            <div className="scf-item" data-open={open === f.id} key={f.id}>
              <button type="button" className="scf-q" aria-expanded={open === f.id} onClick={() => toggle(f.id)}>
                <span>{f.q}</span>
                <i className="scf-plus" aria-hidden="true" />
              </button>
              <div className="scf-a"><div>{f.a}</div></div>
            </div>
          ))}
        </div>
      </section>
    </>
  );
}
<!-- FaqSection.vue — single-open accordion, 0fr→1fr height animation -->
<script setup lang="ts">
import { ref } from 'vue';
import '@nabuxai/ui-core/css';

const faqs = [
  { id: 'trial', q: 'Does the trial need a credit card?',
    a: 'No card, 14 full days. You get one reminder email on day 12 and nothing ever auto-charges.' },
  { id: 'data', q: 'Where does our data live?',
    a: 'In the region you pick — Frankfurt, Dublin or Singapore. Encrypted at rest with AES-256 and in flight with TLS 1.3.' },
  { id: 'plan', q: 'Can we switch plans mid-month?',
    a: 'Yes. Changes are prorated to the minute and only the difference shows up on the next invoice.' },
  { id: 'exit', q: 'What does leaving look like?',
    a: 'One click: a full JSON and CSV export of every workspace, then hard deletion within 30 days.' },
];
const open = ref('trial');
const toggle = (id: string) => { open.value = open.value === id ? null : id; };
</script>

<template>
  <section class="scf">
    <div class="scf-side">
      <p class="scf-eyebrow">Frequently asked</p>
      <h2>What teams ask before they start</h2>
      <button type="button" class="scf-cta">✉ Talk to sales</button>
      <a class="scf-all" href="#">All questions →</a>
    </div>
    <div>
      <!-- data-open drives the 0fr → 1fr row transition; no height measuring. -->
      <div v-for="f in faqs" :key="f.id" class="scf-item" :data-open="open === f.id">
        <button type="button" class="scf-q" :aria-expanded="open === f.id" @click="toggle(f.id)">
          <span>{{ f.q }}</span>
          <i class="scf-plus" aria-hidden="true"></i>
        </button>
        <div class="scf-a"><div>{{ f.a }}</div></div>
      </div>
    </div>
  </section>
</template>

<style scoped>
.scf { display: grid; grid-template-columns: 19rem 1fr; gap: 3rem; padding: 3rem 1.5rem;
       font: 400 .9375rem/1.6 'Inter', sans-serif; color: #1C1917; }
.scf-eyebrow { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em;
               text-transform: uppercase; color: #78716C; }
.scf-side h2 { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.scf-cta { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem;
           border: none; border-radius: .8rem; background: #4F46E5; color: #fff;
           font: 600 .85rem/1 inherit; cursor: pointer; }
.scf-all { display: inline-block; margin-block-start: 1rem; color: #4F46E5; font-weight: 600; }
.scf-item { display: grid; grid-template-rows: auto 0fr;
            transition: grid-template-rows .3s cubic-bezier(.2, 0, 0, 1); }
.scf-item[data-open='true'] { grid-template-rows: auto 1fr; }
.scf-q { display: flex; align-items: center; gap: 1rem; inline-size: 100%; padding: 1.1rem .25rem;
         border: none; border-block-end: 1px solid #E7E5E4; background: transparent;
         font: 650 .95rem/1.4 'Inter', sans-serif; color: inherit; cursor: pointer; text-align: start; }
.scf-a { overflow: hidden; }
.scf-a > div { padding: 0 .25rem 1.1rem; color: #57534E; }
.scf-plus { flex: none; position: relative; inline-size: 1rem; aspect-ratio: 1;
            margin-inline-start: auto; transition: rotate .3s cubic-bezier(.2, 0, 0, 1); }
.scf-plus::before, .scf-plus::after { content: ''; position: absolute; inset-block-start: calc(50% - 1px);
           inset-inline-start: 0; inline-size: 100%; block-size: 2px; background: currentColor; }
.scf-plus::after { rotate: 90deg; }
.scf-item[data-open='true'] .scf-plus { rotate: 45deg; }
@media (max-width: 720px) { .scf { grid-template-columns: 1fr; gap: 1.5rem; } }
</style>
<!-- FaqSection.svelte — single-open accordion, 0fr→1fr height animation -->
<script lang="ts">
  import '@nabuxai/ui-core/css';

  const faqs = [
    { id: 'trial', q: 'Does the trial need a credit card?',
      a: 'No card, 14 full days. You get one reminder email on day 12 and nothing ever auto-charges.' },
    { id: 'data', q: 'Where does our data live?',
      a: 'In the region you pick — Frankfurt, Dublin or Singapore. Encrypted at rest with AES-256 and in flight with TLS 1.3.' },
    { id: 'plan', q: 'Can we switch plans mid-month?',
      a: 'Yes. Changes are prorated to the minute and only the difference shows up on the next invoice.' },
    { id: 'exit', q: 'What does leaving look like?',
      a: 'One click: a full JSON and CSV export of every workspace, then hard deletion within 30 days.' },
  ];
  let open = $state('trial');
  const toggle = (id: string) => { open = open === id ? null : id; };
</script>

<section class="scf">
  <div class="scf-side">
    <p class="scf-eyebrow">Frequently asked</p>
    <h2>What teams ask before they start</h2>
    <button type="button" class="scf-cta">✉ Talk to sales</button>
    <a class="scf-all" href="#">All questions →</a>
  </div>
  <div>
    <!-- data-open drives the 0fr → 1fr row transition; no height measuring. -->
    {#each faqs as f (f.id)}
      <div class="scf-item" data-open={open === f.id}>
        <button type="button" class="scf-q" aria-expanded={open === f.id} onclick={() => toggle(f.id)}>
          <span>{f.q}</span>
          <i class="scf-plus" aria-hidden="true"></i>
        </button>
        <div class="scf-a"><div>{f.a}</div></div>
      </div>
    {/each}
  </div>
</section>

<style>
.scf { display: grid; grid-template-columns: 19rem 1fr; gap: 3rem; padding: 3rem 1.5rem;
       font: 400 .9375rem/1.6 'Inter', sans-serif; color: #1C1917; }
.scf-eyebrow { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em;
               text-transform: uppercase; color: #78716C; }
.scf-side h2 { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.scf-cta { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem;
           border: none; border-radius: .8rem; background: #4F46E5; color: #fff;
           font: 600 .85rem/1 inherit; cursor: pointer; }
.scf-all { display: inline-block; margin-block-start: 1rem; color: #4F46E5; font-weight: 600; }
.scf-item { display: grid; grid-template-rows: auto 0fr;
            transition: grid-template-rows .3s cubic-bezier(.2, 0, 0, 1); }
.scf-item[data-open='true'] { grid-template-rows: auto 1fr; }
.scf-q { display: flex; align-items: center; gap: 1rem; inline-size: 100%; padding: 1.1rem .25rem;
         border: none; border-block-end: 1px solid #E7E5E4; background: transparent;
         font: 650 .95rem/1.4 'Inter', sans-serif; color: inherit; cursor: pointer; text-align: start; }
.scf-a { overflow: hidden; }
.scf-a > div { padding: 0 .25rem 1.1rem; color: #57534E; }
.scf-plus { flex: none; position: relative; inline-size: 1rem; aspect-ratio: 1;
            margin-inline-start: auto; transition: rotate .3s cubic-bezier(.2, 0, 0, 1); }
.scf-plus::before, .scf-plus::after { content: ''; position: absolute; inset-block-start: calc(50% - 1px);
           inset-inline-start: 0; inline-size: 100%; block-size: 2px; background: currentColor; }
.scf-plus::after { rotate: 90deg; }
.scf-item[data-open='true'] .scf-plus { rotate: 45deg; }
@media (max-width: 720px) { .scf { grid-template-columns: 1fr; gap: 1.5rem; } }
</style>