Frequently asked questions

List frequently asked questions in an accordion layout

Last modified: April 11, 2023

link Block names

t2/faq, t2/faq-item, t2/faq-item-post

link Properties (t2.json)

link

features

link

layout.icons

link Style properties

link Adding a custom action

You can add a custom actions to the FAQ block by using the beforeFaqOpen,
afterFaqOpen, beforeFaqClose or the afterFaqClose function. These function
takes a callback that will be called when the FAQ block is opens/closes. The
callback will receive the FAQ panel and trigger element as parameters.
The callback should return a promise that resolves when the close action is
complete.

Example:

window.beforeFaqClose((panel) => new Promise((resolve) => {
	const animation = panel.animate(
		[{ opacity: 1 }, { opacity: 0 }],
		{ duration: 200, easing: 'ease-in-out' },
	);

	animation.onfinish = resolve;
}));