🌊
jsf
  • About KalmiaJSF
  • Setup
  • Architecture
  • Contributing
  • Changelog
  • Guides
    • Cheat Sheet
  • Examples
    • Demo example
    • Basic examples
    • Kitchen Sink example
    • Charts example
  • Schema
    • Intro to Schema
    • Prop types
      • String
      • Boolean
      • Number & Integer
      • Object
      • Array
      • Date
      • Id
      • Null
      • Ref
      • Binary
    • Prop options
      • Disabling property
      • On prop init actions
      • Persist
      • On value change
      • On user value change
    • Handlers
      • Color picker
    • Creating custom handler
      • Working with arrays
    • Value provider
  • Validation
    • Custom validation
    • Eval
  • LAYOUT
    • Intro to Layout
    • Layout options
      • Show & hide
      • On click action
  • INTERFACES
    • Value Options
  • Form
    • Form data
  • OTHER
    • Events
    • Lifecycle hooks
    • Notifications support
  • PAGES & COMPONENTS
    • Page
    • Component
  • THEMING
    • Creating new theme variant
  • BUILDER
    • Shortcuts
  • Help
    • FAQ
Powered by GitBook
On this page
  • Interface
  • Example

Was this helpful?

Export as PDF
  1. LAYOUT
  2. Layout options

Show & hide

With visibleIf keyword, you can conditionally hide portions of the form.

Interface

Option

Type

$eval

string

Your JS code to determine if layout should be displayed. Code must return true or false. Do not forget to return value!

dependencies

string[]

If your code depends on changes of other properties in schema, list them here.

Example

Example showing image only if showImage checkbox is checked.

{
  "schema": {
    "type": "object",
    "properties": { "showImage": { "type": "boolean" } }
  },
  "layout": {
    "type": "div",
    "items": [
      { "type": "image", "src": "http://example.org/image.png",
        "visibleIf": {
          "$eval": "return $val.showImage == true",
          "dependencies": [  "showImage" ]
        }
      }
    ]
  }
}

PreviousLayout optionsNextOn click action

Last updated 4 years ago

Was this helpful?