Performance
Non testeNon teste
Conversation ThreadMITCarteGodUI
Composant React Carte par Lucas Bassetti. Repris sans modification depuis GodUI sous licence MIT et présenté ici en direct.
Rapport qualite
La note et le score proviennent de contrôles automatiques lancés à la compilation ou aux tests. Si un contrôle n'a pas été exécuté, il est indiqué Non testé — aucun chiffre n'est inventé.
Non teste
Non teste
Non teste
Non teste
Les chiffres viennent d'un script automatique, pas d'exemples ecrits a la main.
Affiché à taille réelle.
La copie commence par la notice de licence. Gardez-la lorsque vous utilisez le code.
<div id="root"></div>:root{--bg:#f6f4f0;--ink:#17181a;--background:40 20% 96%;--foreground:24 10% 8%;--card:0 0% 100%}html,body{min-height:100%;margin:0;background:var(--bg);color:var(--ink)}html,body{height:100%;overflow:hidden}body{display:grid;place-items:center}#root{display:grid;place-items:center;max-width:100%;max-height:100%;box-sizing:border-box;padding:16px;color:hsl(var(--foreground))}#root.full{width:100%;height:100%;padding:0}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-play-state:paused!important;transition-duration:0s!important}}
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--radius-2xl:1rem;--shadow-2xs:var(--shadow-2xs);--shadow-xs:var(--shadow-xs);--shadow-sm:var(--shadow-sm);--shadow-md:var(--shadow-md);--shadow-lg:var(--shadow-lg);--shadow-xl:var(--shadow-xl);--shadow-2xl:var(--shadow-2xl);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow:var(--shadow)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.z-popover{z-index:var(--z-popover)}.z-raised{z-index:var(--z-raised)}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.h-8{height:calc(var(--spacing) * 8)}.h-\[1\.05em\]{height:1.05em}.h-\[460px\]{height:460px}.h-full{height:100%}.min-h-dvh{min-height:100dvh}.w-\[2px\]{width:2px}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[12rem\]{max-width:12rem}.max-w-\[80\%\]{max-width:80%}.min-w-0{min-width:0}.min-w-40{min-width:calc(var(--spacing) * 40)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-bottom{transform-origin:bottom}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-px{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-br-md{border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-bl-md{border-bottom-left-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-border{border-color:var(--border)}.border-ring{border-color:var(--ring)}.border-transparent{border-color:#0000}.bg-background{background-color:var(--background)}.bg-card\/80{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/80{background-color:color-mix(in oklab, var(--card) 80%, transparent)}}.bg-current{background-color:currentColor}.bg-muted,.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/40{background-color:color-mix(in oklab, var(--muted) 40%, transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-transparent{background-color:#0000}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pr-1{padding-right:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.whitespace-pre-wrap{white-space:pre-wrap}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.opacity-0{opacity:0}.shadow-2xs{--tw-shadow:var(--shadow-2xs);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:var(--shadow-lg);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:var(--shadow-sm);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ring\/40{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ring-ring\/40{--tw-ring-color:color-mix(in oklab, var(--ring) 40%, transparent)}}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[box-shadow\,border-color\]{transition-property:box-shadow,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,opacity\,background-color\]{transition-property:transform,opacity,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){:is(:where(.group\/msg):hover .group-hover\/msg\:opacity-100){opacity:1}}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.focus-within\:border-ring:focus-within{border-color:var(--ring)}.focus-within\:shadow-md:focus-within{--tw-shadow:var(--shadow-md);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\:shadow-sm:focus-within{--tw-shadow:var(--shadow-sm);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-foreground:hover{color:var(--foreground)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-muted:disabled{background-color:var(--muted)}.disabled\:text-muted-foreground:disabled{color:var(--muted-foreground)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (prefers-reduced-motion:reduce){.motion-reduce\:animate-none{animation:none}}}:root,.light,:root[data-theme=light]{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--font-sans:var(--font-geist-sans,"Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif);--font-serif:var(--font-geist-sans,"Geist", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif);--font-mono:var(--font-geist-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);--radius:.625rem;--shadow-2xs:0 1px 2px #00000005;--shadow-xs:0 1px 3px #0000000a;--shadow-sm:0 2px 6px #0000000d;--shadow:0 4px 12px #0000000f;--shadow-md:0 8px 20px #00000014;--shadow-lg:0 16px 32px #0000001a;--shadow-xl:0 24px 48px #0000001f;--shadow-2xl:0 40px 80px #00000029;--syntax-plain:oklch(20% .036 266);--syntax-punctuation:oklch(54% .022 266);--syntax-keyword:oklch(52% .19 302);--syntax-property:oklch(56% .11 90);--syntax-string:oklch(52% .106 168);--syntax-comment:oklch(63% .016 266);--syntax-number:oklch(54% .115 235);--inline-code-bg:var(--muted);--inline-code-fg:var(--foreground);--inline-code-border:var(--border);--code-block:oklch(97.8% 0 0);--code-block-foreground:oklch(20.5% 0 0);--code-block-border:oklch(92.2% 0 0);--search-bg:var(--card);--search-fg:var(--muted-foreground);--search-border:var(--border);--search-kbd-bg:var(--muted);--search-kbd-fg:var(--muted-foreground);--search-placeholder:var(--muted-foreground);--search-highlight-bg:var(--primary);--search-highlight-fg:var(--primary-foreground);--theme-panel-bg:var(--card);--theme-panel-border:var(--border);--theme-panel-fg:var(--muted-foreground);--theme-panel-active-bg:var(--muted);--theme-panel-active-fg:var(--foreground);--z-base:0;--z-raised:10;--z-overlay:20;--z-sticky:30;--z-popover:40;--z-modal:50;--z-toast:60;--color-bg:var(--background);--color-fg:var(--foreground);--color-border:var(--border);--color-primary:var(--primary);--color-primary-fg:var(--primary-foreground);--color-secondary-bg:var(--secondary);--color-secondary-fg:var(--secondary-foreground);--color-destructive:var(--destructive);--color-destructive-fg:oklch(100% 0 0);--glow-highlight:61, 102, 223;--color-primary-rgb:61, 102, 223;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--god-gradient:linear-gradient(135deg, oklch(55% .19 266) 0%, oklch(100% 0 0) 50%, oklch(85% .12 90) 100%);--god-glow:0 0 24px oklch(55% .19 266/.14), 0 0 80px oklch(85% .12 90/.06);--rainbow-1:oklch(55% .19 266);--rainbow-2:oklch(68% .16 305);--rainbow-3:oklch(82% .1 185);--rainbow-4:oklch(78% .12 14);--rainbow-5:oklch(80% .13 90);--rainbow-speed:2s}@media (color-gamut:p3){:root,.light{--syntax-string:oklch(52% .13 168);--syntax-number:oklch(54% .13 235)}}@media (prefers-color-scheme:dark){:root:not(.light){--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--syntax-plain:oklch(93.5% .01 266);--syntax-punctuation:oklch(65% .02 266);--syntax-keyword:oklch(78% .135 302);--syntax-property:oklch(83% .12 90);--syntax-string:oklch(80% .13 168);--syntax-comment:oklch(58% .02 266);--syntax-number:oklch(80% .12 224);--code-block:oklch(18.5% 0 0);--code-block-foreground:oklch(98.5% 0 0);--code-block-border:oklch(27% 0 0);--inline-code-bg:var(--muted);--inline-code-fg:var(--foreground);--inline-code-border:var(--border);--search-bg:var(--card);--search-fg:var(--muted-foreground);--search-border:var(--border);--search-kbd-bg:var(--muted);--search-kbd-fg:var(--muted-foreground);--search-placeholder:var(--muted-foreground);--search-highlight-bg:var(--primary);--search-highlight-fg:var(--primary-foreground);--theme-panel-bg:var(--card);--theme-panel-border:var(--border);--theme-panel-fg:var(--muted-foreground);--theme-panel-active-bg:var(--muted);--theme-panel-active-fg:var(--foreground);--shadow-2xs:0 1px 2px #0000001f;--shadow-xs:0 1px 3px #00000026;--shadow-sm:0 2px 6px #0003;--shadow:0 4px 12px #00000040;--shadow-md:0 8px 20px #0000004d;--shadow-lg:0 16px 32px #00000059;--shadow-xl:0 24px 48px #0006;--shadow-2xl:0 40px 80px #00000080;--color-bg:var(--background);--color-fg:var(--foreground);--color-border:var(--border);--color-primary:var(--primary);--color-primary-fg:var(--primary-foreground);--color-secondary-bg:var(--secondary);--color-secondary-fg:var(--secondary-foreground);--color-destructive:var(--destructive);--color-destructive-fg:oklch(100% 0 0);--glow-highlight:66, 108, 229;--color-primary-rgb:66, 108, 229;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--god-gradient:linear-gradient(135deg, oklch(57% .19 266) 0%, oklch(100% 0 0) 50%, oklch(86% .12 90) 100%);--god-glow:0 0 24px oklch(57% .19 266/.28), 0 0 80px oklch(86% .12 90/.12);--rainbow-1:oklch(72% .145 266);--rainbow-2:oklch(74% .16 305);--rainbow-3:oklch(84% .1 185);--rainbow-4:oklch(80% .116 14);--rainbow-5:oklch(84% .13 90);--rainbow-speed:2s}}:root[data-theme=dark],.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--syntax-plain:oklch(93.5% .01 266);--syntax-punctuation:oklch(65% .02 266);--syntax-keyword:oklch(78% .135 302);--syntax-property:oklch(83% .12 90);--syntax-string:oklch(80% .13 168);--syntax-comment:oklch(58% .02 266);--syntax-number:oklch(80% .12 224);--code-block:oklch(18.5% 0 0);--code-block-foreground:oklch(98.5% 0 0);--code-block-border:oklch(27% 0 0);--inline-code-bg:var(--muted);--inline-code-fg:var(--foreground);--inline-code-border:var(--border);--search-bg:var(--card);--search-fg:var(--muted-foreground);--search-border:var(--border);--search-kbd-bg:var(--muted);--search-kbd-fg:var(--muted-foreground);--search-placeholder:var(--muted-foreground);--search-highlight-bg:var(--primary);--search-highlight-fg:var(--primary-foreground);--theme-panel-bg:var(--card);--theme-panel-border:var(--border);--theme-panel-fg:var(--muted-foreground);--theme-panel-active-bg:var(--muted);--theme-panel-active-fg:var(--foreground);--shadow-2xs:0 1px 2px #0000001f;--shadow-xs:0 1px 3px #00000026;--shadow-sm:0 2px 6px #0003;--shadow:0 4px 12px #00000040;--shadow-md:0 8px 20px #0000004d;--shadow-lg:0 16px 32px #00000059;--shadow-xl:0 24px 48px #0006;--shadow-2xl:0 40px 80px #00000080;--color-bg:var(--background);--color-fg:var(--foreground);--color-border:var(--border);--color-primary:var(--primary);--color-primary-fg:var(--primary-foreground);--color-secondary-bg:var(--secondary);--color-secondary-fg:var(--secondary-foreground);--color-destructive:var(--destructive);--color-destructive-fg:oklch(100% 0 0);--glow-highlight:66, 108, 229;--color-primary-rgb:66, 108, 229;--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--god-gradient:linear-gradient(135deg, oklch(57% .19 266) 0%, oklch(100% 0 0) 50%, oklch(86% .12 90) 100%);--god-glow:0 0 24px oklch(57% .19 266/.28), 0 0 80px oklch(86% .12 90/.12);--rainbow-1:oklch(72% .145 266);--rainbow-2:oklch(74% .16 305);--rainbow-3:oklch(84% .1 185);--rainbow-4:oklch(80% .116 14);--rainbow-5:oklch(84% .13 90);--rainbow-speed:2s}@media (color-gamut:p3){@media (prefers-color-scheme:dark){:root:not(.light){--syntax-keyword:oklch(78% .14 302);--rainbow-1:oklch(72% .15 266);--rainbow-4:oklch(80% .12 14)}}.dark{--syntax-keyword:oklch(78% .14 302);--rainbow-1:oklch(72% .15 266);--rainbow-4:oklch(80% .12 14)}}@keyframes magic-rainbow{0%{background-position:0%}to{background-position:200%}}@keyframes magic-input-indeterminate{0%{background-position:110%}to{background-position:-10%}}@keyframes magic-input-sweep{0%{background-size:0% 100%}to{background-size:100% 100%}}@keyframes magic-input-spin{to{transform:rotate(360deg)}}@keyframes shimmer-slide{to{transform:translate(calc(100cqw - 100%))}}@keyframes spin-around{0%{transform:translateZ(0)rotate(0)}15%,35%{transform:translateZ(0)rotate(90deg)}65%,85%{transform:translateZ(0)rotate(270deg)}to{transform:translateZ(0)rotate(360deg)}}@keyframes progress-fold-indeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}@keyframes mask-button-in{0%{-webkit-mask-position:0 0;mask-position:0 0}to{-webkit-mask-position:100% 0;mask-position:100% 0}}@keyframes mask-button-out{0%{-webkit-mask-position:100% 0;mask-position:100% 0}to{-webkit-mask-position:0 0;mask-position:0 0}}@keyframes aurora-text{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}@keyframes marquee{0%{transform:translate(0)}to{transform:translateX(calc(-100% - var(--gap)))}}@keyframes marquee-vertical{0%{transform:translateY(0)}to{transform:translateY(calc(-100% - var(--gap)))}}@keyframes split-flap-fall{0%{transform:rotateX(0)}to{transform:rotateX(-90deg)}}@keyframes split-flap-rise{0%{transform:rotateX(90deg)}to{transform:rotateX(0)}}@keyframes blueprint-sweep{0%{transform:translate(-50%, -50%) rotate(var(--blueprint-angle,25deg));opacity:0}15%,85%{opacity:1}to{transform:translate(150%, 150%) rotate(var(--blueprint-angle,25deg));opacity:0}}@keyframes light-rays-sweep{0%{transform:rotate(calc(var(--rays-angle,0deg) - 6deg)) scale(1);opacity:calc(var(--rays-intensity,.6) * .7)}to{transform:rotate(calc(var(--rays-angle,0deg) + 6deg)) scale(1.08);opacity:var(--rays-intensity,.6)}}@keyframes voice-orb-spin{to{transform:rotate(360deg)}}@keyframes voice-orb-breathe{0%,to{transform:scale(1)}50%{transform:scale(1.04)}}@keyframes voice-orb-ring{0%{opacity:.6;transform:scale(.85)}to{opacity:0;transform:scale(1.4)}}@keyframes app-showcase-scroll{0%{transform:translateY(0)}to{transform:translateY(-50%)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes pulse{50%{opacity:.5}}// godui source (MIT). npm i @tabler/icons-react motion react · Tailwind CSS v4
// ── conversation-thread/conversation-thread.tsx (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/conversation-thread/conversation-thread.tsx)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
"use client";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
import * as React from "react";
export type ConversationVariant = "bubbles" | "document" | "compact";
export type MessageRole = "user" | "assistant" | "system";
type ThreadContextValue = { variant: ConversationVariant };
const ThreadContext = React.createContext<ThreadContextValue>({
variant: "bubbles",
});
export type ConversationThreadProps = React.HTMLAttributes<HTMLDivElement> & {
variant?: ConversationVariant;
/** Auto-stick to the newest message unless the user scrolls up. */
autoScroll?: boolean;
};
const THREAD_BASE =
"relative flex h-full flex-col gap-4 overflow-y-auto px-4 py-4";
const ConversationThread = React.forwardRef<
HTMLDivElement,
ConversationThreadProps
>(
(
{
variant = "bubbles",
autoScroll = true,
className,
children,
onScroll,
...props
},
forwardedRef,
) => {
const ref = React.useRef<HTMLDivElement>(null);
const contentRef = React.useRef<HTMLDivElement>(null);
React.useImperativeHandle(
forwardedRef,
() => ref.current as HTMLDivElement,
);
const [pinned, setPinned] = React.useState(true);
// Ref mirror so ResizeObserver / effects never read a stale `pinned`.
const pinnedRef = React.useRef(true);
const setPinnedBoth = React.useCallback((next: boolean) => {
pinnedRef.current = next;
setPinned(next);
}, []);
const scrollToBottom = React.useCallback((behavior: ScrollBehavior) => {
const el = ref.current;
if (!el) return;
// `instant` keeps streaming growth glued without fighting layout;
// `smooth` is reserved for the intentional Jump-to-latest click.
if (typeof el.scrollTo === "function") {
el.scrollTo({ top: el.scrollHeight, behavior });
} else {
el.scrollTop = el.scrollHeight;
}
}, []);
// Stick to the bottom when a new message mounts.
const childCount = React.Children.count(children);
// biome-ignore lint/correctness/useExhaustiveDependencies: re-pin when a message is added
React.useEffect(() => {
if (autoScroll && pinnedRef.current) scrollToBottom("instant");
}, [childCount, autoScroll, scrollToBottom]);
// Stick through *content* growth too (StreamingText ticks, wrapping) —
// childCount alone misses that. Observe the inner stack, not the scroll
// port: ResizeObserver on an overflow container does not fire when only
// scrollHeight grows.
React.useEffect(() => {
if (!autoScroll) return;
const content = contentRef.current;
if (!content || typeof ResizeObserver === "undefined") return;
const ro = new ResizeObserver(() => {
if (pinnedRef.current) scrollToBottom("instant");
});
ro.observe(content);
return () => ro.disconnect();
}, [autoScroll, scrollToBottom]);
return (
<ThreadContext.Provider value={{ variant }}>
<div
ref={ref}
data-slot="conversation-thread"
data-variant={variant}
className={`${THREAD_BASE} ${className ?? ""}`}
onScroll={(e) => {
const el = e.currentTarget;
const atBottom =
el.scrollHeight - el.scrollTop - el.clientHeight < 48;
setPinnedBoth(atBottom);
onScroll?.(e);
}}
{...props}
>
<div ref={contentRef} className="flex flex-col gap-4">
{children}
</div>
<AnimatePresence>
{!pinned ? (
<motion.button
type="button"
initial={{ opacity: 0, y: 8, scale: 0.9 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
exit={{ opacity: 0, y: 8, scale: 0.9 }}
transition={{
type: "spring",
stiffness: 320,
damping: 32,
mass: 0.9,
}}
onClick={() => {
setPinnedBoth(true);
scrollToBottom("smooth");
}}
className="sticky bottom-2 left-1/2 z-raised inline-flex -translate-x-1/2 items-center gap-1.5 self-center rounded-full border border-border bg-popover px-3 py-1.5 text-xs font-medium text-foreground shadow-lg"
>
Jump to latest
<ArrowDownIcon className="size-3.5" />
</motion.button>
) : null}
</AnimatePresence>
</div>
</ThreadContext.Provider>
);
},
);
ConversationThread.displayName = "ConversationThread";
export type MessageAction = {
label: string;
icon: React.ReactNode;
onClick?: () => void;
};
export type ConversationMessageProps = React.HTMLAttributes<HTMLDivElement> & {
role: MessageRole;
name?: string;
avatar?: React.ReactNode;
timestamp?: string;
/** Hover actions (copy, regenerate, …) revealed on hover. */
actions?: MessageAction[];
/** Shows a blinking caret at the end while tokens stream in. */
streaming?: boolean;
};
const BUBBLE_BY_ROLE: Record<MessageRole, string> = {
user: "bg-primary text-primary-foreground",
assistant: "bg-muted text-foreground",
system: "bg-transparent text-muted-foreground italic",
};
const ConversationMessage = React.forwardRef<
HTMLDivElement,
ConversationMessageProps
>(
(
{
role,
name,
avatar,
timestamp,
actions,
streaming = false,
className,
children,
...props
},
ref,
) => {
const { variant } = React.useContext(ThreadContext);
const reduce = useReducedMotion();
const isUser = role === "user";
const isDocument = variant === "document";
const isCompact = variant === "compact";
// No `layout` prop: streaming text grows the bubble every tick, and a
// layout animation on every message turns that growth into visible jumps
// (siblings re-measure and tween). Opacity-only enter is enough.
return (
<motion.div
ref={ref}
initial={reduce ? false : { opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
transition={{ type: "spring", stiffness: 320, damping: 32, mass: 0.9 }}
data-slot="conversation-message"
data-role={role}
className={`group/msg flex gap-3 ${isUser && !isDocument ? "flex-row-reverse" : ""} ${isCompact ? "gap-2" : ""} ${className ?? ""}`}
{...(props as React.ComponentProps<typeof motion.div>)}
>
{avatar ? (
<div className="mt-0.5 size-7 shrink-0 overflow-hidden rounded-full bg-muted text-xs">
{avatar}
</div>
) : null}
<div
className={`flex min-w-0 flex-col gap-1 ${isUser && !isDocument ? "items-end" : "items-start"} ${isDocument ? "w-full" : "max-w-[80%]"}`}
>
{(name || timestamp) && !isCompact ? (
<div className="flex items-center gap-2 px-1 text-xs text-muted-foreground">
{name ? (
<span className="font-medium text-foreground">{name}</span>
) : null}
{timestamp ? (
<span className="tabular-nums">{timestamp}</span>
) : null}
</div>
) : null}
<div
className={
isDocument
? "w-full text-sm leading-7 text-foreground"
: `rounded-2xl px-3.5 py-2 text-sm leading-6 shadow-2xs ${BUBBLE_BY_ROLE[role]} ${isUser ? "rounded-br-md" : "rounded-bl-md"}`
}
>
<span className="[overflow-wrap:anywhere] whitespace-pre-wrap">
{children}
{streaming ? (
<span className="ml-0.5 inline-block h-[1.05em] w-[2px] -translate-y-px animate-pulse bg-current align-middle motion-reduce:animate-none" />
) : null}
</span>
</div>
{actions && actions.length > 0 ? (
<div
className={`flex gap-0.5 px-1 opacity-0 transition-opacity group-hover/msg:opacity-100 ${isUser && !isDocument ? "flex-row-reverse" : ""}`}
>
{actions.map((action) => (
<button
key={action.label}
type="button"
aria-label={action.label}
onClick={action.onClick}
className="inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
{action.icon}
</button>
))}
</div>
) : null}
</div>
</motion.div>
);
},
);
ConversationMessage.displayName = "ConversationMessage";
export type StreamingTextProps = {
/** Full text to reveal token-by-token. */
text: string;
/** Characters revealed per tick; non-finite values use 1, and finite values are floored and clamped to 1. */
chunk?: number;
/** Milliseconds between ticks; non-finite values and values below 1 use a 1 ms minimum. */
speed?: number;
/** Fired once the full text is revealed. */
onDone?: () => void;
};
const MIN_STREAMING_TEXT_CHUNK = 1;
const MIN_STREAMING_TEXT_SPEED = 1;
function normalizeStreamingTextChunk(value: number) {
return Number.isFinite(value)
? Math.max(MIN_STREAMING_TEXT_CHUNK, Math.floor(value))
: MIN_STREAMING_TEXT_CHUNK;
}
function normalizeStreamingTextSpeed(value: number) {
return Number.isFinite(value)
? Math.max(MIN_STREAMING_TEXT_SPEED, value)
: MIN_STREAMING_TEXT_SPEED;
}
/**
* Reveals `text` progressively. Honors reduced-motion by showing it instantly;
* empty text calls `onDone` without scheduling a timer.
*/
function StreamingText({
text,
chunk = 2,
speed = 24,
onDone,
}: StreamingTextProps) {
const reduce = useReducedMotion();
const [count, setCount] = React.useState(reduce ? text.length : 0);
const normalizedChunk = normalizeStreamingTextChunk(chunk);
const normalizedSpeed = normalizeStreamingTextSpeed(speed);
React.useEffect(() => {
if (reduce) {
setCount(text.length);
onDone?.();
return;
}
setCount(0);
if (text.length === 0) {
onDone?.();
return;
}
let current = 0;
const id = setInterval(() => {
current = Math.min(current + normalizedChunk, text.length);
setCount(current);
if (current >= text.length) {
clearInterval(id);
onDone?.();
}
}, normalizedSpeed);
return () => clearInterval(id);
}, [text, normalizedChunk, normalizedSpeed, reduce, onDone]);
return <>{text.slice(0, count)}</>;
}
type IconProps = { className?: string };
function ArrowDownIcon({ className }: IconProps) {
return (
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2.2}
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden="true"
>
<path d="M12 5v14M19 12l-7 7-7-7" />
</svg>
);
}
export { ConversationMessage, ConversationThread, StreamingText };
// ── conversation-thread/index.ts (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/conversation-thread/index.ts)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
export {
ConversationMessage,
type ConversationMessageProps,
ConversationThread,
type ConversationThreadProps,
type ConversationVariant,
type MessageAction,
type MessageRole,
StreamingText,
type StreamingTextProps,
} from "./conversation-thread";
// ── demos/conversation-thread-demo.tsx (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/demos/conversation-thread-demo.tsx)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
// biome-ignore-all lint/a11y/useValidAriaRole: "role" is a chat-message domain prop, not an ARIA role
"use client";
import { ConversationMessage } from "../conversation-thread";
import { ConversationThread } from "../conversation-thread";
import { PromptComposer } from "../prompt-composer";
import { StreamingText } from "../conversation-thread";
import { IconCopy as Copy, IconRotate as RotateCcw, IconThumbUp as ThumbsUp } from "@tabler/icons-react";
import { useState } from "react";
type Msg = {
id: number;
role: "user" | "assistant";
text: string;
streaming?: boolean;
};
const ANSWERS = [
"Center it with a grid parent: `grid place-items-center`. One line, no flex juggling.",
"Sure. Wrap your content and add `min-h-dvh` so it centers in the viewport.",
"Use `place-items-center` on a grid, or `items-center justify-center` on a flex row.",
];
export function ConversationThreadDemo() {
const [messages, setMessages] = useState<Msg[]>([
{ id: 1, role: "user", text: "How do I center a div in 2026?" },
{
id: 2,
role: "assistant",
text: "Use a grid parent with `place-items-center`. It centers on both axes in a single declaration.",
},
]);
const actions = (text: string) => [
{
label: "Copy",
icon: <Copy className="size-4" />,
onClick: () => navigator.clipboard?.writeText(text),
},
{ label: "Regenerate", icon: <RotateCcw className="size-4" /> },
{ label: "Helpful", icon: <ThumbsUp className="size-4" /> },
];
const send = (value: string) => {
const id = Date.now();
const answer = ANSWERS[Math.floor(Math.random() * ANSWERS.length)];
setMessages((prev) => [
...prev,
{ id, role: "user", text: value },
{ id: id + 1, role: "assistant", text: answer, streaming: true },
]);
};
return (
<div className="mx-auto flex h-[460px] w-full max-w-2xl flex-col overflow-hidden rounded-2xl border border-border bg-background">
<div className="flex-1 overflow-hidden">
<ConversationThread>
{messages.map((m) =>
m.role === "assistant" ? (
<ConversationMessage
key={m.id}
role="assistant"
name="Component library"
actions={actions(m.text)}
streaming={m.streaming}
>
{m.streaming ? (
<StreamingText
text={m.text}
onDone={() =>
setMessages((prev) =>
prev.map((x) =>
x.id === m.id ? { ...x, streaming: false } : x,
),
)
}
/>
) : (
m.text
)}
</ConversationMessage>
) : (
<ConversationMessage key={m.id} role="user" name="You">
{m.text}
</ConversationMessage>
),
)}
</ConversationThread>
</div>
<div className="border-t border-border p-3">
<PromptComposer variant="compact" placeholder="Reply…" onSend={send} />
</div>
</div>
);
}
// ── prompt-composer/index.ts (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/prompt-composer/index.ts)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
export {
type PromptAttachment,
PromptComposer,
type PromptComposerProps,
type PromptComposerVariant,
} from "./prompt-composer";
// ── prompt-composer/prompt-composer.tsx (https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/prompt-composer/prompt-composer.tsx)
/*
MIT License
Copyright (c) 2026 Lucas Bassetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
canvas-confetti (ISC) was replaced with an original MIT helper by Incidental AI.
Sample photographs and brand marks were replaced with Incidental AI assets. Credit GodUI / Lucas Bassetti as attribution only; the name is not used for marketing.
*/
"use client";
import { AnimatePresence, motion } from "motion/react";
import * as React from "react";
export type PromptComposerVariant = "comfortable" | "compact" | "minimal";
export type PromptAttachment = {
/** Stable id for the attachment. */
id: string;
/** File name shown on the chip. */
name: string;
/** Optional byte size, rendered as a human label. */
size?: number;
};
export type PromptComposerProps = Omit<
React.FormHTMLAttributes<HTMLFormElement>,
"onSubmit"
> & {
/** Controlled textarea value. */
value?: string;
/** Uncontrolled initial value. */
defaultValue?: string;
/** Fired on every keystroke. */
onValueChange?: (value: string) => void;
/** Fired on submit (⌘/Ctrl+Enter or send button) with the text + attachments. */
onSend?: (value: string, attachments: PromptAttachment[]) => void;
/** When streaming, the send button morphs into a stop button. */
isStreaming?: boolean;
/** Fired when the stop button is pressed while streaming. */
onStop?: () => void;
placeholder?: string;
variant?: PromptComposerVariant;
/** Visual density of the textarea (max rows before scroll). */
maxRows?: number;
disabled?: boolean;
/** Controlled attachments. Omit for internal drag/drop + paste handling. */
attachments?: PromptAttachment[];
onAttachmentsChange?: (attachments: PromptAttachment[]) => void;
/** Available models for the inline picker. Hidden when omitted. */
models?: string[];
model?: string;
onModelChange?: (model: string) => void;
};
const PANEL_BASE =
"group/composer relative flex w-full flex-col gap-2 rounded-2xl border border-border bg-card/80 p-2.5 shadow-sm backdrop-blur-md transition-[box-shadow,border-color] focus-within:border-ring focus-within:shadow-md";
const variantPanel: Record<PromptComposerVariant, string> = {
comfortable: "",
compact: "gap-1.5 p-2",
minimal: "border-transparent bg-muted/40 shadow-none focus-within:shadow-sm",
};
const TEXTAREA_BASE =
"w-full resize-none bg-transparent px-2 pt-1.5 text-sm leading-6 text-foreground placeholder:text-muted-foreground focus:outline-none disabled:opacity-50";
const ICON_BUTTON =
"inline-flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40";
function formatBytes(bytes?: number): string | null {
if (bytes == null) return null;
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}
const PromptComposer = React.forwardRef<HTMLFormElement, PromptComposerProps>(
(
{
value,
defaultValue = "",
onValueChange,
onSend,
isStreaming = false,
onStop,
placeholder = "Ask anything…",
variant = "comfortable",
maxRows = 8,
disabled = false,
attachments,
onAttachmentsChange,
models,
model,
onModelChange,
className,
...props
},
ref,
) => {
const isControlled = value !== undefined;
const [internalValue, setInternalValue] = React.useState(defaultValue);
const text = isControlled ? value : internalValue;
const attachControlled = attachments !== undefined;
const [internalAttachments, setInternalAttachments] = React.useState<
PromptAttachment[]
>([]);
const chips = attachControlled ? attachments : internalAttachments;
const [dragging, setDragging] = React.useState(false);
const textareaRef = React.useRef<HTMLTextAreaElement>(null);
const setText = (next: string) => {
if (!isControlled) setInternalValue(next);
onValueChange?.(next);
};
const setChips = (next: PromptAttachment[]) => {
if (!attachControlled) setInternalAttachments(next);
onAttachmentsChange?.(next);
};
// Auto-grow the textarea up to maxRows.
// biome-ignore lint/correctness/useExhaustiveDependencies: re-measure on value change
React.useLayoutEffect(() => {
const el = textareaRef.current;
if (!el) return;
el.style.height = "auto";
const lineHeight = 24;
const max = lineHeight * maxRows;
el.style.height = `${Math.min(el.scrollHeight, max)}px`;
el.style.overflowY = el.scrollHeight > max ? "auto" : "hidden";
}, [text, maxRows]);
const canSend = text.trim().length > 0 || chips.length > 0;
const submit = () => {
if (isStreaming) {
onStop?.();
return;
}
if (!canSend || disabled) return;
onSend?.(text, chips);
setText("");
setChips([]);
};
const filesToAttachments = (files: FileList): PromptAttachment[] =>
Array.from(files).map((file) => ({
id: `${file.name}-${file.size}-${crypto.randomUUID?.() ?? Math.random()}`,
name: file.name,
size: file.size,
}));
return (
<form
ref={ref}
data-slot="prompt-composer"
data-variant={variant}
data-streaming={isStreaming ? "" : undefined}
data-dragging={dragging ? "" : undefined}
className={`${PANEL_BASE} ${variantPanel[variant]} ${dragging ? "border-ring ring-2 ring-ring/40" : ""} ${className ?? ""}`}
onSubmit={(e) => {
e.preventDefault();
submit();
}}
onDragOver={(e) => {
e.preventDefault();
if (!dragging) setDragging(true);
}}
onDragLeave={(e) => {
if (e.currentTarget.contains(e.relatedTarget as Node)) return;
setDragging(false);
}}
onDrop={(e) => {
e.preventDefault();
setDragging(false);
if (e.dataTransfer.files.length) {
setChips([...chips, ...filesToAttachments(e.dataTransfer.files)]);
}
}}
{...props}
>
<AnimatePresence initial={false}>
{chips.length > 0 ? (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: "auto" }}
exit={{ opacity: 0, height: 0 }}
className="flex flex-wrap gap-1.5 overflow-hidden px-1"
>
<AnimatePresence initial={false}>
{chips.map((chip) => (
<motion.span
key={chip.id}
layout
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.8 }}
transition={{ type: "spring", stiffness: 520, damping: 32 }}
className="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background py-1 pl-2 pr-1 text-xs text-foreground shadow-2xs"
>
<PaperclipIcon className="size-3 text-muted-foreground" />
<span className="max-w-[12rem] truncate">{chip.name}</span>
{formatBytes(chip.size) ? (
<span className="text-muted-foreground tabular-nums">
{formatBytes(chip.size)}
</span>
) : null}
<button
type="button"
aria-label={`Remove ${chip.name}`}
className="inline-flex size-4 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
onClick={() =>
setChips(chips.filter((c) => c.id !== chip.id))
}
>
<CloseIcon className="size-3" />
</button>
</motion.span>
))}
</AnimatePresence>
</motion.div>
) : null}
</AnimatePresence>
<textarea
ref={textareaRef}
rows={1}
value={text}
disabled={disabled}
placeholder={placeholder}
aria-label="Prompt"
className={TEXTAREA_BASE}
onChange={(e) => setText(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
e.preventDefault();
submit();
}
}}
onPaste={(e) => {
if (e.clipboardData.files.length) {
setChips([
...chips,
...filesToAttachments(e.clipboardData.files),
]);
}
}}
/>
<div className="flex items-center justify-between gap-2 px-1">
<div className="flex items-center gap-0.5">
<label className={ICON_BUTTON} aria-label="Attach files">
<PaperclipIcon className="size-4" />
<input
type="file"
multiple
className="sr-only"
disabled={disabled}
onChange={(e) => {
if (e.target.files?.length) {
setChips([...chips, ...filesToAttachments(e.target.files)]);
e.target.value = "";
}
}}
/>
</label>
{models && models.length > 0 ? (
<ModelPicker
models={models}
model={model ?? models[0]}
onModelChange={onModelChange}
/>
) : null}
</div>
<div className="flex items-center gap-2">
{text.length > 0 ? (
<span className="text-xs tabular-nums text-muted-foreground">
{text.length}
</span>
) : null}
<button
type={isStreaming ? "button" : "submit"}
disabled={!isStreaming && (!canSend || disabled)}
aria-label={isStreaming ? "Stop generating" : "Send message"}
onClick={isStreaming ? onStop : undefined}
className="relative inline-flex size-8 items-center justify-center rounded-xl bg-primary text-primary-foreground shadow-sm transition-[transform,opacity,background-color] hover:bg-primary/90 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground"
>
<AnimatePresence mode="wait" initial={false}>
{isStreaming ? (
<motion.span
key="stop"
initial={{ opacity: 0, scale: 0.6 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.6 }}
transition={{ duration: 0.15 }}
>
<StopIcon className="size-3.5" />
</motion.span>
) : (
<motion.span
key="send"
initial={{ opacity: 0, scale: 0.6 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.6 }}
transition={{ duration: 0.15 }}
>
<ArrowUpIcon className="size-4" />
</motion.span>
)}
</AnimatePresence>
</button>
</div>
</div>
</form>
);
},
);
PromptComposer.displayName = "PromptComposer";
function ModelPicker({
models,
model,
onModelChange,
}: {
models: string[];
model: string;
onModelChange?: (model: string) => void;
}) {
const [open, setOpen] = React.useState(false);
return (
<div className="relative">
<button
type="button"
aria-haspopup="listbox"
aria-expanded={open}
onClick={() => setOpen((o) => !o)}
onBlur={() => setTimeout(() => setOpen(false), 120)}
className="inline-flex h-8 items-center gap-1 rounded-lg px-2 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
>
{model}
<ChevronIcon
className={`size-3 transition-transform ${open ? "rotate-180" : ""}`}
/>
</button>
<AnimatePresence>
{open ? (
<motion.ul
role="listbox"
initial={{ opacity: 0, y: 6, scale: 0.96 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
exit={{ opacity: 0, y: 6, scale: 0.96 }}
transition={{
type: "spring",
stiffness: 320,
damping: 32,
mass: 0.9,
}}
className="absolute bottom-full left-0 z-popover mb-1.5 min-w-40 origin-bottom rounded-xl border border-border bg-popover p-1 shadow-lg"
>
{models.map((m) => (
<li key={m}>
<button
type="button"
role="option"
aria-selected={m === model}
onMouseDown={(e) => {
e.preventDefault();
onModelChange?.(m);
setOpen(false);
}}
className={`flex w-full items-center justify-between rounded-lg px-2 py-1.5 text-left text-xs transition-colors hover:bg-accent ${m === model ? "font-medium text-foreground" : "text-muted-foreground"}`}
>
{m}
{m === model ? (
<CheckIcon className="size-3.5 text-primary" />
) : null}
</button>
</li>
))}
</motion.ul>
) : null}
</AnimatePresence>
</div>
);
}
type IconProps = { className?: string };
const svg = "0 0 24 24";
function ArrowUpIcon({ className }: IconProps) {
return (
<svg
viewBox={svg}
fill="none"
stroke="currentColor"
strokeWidth={2.2}
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden="true"
>
<path d="M12 19V5M5 12l7-7 7 7" />
</svg>
);
}
function StopIcon({ className }: IconProps) {
return (
<svg
viewBox={svg}
fill="currentColor"
className={className}
aria-hidden="true"
>
<rect x="6" y="6" width="12" height="12" rx="2" />
</svg>
);
}
function PaperclipIcon({ className }: IconProps) {
return (
<svg
viewBox={svg}
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden="true"
>
<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" />
</svg>
);
}
function CloseIcon({ className }: IconProps) {
return (
<svg
viewBox={svg}
fill="none"
stroke="currentColor"
strokeWidth={2.2}
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden="true"
>
<path d="M18 6 6 18M6 6l12 12" />
</svg>
);
}
function ChevronIcon({ className }: IconProps) {
return (
<svg
viewBox={svg}
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden="true"
>
<path d="m6 9 6 6 6-6" />
</svg>
);
}
function CheckIcon({ className }: IconProps) {
return (
<svg
viewBox={svg}
fill="none"
stroke="currentColor"
strokeWidth={2.4}
strokeLinecap="round"
strokeLinejoin="round"
className={className}
aria-hidden="true"
>
<path d="M20 6 9 17l-5-5" />
</svg>
);
}
export { PromptComposer };Réglages · HTML · CSS · JS
Modifiez le code et ajustez-le avec les réglages. L'aperçu se met à jour pendant la saisie.

Ce composant tourne depuis un bundle compilé : son script est en lecture seule ici. Modifiez le HTML et le CSS ; la source complète est dans l'onglet Code.
Modifiez chaque composant en direct, ajustez-le avec des réglages, téléchargez la source complète et copiez les prompts avancés.
49 $ en une foisPrix provisoire
Mode test : aucun paiement réel.
Gratuit : aperçu, boutons de copie et notes de leçon.
Des marges généreuses, des coins doux et une seule couleur d’accent mettent le contenu en avant.
Listes de fonctions, profils, fiches produit et tableaux de bord.
Réglez la marge, la profondeur de l’ombre et la couleur d’accent.
Ajoute le composant « Conversation Thread » de GodUI (github.com/LucasBassetti/godui) (MIT) à mon application React + Tailwind CSS. Fichier source : https://github.com/LucasBassetti/godui/blob/1f632a76a346f09dc9fe066969906c6f98763e1e/packages/lab/src/conversation-thread. Des marges généreuses, des coins doux et une seule couleur d’accent mettent le contenu en avant. À utiliser pour : Listes de fonctions, profils, fiches produit et tableaux de bord. Réglages à ajuster : Réglez la marge, la profondeur de l’ombre et la couleur d’accent. Prends en charge les thèmes clair et sombre et respecte prefers-reduced-motion. Conserve la mention de licence MIT.
Un prompt plus long avec les étapes de réglage, d'accessibilité et d'intégration.