Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricvlt committed Sep 27, 2023
1 parent acf05c4 commit 4c7e176
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions streamlit_condition_tree/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import streamlit as st
from streamlit_condition_tree import condition_tree


config = {
'fields': {
'name': {
'label': 'Name',
'type': 'text',
},
'qty': {
'label': 'Age',
'type': 'number',
'fieldSettings': {
'min': 0
},
},
'like_tomatoes': {
'label': 'Likes tomatoes',
'type': 'boolean',
}
}
}

return_val = condition_tree(
config,
return_type='sql'
)

st.write(return_val)

0 comments on commit 4c7e176

Please sign in to comment.