Replies: 2 comments 1 reply
-
What error do you get? I've tried the below code and it seems to work class Creatable(rx.Component):
library = "react-select"
tag = "CreatableSelect"
is_default = True
options: rx.Var[List[Dict[str, Any]]]
creatable = Creatable.create
options = [
{"value": "ocean", "label": "Ocean", "color": "#00B8D9", "isFixed": True},
{"value": "blue", "label": "Blue", "color": "#0052CC", "isDisabled": True},
{"value": "purple", "label": "Purple", "color": "#5243AA"},
]
def index():
"""The main view."""
return rx.center(
creatable(options=options),
height="100vh",
) |
Beta Was this translation helpful? Give feedback.
1 reply
-
I solved the problem by creating and publishing my own custom component. Since it is based on core Reflex components, it fits the theme perfectly. You can find it here: Dynoselect |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I am new to reflex and would like to implement a select component which allows the user to add non-existing options. Since I could not find anything like this in the core library, I am currently trying to wrap react-select. The standard
Select
component of react-select works fine. However, I cannot get theCreatable
component to work.In particular, I find configuring the imports difficult (the code below is from the most simple example):
Thus far I tried:
I have tried several variations for the
library
,tag
andis_default
attribute but nothing worked as expected.Beta Was this translation helpful? Give feedback.
All reactions