Prompts
Conditionals
Conditionals allow you to create dynamic prompts that adapt based on props or other conditions.
Use the <If>
, <ElseIf>
, and <Else>
tags for conditional rendering:
example.prompt.mdx
Logical Operators
You can use standard JavaScript logical operators (&&
, ||
, !
) in your conditions:
example.prompt.mdx
Nested Conditionals
Conditionals can be nested for more complex logic:
example.prompt.mdx
Best Practices
- Keep conditions simple and readable
- Use meaningful variable names in conditions
- Consider breaking complex conditional logic into separate components
- Test different condition branches using test_settings
Have Questions?
We’re here to help! Choose the best way to reach us:
Join our Discord community for quick answers and discussions
Email us at hello@puzzlet.ai for support
Schedule an Enterprise Demo to learn about our business solutions
Was this page helpful?