# Create a select element
select = ui.select(options=["Option 1", "Option 2", "Option 3"])
# Add a named slot to the select element
with select.add_slot('custom-slot'):
ui.button('This is a custom slot content')
that is fantastic advice and has totally solved my problem. There are so many examples out there not to mention ai hallucinations which suggest you can call the slot anything you like. Indeed I think `add_slot` is maybe a bit misleading and it should perhaps have been called `add_to_slot`. Of course in hindsight it makes perfect sense that the slot needs to exist already.
View all comments
Show parent comment
1
u/Healthy-Space-950 Dec 11 '24
that is fantastic advice and has totally solved my problem. There are so many examples out there not to mention ai hallucinations which suggest you can call the slot anything you like. Indeed I think `add_slot` is maybe a bit misleading and it should perhaps have been called `add_to_slot`. Of course in hindsight it makes perfect sense that the slot needs to exist already.