CustomElement
class allows you to render a custom .jsx
snippet. The .jsx
file should be placed in public/elements/ELEMENT_NAME.jsx
.
.jsx
extension)..jsx
for you!jsx
file for your Chainlit custom element, follow these instructions.
.jsx
file should export default one component like:
props
are globally injected (not as a function argument). NEVER pass them as function argument.
div
with a primary color background and round border:
react
sonner
zod
recoil
react-hook-form
lucide-react
@/components/ui/accordion
@/components/ui/aspect-ratio
@/components/ui/avatar
@/components/ui/badge
@/components/ui/button
@/components/ui/card
@/components/ui/carousel
@/components/ui/checkbox
@/components/ui/command
@/components/ui/dialog
@/components/ui/dropdown-menu
@/components/ui/form
@/components/ui/hover-card
@/components/ui/input
@/components/ui/label
@/components/ui/pagination
@/components/ui/popover
@/components/ui/progress
@/components/ui/scroll-area
@/components/ui/separator
@/components/ui/select
@/components/ui/sheet
@/components/ui/skeleton
@/components/ui/switch
@/components/ui/table
@/components/ui/textarea
@/components/ui/tooltip
@/components/ui
imports are from Shadcn.chainlit run app.py
and send a first message in the UI.
The LinearTicket custom element rendered.
.update()
on it.
cl.CopilotFunction
.