idyll-langidyll
DocsTutorialsGalleryEditor
menu

Overview

  • Introduction
  • Getting started
  • Markup syntax
  • HTML tags
  • Options and styles
  • Plugin system
  • Multipage template

Interactivity

  • Built-in components
  • Using components from npm
  • Make your own component
  • Scrolling and Refs

Publishing

  • Deploying to the web
  • Embedding Idyll

Useful Links

  • Github
  • Chat
  • Twitter
  • Support Us
← Back

Conditional

Content inside of an aside component will be displayed in the margin of your document. The conditional component will only display its children when a condition is met:

Input:

[var name:"showChart" value:false /]

[Button onClick:`showChart = !showChart`]
  [Display value:`showChart ? 'Hide Chart' : 'Show Chart' ` /]
[/Button]

[Conditional if:`showChart`]
  [Chart /]
[/Conditional]

Output:

Props

  • if expression

    An expression; if this evaluates to true, the children will be rendered, otherwise nothing will be drawn to the screen

    • Example: `true`