Skip to content

The Open Standard for Generative UI

Enhance ModelSwitcher component with UsagePolicy tooltip and style updates (#865)

Subham Das6fca08a54d44
diff --git a/examples/openui-cloud/public/logos/anthropic-dark.svg b/examples/openui-cloud/public/logos/anthropic-dark.svg
new file mode 100644
index 000000000..9f3de2f76
--- /dev/null
+++ b/examples/openui-cloud/public/logos/anthropic-dark.svg
@@ -0,0 +1,16 @@
+<svg version="1.1" id="Layer_1" xmlns:x="ns_extend;" xmlns:i="ns_ai;" xmlns:graph="ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 92.2 65" style="enable-background:new 0 0 92.2 65;" xml:space="preserve">
+ <style type="text/css">
+ .st0{fill:#FFFFFF;}
+ </style>
+ <metadata>
+ <sfw xmlns="ns_sfw;">
+ <slices>
+ </slices>
+ <sliceSourceBounds bottomLeftOrigin="true" height="65" width="92.2" x="-43.7" y="-98">
+ </sliceSourceBounds>
+ </sfw>
+ </metadata>
+ <path class="st0" d="M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z
+ M24.3,39.3l8.8-22.8l8.8,22.8H24.3z">
+ </path>
+</svg>
\ No newline at end of file
diff --git a/examples/openui-cloud/public/logos/anthropic-light.svg b/examples/openui-cloud/public/logos/anthropic-light.svg
new file mode 100644
index 000000000..135a8b9f3
--- /dev/null
+++ b/examples/openui-cloud/public/logos/anthropic-light.svg
@@ -0,0 +1,16 @@
+<svg version="1.1" id="Layer_1" xmlns:x="ns_extend;" xmlns:i="ns_ai;" xmlns:graph="ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 92.2 65" style="enable-background:new 0 0 92.2 65;" xml:space="preserve">
+ <style type="text/css">
+ .st0{fill:#181818;}
+ </style>
+ <metadata>
+ <sfw xmlns="ns_sfw;">
+ <slices>
+ </slices>
+ <sliceSourceBounds bottomLeftOrigin="true" height="65" width="92.2" x="-43.7" y="-98">
+ </sliceSourceBounds>
+ </sfw>
+ </metadata>
+ <path class="st0" d="M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z
+ M24.3,39.3l8.8-22.8l8.8,22.8H24.3z">
+ </path>
+</svg>
\ No newline at end of file
diff --git a/examples/openui-cloud/public/logos/google-dark.svg b/examples/openui-cloud/public/logos/google-dark.svg
new file mode 100644
index 000000000..dde6f728f
--- /dev/null
+++ b/examples/openui-cloud/public/logos/google-dark.svg
@@ -0,0 +1,104 @@
+<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 268.1522 273.8827" overflow="hidden" xml:space="preserve">
+ <defs>
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#0fbc5c"/>
+ <stop offset="1" stop-color="#0cba65"/>
+ </linearGradient>
+ <linearGradient id="g">
+ <stop offset=".2312727" stop-color="#0fbc5f"/>
+ <stop offset=".3115468" stop-color="#0fbc5f"/>
+ <stop offset=".3660131" stop-color="#0fbc5e"/>
+ <stop offset=".4575163" stop-color="#0fbc5d"/>
+ <stop offset=".540305" stop-color="#12bc58"/>
+ <stop offset=".6993464" stop-color="#28bf3c"/>
+ <stop offset=".7712418" stop-color="#38c02b"/>
+ <stop offset=".8605665" stop-color="#52c218"/>
+ <stop offset=".9150327" stop-color="#67c30f"/>
+ <stop offset="1" stop-color="#86c504"/>
+ </linearGradient>
+ <linearGradient id="h">
+ <stop offset=".1416122" stop-color="#1abd4d"/>
+ <stop offset=".2475151" stop-color="#6ec30d"/>
+ <stop offset=".3115468" stop-color="#8ac502"/>
+ <stop offset=".3660131" stop-color="#a2c600"/>
+ <stop offset=".4456735" stop-color="#c8c903"/>
+ <stop offset=".540305" stop-color="#ebcb03"/>
+ <stop offset=".6156363" stop-color="#f7cd07"/>
+ <stop offset=".6993454" stop-color="#fdcd04"/>
+ <stop offset=".7712418" stop-color="#fdce05"/>
+ <stop offset=".8605661" stop-color="#ffce0a"/>
+ </linearGradient>
+ <linearGradient id="f">
+ <stop offset=".3159041" stop-color="#ff4c3c"/>
+ <stop offset=".6038179" stop-color="#ff692c"/>
+ <stop offset=".7268366" stop-color="#ff7825"/>
+ <stop offset=".884534" stop-color="#ff8d1b"/>
+ <stop offset="1" stop-color="#ff9f13"/>
+ </linearGradient>
+ <linearGradient id="b">
+ <stop offset=".2312727" stop-color="#ff4541"/>
+ <stop offset=".3115468" stop-color="#ff4540"/>
+ <stop offset=".4575163" stop-color="#ff4640"/>
+ <stop offset=".540305" stop-color="#ff473f"/>
+ <stop offset=".6993464" stop-color="#ff5138"/>
+ <stop offset=".7712418" stop-color="#ff5b33"/>
+ <stop offset=".8605665" stop-color="#ff6c29"/>
+ <stop offset="1" stop-color="#ff8c18"/>
+ </linearGradient>
+ <linearGradient id="d">
+ <stop offset=".4084578" stop-color="#fb4e5a"/>
+ <stop offset="1" stop-color="#ff4540"/>
+ </linearGradient>
+ <linearGradient id="c">
+ <stop offset=".1315461" stop-color="#0cba65"/>
+ <stop offset=".2097843" stop-color="#0bb86d"/>
+ <stop offset=".2972969" stop-color="#09b479"/>
+ <stop offset=".3962575" stop-color="#08ad93"/>
+ <stop offset=".4771242" stop-color="#0aa6a9"/>
+ <stop offset=".5684245" stop-color="#0d9cc6"/>
+ <stop offset=".667385" stop-color="#1893dd"/>
+ <stop offset=".7687273" stop-color="#258bf1"/>
+ <stop offset=".8585063" stop-color="#3086ff"/>
+ </linearGradient>
+ <linearGradient id="e">
+ <stop offset=".3660131" stop-color="#ff4e3a"/>
+ <stop offset=".4575163" stop-color="#ff8a1b"/>
+ <stop offset=".540305" stop-color="#ffa312"/>
+ <stop offset=".6156363" stop-color="#ffb60c"/>
+ <stop offset=".7712418" stop-color="#ffcd0a"/>
+ <stop offset=".8605665" stop-color="#fecf0a"/>
+ <stop offset=".9150327" stop-color="#fecf08"/>
+ <stop offset="1" stop-color="#fdcd01"/>
+ </linearGradient>
+ <linearGradient xlink:href="#a" id="s" x1="219.6997" y1="329.5351" x2="254.4673" y2="329.5351" gradientUnits="userSpaceOnUse"/>
+ <radialGradient xlink:href="#b" id="m" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1.936885,1.043001,1.455731,2.555422,290.5254,-400.6338)" cx="109.6267" cy="135.8619" fx="109.6267" fy="135.8619" r="71.46001"/>
+ <radialGradient xlink:href="#c" id="n" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-3.512595,-4.45809,-1.692547,1.260616,870.8006,191.554)" cx="45.25866" cy="279.2738" fx="45.25866" fy="279.2738" r="71.46001"/>
+ <radialGradient xlink:href="#d" id="l" cx="304.0166" cy="118.0089" fx="304.0166" fy="118.0089" r="47.85445" gradientTransform="matrix(2.064353,-4.926832e-6,-2.901531e-6,2.592041,-297.6788,-151.7469)" gradientUnits="userSpaceOnUse"/>
+ <radialGradient xlink:href="#e" id="o" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-0.2485783,2.083138,2.962486,0.3341668,-255.1463,-331.1636)" cx="181.001" cy="177.2013" fx="181.001" fy="177.2013" r="71.46001"/>
+ <radialGradient xlink:href="#f" id="p" cx="207.6733" cy="108.0972" fx="207.6733" fy="108.0972" r="41.1025" gradientTransform="matrix(-1.249206,1.343263,-3.896837,-3.425693,880.5011,194.9051)" gradientUnits="userSpaceOnUse"/>
+ <radialGradient xlink:href="#g" id="r" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1.936885,-1.043001,1.455731,-2.555422,290.5254,838.6834)" cx="109.6267" cy="135.8619" fx="109.6267" fy="135.8619" r="71.46001"/>
+ <radialGradient xlink:href="#h" id="j" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-0.081402,-1.93722,2.926737,-0.1162508,-215.1345,632.8606)" cx="154.8697" cy="145.9691" fx="154.8697" fy="145.9691" r="71.46001"/>
+ <filter id="q" x="-.04842873" y="-.0582241" width="1.096857" height="1.116448" color-interpolation-filters="sRGB">
+ <feGaussianBlur stdDeviation="1.700914"/>
+ </filter>
+ <filter id="k" x="-.01670084" y="-.01009856" width="1.033402" height="1.020197" color-interpolation-filters="sRGB">
+ <feGaussianBlur stdDeviation=".2419367"/>
+ </filter>
+ <clipPath clipPathUnits="userSpaceOnUse" id="i">
+ <path d="M371.3784 193.2406H237.0825v53.4375h77.167c-1.2405 7.5627-4.0259 15.0024-8.1049 21.7862-4.6734 7.7723-10.4511 13.6895-16.373 18.1957-17.7389 13.4983-38.42 16.2584-52.7828 16.2584-36.2824 0-67.2833-23.2865-79.2844-54.9287-.4843-1.1482-.8059-2.3344-1.1975-3.5068-2.652-8.0533-4.101-16.5825-4.101-25.4474 0-9.226 1.5691-18.0575 4.4301-26.3985 11.2851-32.8967 42.9849-57.4674 80.1789-57.4674 7.4811 0 14.6854.8843 21.5173 2.6481 15.6135 4.0309 26.6578 11.9698 33.4252 18.2494l40.834-39.7111c-24.839-22.616-57.2194-36.3201-95.8444-36.3201-30.8782-.00066-59.3863 9.55308-82.7477 25.6992-18.9454 13.0941-34.4833 30.6254-44.9695 50.9861-9.75366 18.8785-15.09441 39.7994-15.09441 62.2934 0 22.495 5.34891 43.6334 15.10261 62.3374v.126c10.3023 19.8567 25.3678 36.9537 43.6783 49.9878 15.9962 11.3866 44.6789 26.5516 84.0307 26.5516 22.6301 0 42.6867-4.0517 60.3748-11.6447 12.76-5.4775 24.0655-12.6217 34.3012-21.8036 13.5247-12.1323 24.1168-27.1388 31.3465-44.4041 7.2297-17.2654 11.097-36.7895 11.097-57.957 0-9.858-.9971-19.8694-2.6881-28.9684Z" fill="#000"/>
+ </clipPath>
+ </defs>
+ <g transform="matrix(0.957922,0,0,0.985255,-90.17436,-78.85577)">
+ <g clip-path="url(#i)">
+ <path d="M92.07563 219.9585c.14844 22.14 6.5014 44.983 16.11767 63.4234v.1269c6.9482 13.3919 16.4444 23.9704 27.2604 34.4518l65.326-23.67c-12.3593-6.2344-14.2452-10.0546-23.1048-17.0253-9.0537-9.0658-15.8015-19.4735-20.0038-31.677h-.1693l.1693-.1269c-2.7646-8.0587-3.0373-16.6129-3.1393-25.5029Z" fill="url(#j)" filter="url(#k)"/>
+ <path d="M237.0835 79.02491c-6.4568 22.52569-3.988 44.42139 0 57.16129 7.4561.0055 14.6388.8881 21.4494 2.6464 15.6135 4.0309 26.6566 11.97 33.424 18.2496l41.8794-40.7256c-24.8094-22.58904-54.6663-37.2961-96.7528-37.33169Z" fill="url(#l)" filter="url(#k)"/>
+ <path d="M236.9434 78.84678c-31.6709-.00068-60.9107 9.79833-84.8718 26.35902-8.8968 6.149-17.0612 13.2521-24.3311 21.1509-1.9045 17.7429 14.2569 39.5507 46.2615 39.3702 15.5284-17.9373 38.4946-29.5427 64.0561-29.5427.0233 0 .046.0019.0693.002l-1.0439-57.33536c-.0472-.00003-.0929-.00406-.1401-.00406Z" fill="url(#m)" filter="url(#k)"/>
+ <path d="m341.4751 226.3788-28.2685 19.2848c-1.2405 7.5627-4.0278 15.0023-8.1068 21.7861-4.6734 7.7723-10.4506 13.6898-16.3725 18.196-17.7022 13.4704-38.3286 16.2439-52.6877 16.2553-14.8415 25.1018-17.4435 37.6749 1.0439 57.9342 22.8762-.0167 43.157-4.1174 61.0458-11.7965 12.9312-5.551 24.3879-12.7913 34.7609-22.0964 13.7061-12.295 24.4421-27.5034 31.7688-45.0003 7.3267-17.497 11.2446-37.2822 11.2446-58.7336Z" fill="url(#n)" filter="url(#k)"/>
+ <path d="M234.9956 191.2104v57.4981h136.0062c1.1962-7.8745 5.1523-18.0644 5.1523-26.5001 0-9.858-.9963-21.899-2.6873-30.998Z" fill="#3086ff" filter="url(#k)"/>
+ <path d="M128.3894 124.3268c-8.393 9.1191-15.5632 19.326-21.2483 30.3646-9.75351 18.8785-15.09402 41.8295-15.09402 64.3235 0 .317.02642.6271.02855.9436 4.31953 8.2244 59.66647 6.6495 62.45617 0-.0035-.3103-.0387-.6128-.0387-.9238 0-9.226 1.5696-16.0262 4.4306-24.3672 3.5294-10.2885 9.0557-19.7628 16.1223-27.9257 1.6019-2.0309 5.8748-6.3969 7.1214-9.0157.4749-.9975-.8621-1.5574-.9369-1.9085-.0836-.3927-1.8762-.0769-2.2778-.3694-1.2751-.9288-3.8001-1.4138-5.3334-1.8449-3.2772-.9215-8.7085-2.9536-11.7252-5.0601-9.5357-6.6586-24.417-14.6122-33.5047-24.2164Z" fill="url(#o)" filter="url(#k)"/>
+ <path d="M162.0989 155.8569c22.1123 13.3013 28.4714-6.7139 43.173-12.9771L179.698 90.21568c-9.4075 3.92642-18.2957 8.80465-26.5426 14.50442-12.316 8.5122-23.192 18.8995-32.1763 30.7204Z" fill="url(#p)" filter="url(#q)"/>
+ <path d="M171.0987 290.222c-29.6829 10.6413-34.3299 11.023-37.0622 29.2903 5.2213 5.0597 10.8312 9.74 16.7926 13.9835 15.9962 11.3867 46.766 26.5517 86.1178 26.5517.0462 0 .0904-.004.1366-.004v-59.1574c-.0298.0001-.064.002-.0938.002-14.7359 0-26.5113-3.8435-38.5848-10.5273-2.9768-1.6479-8.3775 2.7772-11.1229.799-3.7865-2.7284-12.8991 2.3508-16.1833-.9378Z" fill="url(#r)" filter="url(#k)"/>
+ <path d="M219.6997 299.0227v59.9959c5.506.6402 11.2361 1.0289 17.2472 1.0289 6.0259 0 11.8556-.3073 17.5204-.8723v-59.7481c-6.3482 1.0777-12.3272 1.461-17.4776 1.461-5.9318 0-11.7005-.6858-17.29-1.8654Z" opacity=".5" fill="url(#s)" filter="url(#k)"/>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/examples/openui-cloud/public/logos/google-light.svg b/examples/openui-cloud/public/logos/google-light.svg
new file mode 100644
index 000000000..dde6f728f
--- /dev/null
+++ b/examples/openui-cloud/public/logos/google-light.svg
@@ -0,0 +1,104 @@
+<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 268.1522 273.8827" overflow="hidden" xml:space="preserve">
+ <defs>
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#0fbc5c"/>
+ <stop offset="1" stop-color="#0cba65"/>
+ </linearGradient>
+ <linearGradient id="g">
+ <stop offset=".2312727" stop-color="#0fbc5f"/>
+ <stop offset=".3115468" stop-color="#0fbc5f"/>
+ <stop offset=".3660131" stop-color="#0fbc5e"/>
+ <stop offset=".4575163" stop-color="#0fbc5d"/>
+ <stop offset=".540305" stop-color="#12bc58"/>
+ <stop offset=".6993464" stop-color="#28bf3c"/>
+ <stop offset=".7712418" stop-color="#38c02b"/>
+ <stop offset=".8605665" stop-color="#52c218"/>
+ <stop offset=".9150327" stop-color="#67c30f"/>
+ <stop offset="1" stop-color="#86c504"/>
+ </linearGradient>
+ <linearGradient id="h">
+ <stop offset=".1416122" stop-color="#1abd4d"/>
+ <stop offset=".2475151" stop-color="#6ec30d"/>
+ <stop offset=".3115468" stop-color="#8ac502"/>
+ <stop offset=".3660131" stop-color="#a2c600"/>
+ <stop offset=".4456735" stop-color="#c8c903"/>
+ <stop offset=".540305" stop-color="#ebcb03"/>
+ <stop offset=".6156363" stop-color="#f7cd07"/>
+ <stop offset=".6993454" stop-color="#fdcd04"/>
+ <stop offset=".7712418" stop-color="#fdce05"/>
+ <stop offset=".8605661" stop-color="#ffce0a"/>
+ </linearGradient>
+ <linearGradient id="f">
+ <stop offset=".3159041" stop-color="#ff4c3c"/>
+ <stop offset=".6038179" stop-color="#ff692c"/>
+ <stop offset=".7268366" stop-color="#ff7825"/>
+ <stop offset=".884534" stop-color="#ff8d1b"/>
+ <stop offset="1" stop-color="#ff9f13"/>
+ </linearGradient>
+ <linearGradient id="b">
+ <stop offset=".2312727" stop-color="#ff4541"/>
+ <stop offset=".3115468" stop-color="#ff4540"/>
+ <stop offset=".4575163" stop-color="#ff4640"/>
+ <stop offset=".540305" stop-color="#ff473f"/>
+ <stop offset=".6993464" stop-color="#ff5138"/>
+ <stop offset=".7712418" stop-color="#ff5b33"/>
+ <stop offset=".8605665" stop-color="#ff6c29"/>
+ <stop offset="1" stop-color="#ff8c18"/>
+ </linearGradient>
+ <linearGradient id="d">
+ <stop offset=".4084578" stop-color="#fb4e5a"/>
+ <stop offset="1" stop-color="#ff4540"/>
+ </linearGradient>
+ <linearGradient id="c">
+ <stop offset=".1315461" stop-color="#0cba65"/>
+ <stop offset=".2097843" stop-color="#0bb86d"/>
+ <stop offset=".2972969" stop-color="#09b479"/>
+ <stop offset=".3962575" stop-color="#08ad93"/>
+ <stop offset=".4771242" stop-color="#0aa6a9"/>
+ <stop offset=".5684245" stop-color="#0d9cc6"/>
+ <stop offset=".667385" stop-color="#1893dd"/>
+ <stop offset=".7687273" stop-color="#258bf1"/>
+ <stop offset=".8585063" stop-color="#3086ff"/>
+ </linearGradient>
+ <linearGradient id="e">
+ <stop offset=".3660131" stop-color="#ff4e3a"/>
+ <stop offset=".4575163" stop-color="#ff8a1b"/>
+ <stop offset=".540305" stop-color="#ffa312"/>
+ <stop offset=".6156363" stop-color="#ffb60c"/>
+ <stop offset=".7712418" stop-color="#ffcd0a"/>
+ <stop offset=".8605665" stop-color="#fecf0a"/>
+ <stop offset=".9150327" stop-color="#fecf08"/>
+ <stop offset="1" stop-color="#fdcd01"/>
+ </linearGradient>
+ <linearGradient xlink:href="#a" id="s" x1="219.6997" y1="329.5351" x2="254.4673" y2="329.5351" gradientUnits="userSpaceOnUse"/>
+ <radialGradient xlink:href="#b" id="m" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1.936885,1.043001,1.455731,2.555422,290.5254,-400.6338)" cx="109.6267" cy="135.8619" fx="109.6267" fy="135.8619" r="71.46001"/>
+ <radialGradient xlink:href="#c" id="n" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-3.512595,-4.45809,-1.692547,1.260616,870.8006,191.554)" cx="45.25866" cy="279.2738" fx="45.25866" fy="279.2738" r="71.46001"/>
+ <radialGradient xlink:href="#d" id="l" cx="304.0166" cy="118.0089" fx="304.0166" fy="118.0089" r="47.85445" gradientTransform="matrix(2.064353,-4.926832e-6,-2.901531e-6,2.592041,-297.6788,-151.7469)" gradientUnits="userSpaceOnUse"/>
+ <radialGradient xlink:href="#e" id="o" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-0.2485783,2.083138,2.962486,0.3341668,-255.1463,-331.1636)" cx="181.001" cy="177.2013" fx="181.001" fy="177.2013" r="71.46001"/>
+ <radialGradient xlink:href="#f" id="p" cx="207.6733" cy="108.0972" fx="207.6733" fy="108.0972" r="41.1025" gradientTransform="matrix(-1.249206,1.343263,-3.896837,-3.425693,880.5011,194.9051)" gradientUnits="userSpaceOnUse"/>
+ <radialGradient xlink:href="#g" id="r" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1.936885,-1.043001,1.455731,-2.555422,290.5254,838.6834)" cx="109.6267" cy="135.8619" fx="109.6267" fy="135.8619" r="71.46001"/>
+ <radialGradient xlink:href="#h" id="j" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-0.081402,-1.93722,2.926737,-0.1162508,-215.1345,632.8606)" cx="154.8697" cy="145.9691" fx="154.8697" fy="145.9691" r="71.46001"/>
+ <filter id="q" x="-.04842873" y="-.0582241" width="1.096857" height="1.116448" color-interpolation-filters="sRGB">
+ <feGaussianBlur stdDeviation="1.700914"/>
+ </filter>
+ <filter id="k" x="-.01670084" y="-.01009856" width="1.033402" height="1.020197" color-interpolation-filters="sRGB">
+ <feGaussianBlur stdDeviation=".2419367"/>
+ </filter>
+ <clipPath clipPathUnits="userSpaceOnUse" id="i">
+ <path d="M371.3784 193.2406H237.0825v53.4375h77.167c-1.2405 7.5627-4.0259 15.0024-8.1049 21.7862-4.6734 7.7723-10.4511 13.6895-16.373 18.1957-17.7389 13.4983-38.42 16.2584-52.7828 16.2584-36.2824 0-67.2833-23.2865-79.2844-54.9287-.4843-1.1482-.8059-2.3344-1.1975-3.5068-2.652-8.0533-4.101-16.5825-4.101-25.4474 0-9.226 1.5691-18.0575 4.4301-26.3985 11.2851-32.8967 42.9849-57.4674 80.1789-57.4674 7.4811 0 14.6854.8843 21.5173 2.6481 15.6135 4.0309 26.6578 11.9698 33.4252 18.2494l40.834-39.7111c-24.839-22.616-57.2194-36.3201-95.8444-36.3201-30.8782-.00066-59.3863 9.55308-82.7477 25.6992-18.9454 13.0941-34.4833 30.6254-44.9695 50.9861-9.75366 18.8785-15.09441 39.7994-15.09441 62.2934 0 22.495 5.34891 43.6334 15.10261 62.3374v.126c10.3023 19.8567 25.3678 36.9537 43.6783 49.9878 15.9962 11.3866 44.6789 26.5516 84.0307 26.5516 22.6301 0 42.6867-4.0517 60.3748-11.6447 12.76-5.4775 24.0655-12.6217 34.3012-21.8036 13.5247-12.1323 24.1168-27.1388 31.3465-44.4041 7.2297-17.2654 11.097-36.7895 11.097-57.957 0-9.858-.9971-19.8694-2.6881-28.9684Z" fill="#000"/>
+ </clipPath>
+ </defs>
+ <g transform="matrix(0.957922,0,0,0.985255,-90.17436,-78.85577)">
+ <g clip-path="url(#i)">
+ <path d="M92.07563 219.9585c.14844 22.14 6.5014 44.983 16.11767 63.4234v.1269c6.9482 13.3919 16.4444 23.9704 27.2604 34.4518l65.326-23.67c-12.3593-6.2344-14.2452-10.0546-23.1048-17.0253-9.0537-9.0658-15.8015-19.4735-20.0038-31.677h-.1693l.1693-.1269c-2.7646-8.0587-3.0373-16.6129-3.1393-25.5029Z" fill="url(#j)" filter="url(#k)"/>
+ <path d="M237.0835 79.02491c-6.4568 22.52569-3.988 44.42139 0 57.16129 7.4561.0055 14.6388.8881 21.4494 2.6464 15.6135 4.0309 26.6566 11.97 33.424 18.2496l41.8794-40.7256c-24.8094-22.58904-54.6663-37.2961-96.7528-37.33169Z" fill="url(#l)" filter="url(#k)"/>
+ <path d="M236.9434 78.84678c-31.6709-.00068-60.9107 9.79833-84.8718 26.35902-8.8968 6.149-17.0612 13.2521-24.3311 21.1509-1.9045 17.7429 14.2569 39.5507 46.2615 39.3702 15.5284-17.9373 38.4946-29.5427 64.0561-29.5427.0233 0 .046.0019.0693.002l-1.0439-57.33536c-.0472-.00003-.0929-.00406-.1401-.00406Z" fill="url(#m)" filter="url(#k)"/>
+ <path d="m341.4751 226.3788-28.2685 19.2848c-1.2405 7.5627-4.0278 15.0023-8.1068 21.7861-4.6734 7.7723-10.4506 13.6898-16.3725 18.196-17.7022 13.4704-38.3286 16.2439-52.6877 16.2553-14.8415 25.1018-17.4435 37.6749 1.0439 57.9342 22.8762-.0167 43.157-4.1174 61.0458-11.7965 12.9312-5.551 24.3879-12.7913 34.7609-22.0964 13.7061-12.295 24.4421-27.5034 31.7688-45.0003 7.3267-17.497 11.2446-37.2822 11.2446-58.7336Z" fill="url(#n)" filter="url(#k)"/>
+ <path d="M234.9956 191.2104v57.4981h136.0062c1.1962-7.8745 5.1523-18.0644 5.1523-26.5001 0-9.858-.9963-21.899-2.6873-30.998Z" fill="#3086ff" filter="url(#k)"/>
+ <path d="M128.3894 124.3268c-8.393 9.1191-15.5632 19.326-21.2483 30.3646-9.75351 18.8785-15.09402 41.8295-15.09402 64.3235 0 .317.02642.6271.02855.9436 4.31953 8.2244 59.66647 6.6495 62.45617 0-.0035-.3103-.0387-.6128-.0387-.9238 0-9.226 1.5696-16.0262 4.4306-24.3672 3.5294-10.2885 9.0557-19.7628 16.1223-27.9257 1.6019-2.0309 5.8748-6.3969 7.1214-9.0157.4749-.9975-.8621-1.5574-.9369-1.9085-.0836-.3927-1.8762-.0769-2.2778-.3694-1.2751-.9288-3.8001-1.4138-5.3334-1.8449-3.2772-.9215-8.7085-2.9536-11.7252-5.0601-9.5357-6.6586-24.417-14.6122-33.5047-24.2164Z" fill="url(#o)" filter="url(#k)"/>
+ <path d="M162.0989 155.8569c22.1123 13.3013 28.4714-6.7139 43.173-12.9771L179.698 90.21568c-9.4075 3.92642-18.2957 8.80465-26.5426 14.50442-12.316 8.5122-23.192 18.8995-32.1763 30.7204Z" fill="url(#p)" filter="url(#q)"/>
+ <path d="M171.0987 290.222c-29.6829 10.6413-34.3299 11.023-37.0622 29.2903 5.2213 5.0597 10.8312 9.74 16.7926 13.9835 15.9962 11.3867 46.766 26.5517 86.1178 26.5517.0462 0 .0904-.004.1366-.004v-59.1574c-.0298.0001-.064.002-.0938.002-14.7359 0-26.5113-3.8435-38.5848-10.5273-2.9768-1.6479-8.3775 2.7772-11.1229.799-3.7865-2.7284-12.8991 2.3508-16.1833-.9378Z" fill="url(#r)" filter="url(#k)"/>
+ <path d="M219.6997 299.0227v59.9959c5.506.6402 11.2361 1.0289 17.2472 1.0289 6.0259 0 11.8556-.3073 17.5204-.8723v-59.7481c-6.3482 1.0777-12.3272 1.461-17.4776 1.461-5.9318 0-11.7005-.6858-17.29-1.8654Z" opacity=".5" fill="url(#s)" filter="url(#k)"/>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/examples/openui-cloud/public/logos/openai-dark.svg b/examples/openui-cloud/public/logos/openai-dark.svg
new file mode 100644
index 000000000..176583a6e
--- /dev/null
+++ b/examples/openui-cloud/public/logos/openai-dark.svg
@@ -0,0 +1,10 @@
+<svg width="256" height="260" viewBox="0 0 256 260" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_14305_5189)">
+<path d="M239.184 106.203C245.054 88.5242 243.022 69.1734 233.608 53.0999C219.452 28.4588 191 15.7836 163.213 21.7395C147.554 4.32146 123.795 -3.42399 100.879 1.41874C77.9631 6.26146 59.369 22.9573 52.096 45.2214C33.8436 48.9645 18.0902 60.3927 8.86672 76.5818C-5.44349 101.183 -2.19544 132.215 16.8987 153.32C11.0061 170.991 13.0197 190.344 22.4238 206.423C36.5976 231.072 65.068 243.747 92.8696 237.783C105.236 251.708 123.001 259.631 141.624 259.527C170.105 259.552 195.338 241.166 204.038 214.046C222.287 210.296 238.038 198.87 247.267 182.685C261.404 158.128 258.142 127.263 239.184 106.203ZM141.624 242.541C130.256 242.559 119.244 238.575 110.519 231.286L112.054 230.416L163.725 200.591C166.341 199.056 167.954 196.257 167.971 193.224V120.374L189.816 133.01C190.034 133.121 190.186 133.331 190.225 133.573V193.94C190.169 220.758 168.442 242.485 141.624 242.541ZM37.1576 197.931C31.4565 188.086 29.4095 176.547 31.3766 165.342L32.9114 166.263L84.633 196.089C87.2389 197.618 90.4683 197.618 93.0742 196.089L156.255 159.664V184.885C156.244 185.15 156.112 185.395 155.897 185.55L103.562 215.734C80.3055 229.132 50.5925 221.165 37.1576 197.931ZM23.5493 85.3811C29.29 75.4733 38.3512 67.9163 49.1287 64.0479V125.439C49.0892 128.459 50.6965 131.263 53.3238 132.754L116.198 169.026L94.3532 181.662C94.1132 181.789 93.8257 181.789 93.5858 181.662L41.3526 151.53C18.1419 138.076 10.1818 108.386 23.5493 85.1253V85.3811ZM203.015 127.076L139.936 90.4459L161.729 77.8608C161.969 77.7334 162.257 77.7334 162.497 77.8608L214.73 108.045C231.032 117.452 240.437 135.426 238.872 154.183C237.306 172.939 225.051 189.106 207.414 195.68V134.289C207.323 131.277 205.651 128.536 203.015 127.076ZM224.757 94.3851L223.222 93.4642L171.603 63.3828C168.981 61.8444 165.732 61.8444 163.111 63.3828L99.9807 99.8079V74.5866C99.9533 74.3254 100.071 74.0702 100.288 73.9215L152.521 43.789C168.863 34.3744 189.174 35.2529 204.643 46.0435C220.111 56.8341 227.949 75.5924 224.757 94.1805V94.3851ZM88.0606 139.098L66.2158 126.513C65.995 126.379 65.8451 126.154 65.8065 125.899V65.685C65.8314 46.8285 76.7501 29.6846 93.8271 21.6883C110.904 13.692 131.064 16.2835 145.563 28.339L144.028 29.2087L92.358 59.0343C89.7419 60.5688 88.1283 63.3684 88.1118 66.4012L88.0606 139.098ZM99.9295 113.519L128.067 97.3011L156.255 113.519V145.953L128.169 162.171L99.9807 145.953L99.9295 113.519Z" fill="white"/>
+</g>
+<defs>
+<clipPath id="clip0_14305_5189">
+<rect width="256" height="260" fill="white"/>
+</clipPath>
+</defs>
+</svg>
\ No newline at end of file
diff --git a/examples/openui-cloud/public/logos/openai-light.svg b/examples/openui-cloud/public/logos/openai-light.svg
new file mode 100644
index 000000000..25d4ed138
--- /dev/null
+++ b/examples/openui-cloud/public/logos/openai-light.svg
@@ -0,0 +1,10 @@
+<svg width="256" height="260" viewBox="0 0 256 260" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_14305_5186)">
+<path d="M239.184 106.203C245.054 88.5242 243.022 69.1734 233.608 53.0999C219.452 28.4588 191 15.7836 163.213 21.7395C147.554 4.32146 123.795 -3.42399 100.879 1.41874C77.9631 6.26146 59.369 22.9573 52.096 45.2214C33.8436 48.9645 18.0902 60.3927 8.86672 76.5818C-5.44349 101.183 -2.19544 132.215 16.8987 153.32C11.0061 170.991 13.0197 190.344 22.4238 206.423C36.5976 231.072 65.068 243.747 92.8696 237.783C105.236 251.708 123.001 259.631 141.624 259.527C170.105 259.552 195.338 241.166 204.038 214.046C222.287 210.296 238.038 198.87 247.267 182.685C261.404 158.128 258.142 127.263 239.184 106.203ZM141.624 242.541C130.256 242.559 119.244 238.575 110.519 231.286L112.054 230.416L163.725 200.591C166.341 199.056 167.954 196.257 167.971 193.224V120.374L189.816 133.01C190.034 133.121 190.186 133.331 190.225 133.573V193.94C190.169 220.758 168.442 242.485 141.624 242.541ZM37.1576 197.931C31.4565 188.086 29.4095 176.547 31.3766 165.342L32.9114 166.263L84.633 196.089C87.2389 197.618 90.4683 197.618 93.0742 196.089L156.255 159.664V184.885C156.244 185.15 156.112 185.395 155.897 185.55L103.562 215.734C80.3055 229.132 50.5925 221.165 37.1576 197.931ZM23.5493 85.3811C29.29 75.4733 38.3512 67.9163 49.1287 64.0479V125.439C49.0892 128.459 50.6965 131.263 53.3238 132.754L116.198 169.026L94.3532 181.662C94.1132 181.789 93.8257 181.789 93.5858 181.662L41.3526 151.53C18.1419 138.076 10.1818 108.386 23.5493 85.1253V85.3811ZM203.015 127.076L139.936 90.4459L161.729 77.8608C161.969 77.7334 162.257 77.7334 162.497 77.8608L214.73 108.045C231.032 117.452 240.437 135.426 238.872 154.183C237.306 172.939 225.051 189.106 207.414 195.68V134.289C207.323 131.277 205.651 128.536 203.015 127.076ZM224.757 94.3851L223.222 93.4642L171.603 63.3828C168.981 61.8444 165.732 61.8444 163.111 63.3828L99.9807 99.8079V74.5866C99.9533 74.3254 100.071 74.0702 100.288 73.9215L152.521 43.789C168.863 34.3744 189.174 35.2529 204.643 46.0435C220.111 56.8341 227.949 75.5924 224.757 94.1805V94.3851ZM88.0606 139.098L66.2158 126.513C65.995 126.379 65.8451 126.154 65.8065 125.899V65.685C65.8314 46.8285 76.7501 29.6846 93.8271 21.6883C110.904 13.692 131.064 16.2835 145.563 28.339L144.028 29.2087L92.358 59.0343C89.7419 60.5688 88.1283 63.3684 88.1118 66.4012L88.0606 139.098ZM99.9295 113.519L128.067 97.3011L156.255 113.519V145.953L128.169 162.171L99.9807 145.953L99.9295 113.519Z" fill="black"/>
+</g>
+<defs>
+<clipPath id="clip0_14305_5186">
+<rect width="256" height="260" fill="white"/>
+</clipPath>
+</defs>
+</svg>
\ No newline at end of file
diff --git a/examples/openui-cloud/src/app/api/chat/route.ts b/examples/openui-cloud/src/app/api/chat/route.ts
index abce169bf..f649505c0 100644
--- a/examples/openui-cloud/src/app/api/chat/route.ts
+++ b/examples/openui-cloud/src/app/api/chat/route.ts
@@ -1,4 +1,5 @@
import { envOr, requiredEnv } from "@/lib/env";
+import { DEFAULT_MODEL, resolveRequestedModel } from "@/lib/models";
import { artifactTool, createResponsesInstructions } from "@openuidev/thesys-server";
import OpenAI from "openai";
import type { ResponseInputItem } from "openai/resources/responses/responses";
@@ -11,9 +12,14 @@ import type { ResponseInputItem } from "openai/resources/responses/responses";
* server-side, so this route is a pure pipe — no client-tool loop.
*/
export async function POST(req: Request) {
- const { threadId, input } = (await req.json()) as {
+ const {
+ threadId,
+ input,
+ model: requestedModel,
+ } = (await req.json()) as {
threadId?: string;
input?: ResponseInputItem[];
+ model?: unknown;
};
if (!threadId) {
@@ -39,7 +45,7 @@ export async function POST(req: Request) {
try {
stream = (await client.responses.create(
{
- model: envOr("OPENUI_MODEL", "google/gemini-3.6-flash-free"),
+ model: resolveRequestedModel(requestedModel, envOr("OPENUI_MODEL", DEFAULT_MODEL)),
conversation: threadId, // store:true persists to the conversation
input,
stream: true,
diff --git a/examples/openui-cloud/src/app/globals.css b/examples/openui-cloud/src/app/globals.css
index 7070e07d3..722819cc8 100644
--- a/examples/openui-cloud/src/app/globals.css
+++ b/examples/openui-cloud/src/app/globals.css
@@ -1,4 +1,19 @@
@import "tailwindcss";
-
-
\ No newline at end of file
+/* Make room for the ModelSwitcher in the thread/mobile headers. */
+.openui-cloud-thread-header .openui-agent-thread-header__title {
+ display: none;
+}
+.openui-cloud-thread-header .openui-agent-thread-header__actions {
+ flex: 1 1 auto;
+ min-width: 0;
+ justify-content: space-between;
+}
+.openui-cloud-mobile-header .openui-agent-mobile-header-logo-container {
+ display: none;
+}
+.openui-cloud-mobile-header .openui-agent-mobile-header-actions {
+ flex: 1 1 auto;
+ min-width: 0;
+ justify-content: space-between;
+}
diff --git a/examples/openui-cloud/src/components/cloud-chat.tsx b/examples/openui-cloud/src/components/cloud-chat.tsx
index 488267355..ca66f3f17 100644
--- a/examples/openui-cloud/src/components/cloud-chat.tsx
+++ b/examples/openui-cloud/src/components/cloud-chat.tsx
@@ -8,11 +8,14 @@ import {
} from "@openuidev/react-headless";
import { AgentInterface, type PromptTemplate } from "@openuidev/react-ui";
import { FileText, Presentation } from "lucide-react";
+import { useCallback, useEffect } from "react";
// chatLibrary, useOpenuiCloudStorage, and the artifact renderers all come from the
// migrated SDK (@openuidev/thesys). Its artifact parser now reads the program from
// the tool INPUT channel (args.artifact_content), so the rich preview renders live
// during/after generation without a refresh.
+import { usePersistedModel } from "@/hooks/use-persisted-model";
import { useTheme } from "@/hooks/use-system-theme";
+import { DEFAULT_MODEL } from "@/lib/models";
import {
chatLibrary,
presentationArtifactRenderer,
@@ -20,6 +23,8 @@ import {
useOpenuiCloudStorage,
} from "@openuidev/thesys";
+import { ModelSwitcher } from "./model-switcher";
+
const LIGHT_LOGO_URL = "/openui-cloud-logo-light.svg";
const DARK_LOGO_URL = "/openui-cloud-logo-dark.svg";
@@ -83,6 +88,10 @@ const { artifactRenderers, artifactCategories } = defineArtifactCategories([
},
]);
+// Read at send-time (mutated by the ModelSwitcher) so the static llm always
+// posts the current selection. Kept in sync with the persisted model below.
+let currentModel = DEFAULT_MODEL;
+
const llm: ChatLLM = {
send: async ({ threadId, messages, signal }) => {
// The API replays full history via the conversation linkage — send only
@@ -91,7 +100,11 @@ const llm: ChatLLM = {
return fetch("/api/chat", {
method: "POST",
headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ threadId, input: openAIConversationMessageFormat.toApi(latest) }),
+ body: JSON.stringify({
+ threadId,
+ input: openAIConversationMessageFormat.toApi(latest),
+ model: currentModel,
+ }),
signal,
});
},
@@ -100,6 +113,7 @@ const llm: ChatLLM = {
export function CloudChat() {
const mode = useTheme();
+ const [selectedModel, setSelectedModel] = usePersistedModel();
// useOpenuiCloudStorage: browser ChatStorage over /v1, fct_-authenticated. As a
// hook the storage + its fct_ token manager are created on mount (not at module
@@ -113,6 +127,19 @@ export function CloudChat() {
features: { artifact: true },
});
+ // Keep the module-level model (read by llm.send) in sync with the selection.
+ useEffect(() => {
+ currentModel = selectedModel;
+ }, [selectedModel]);
+
+ const handleModelChange = useCallback(
+ (model: string) => {
+ currentModel = model;
+ setSelectedModel(model);
+ },
+ [setSelectedModel],
+ );
+
return (
<div className="h-screen w-screen overflow-hidden relative">
<AgentInterface
@@ -143,6 +170,16 @@ export function CloudChat() {
},
]}
>
+ <AgentInterface.MobileHeader
+ className="openui-cloud-mobile-header"
+ agentName=""
+ actions={
+ <ModelSwitcher selectedModel={selectedModel} onModelChange={handleModelChange} />
+ }
+ />
+ <AgentInterface.ThreadHeader className="openui-cloud-thread-header">
+ <ModelSwitcher selectedModel={selectedModel} onModelChange={handleModelChange} />
+ </AgentInterface.ThreadHeader>
<AgentInterface.Welcome
title="Good to see you"
description="What's on your mind today?"
diff --git a/examples/openui-cloud/src/components/model-switcher/ModelBadge.tsx b/examples/openui-cloud/src/components/model-switcher/ModelBadge.tsx
new file mode 100644
index 000000000..cc67f17c9
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/ModelBadge.tsx
@@ -0,0 +1,44 @@
+import { type ModelOption } from "@/lib/models";
+
+import { getModelBadge } from "./utils";
+
+// Recommended = info (blue), Free = success (green), both from the @openuidev
+// design tokens. Labels use neutral primary text while the leading dot carries
+// the semantic color. Trigger and row differ only in shape/size.
+const BADGE_DOT_COLORS = {
+ recommended: "bg-[var(--openui-border-info-emphasis)]",
+ free: "bg-[var(--openui-border-success-emphasis)]",
+} as const;
+
+export function ModelBadge({
+ model,
+ variant,
+}: {
+ model: ModelOption;
+ variant: "trigger" | "row";
+}) {
+ const badge = getModelBadge(model);
+ if (!badge) return null;
+
+ if (variant === "trigger") {
+ return (
+ <span className="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-[var(--openui-border-default)] bg-transparent">
+ <span
+ aria-hidden="true"
+ className={`h-1.5 w-1.5 rounded-full ${BADGE_DOT_COLORS[badge.kind]}`}
+ />
+ <span className="sr-only">{badge.label}</span>
+ </span>
+ );
+ }
+
+ return (
+ <span className="absolute right-2 top-1/2 inline-flex -translate-y-1/2 shrink-0 items-center gap-1 rounded-full border border-[var(--openui-border-default)] bg-transparent px-2 py-0.5 text-xs font-normal text-[color:var(--openui-text-neutral-primary)]">
+ <span
+ aria-hidden="true"
+ className={`h-1.5 w-1.5 shrink-0 rounded-full ${BADGE_DOT_COLORS[badge.kind]}`}
+ />
+ {badge.label}
+ </span>
+ );
+}
diff --git a/examples/openui-cloud/src/components/model-switcher/ModelRow.tsx b/examples/openui-cloud/src/components/model-switcher/ModelRow.tsx
new file mode 100644
index 000000000..ea79046a3
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/ModelRow.tsx
@@ -0,0 +1,16 @@
+import { type ModelOption } from "@/lib/models";
+
+import { ModelBadge } from "./ModelBadge";
+import { ProviderLogo } from "./ProviderLogo";
+
+// A single row inside the dropdown: provider logo, name, and a Recommended/Free
+// chip.
+export function ModelRow({ model }: { model: ModelOption }) {
+ return (
+ <span className="flex w-full min-w-0 items-center gap-2.5">
+ <ProviderLogo provider={model.provider} />
+ <span className="min-w-0 flex-1 truncate">{model.name}</span>
+ <ModelBadge model={model} variant="row" />
+ </span>
+ );
+}
diff --git a/examples/openui-cloud/src/components/model-switcher/ProviderLogo.tsx b/examples/openui-cloud/src/components/model-switcher/ProviderLogo.tsx
new file mode 100644
index 000000000..d9d65c6d6
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/ProviderLogo.tsx
@@ -0,0 +1,23 @@
+"use client";
+
+import { useTheme } from "@/hooks/use-system-theme";
+
+export function ProviderLogo({
+ provider,
+ size = "md",
+}: {
+ provider: string;
+ size?: "sm" | "md";
+}) {
+ const mode = useTheme();
+ const box = size === "sm" ? "h-5 w-5 rounded-md" : "h-7 w-7 rounded-lg";
+ const img = size === "sm" ? "h-3 w-3" : "h-4 w-4";
+ return (
+ <span
+ aria-hidden="true"
+ className={`inline-flex shrink-0 items-center justify-center bg-[var(--openui-border-default)] ${box}`}
+ >
+ <img src={`/logos/${provider.toLowerCase()}-${mode}.svg`} alt="" className={img} />
+ </span>
+ );
+}
diff --git a/examples/openui-cloud/src/components/model-switcher/TriggerContent.tsx b/examples/openui-cloud/src/components/model-switcher/TriggerContent.tsx
new file mode 100644
index 000000000..d952c600e
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/TriggerContent.tsx
@@ -0,0 +1,41 @@
+import { type ModelOption } from "@/lib/models";
+
+import { ModelBadge } from "./ModelBadge";
+import { ProviderLogo } from "./ProviderLogo";
+
+// Neutral skeleton shown until the client reads the persisted model from
+// localStorage, so a refresh doesn't flash the default model.
+function TriggerSkeleton() {
+ return (
+ <>
+ <span
+ aria-hidden="true"
+ className="h-5 w-5 shrink-0 animate-pulse rounded-md bg-[var(--openui-border-default)]"
+ />
+ <span
+ aria-hidden="true"
+ className="h-4 w-24 animate-pulse rounded bg-[var(--openui-border-default)]"
+ />
+ </>
+ );
+}
+
+export function TriggerContent({
+ option,
+ fallbackLabel,
+ hydrated,
+}: {
+ option: ModelOption | undefined;
+ fallbackLabel: string;
+ hydrated: boolean;
+}) {
+ if (!hydrated) return <TriggerSkeleton />;
+
+ return (
+ <>
+ {option ? <ProviderLogo provider={option.provider} size="sm" /> : null}
+ <span className="min-w-0 flex-1 truncate">{option?.name ?? fallbackLabel}</span>
+ {option ? <ModelBadge model={option} variant="trigger" /> : null}
+ </>
+ );
+}
diff --git a/examples/openui-cloud/src/components/model-switcher/UsagePolicy.tsx b/examples/openui-cloud/src/components/model-switcher/UsagePolicy.tsx
new file mode 100644
index 000000000..74e9c2185
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/UsagePolicy.tsx
@@ -0,0 +1,46 @@
+"use client";
+
+import { Info } from "lucide-react";
+import { useState } from "react";
+import { createPortal } from "react-dom";
+
+// The Free-tier "Usage policy" hint. A Radix Tooltip does not open when nested
+// inside the Radix Select dropdown (the Select intercepts the pointer events the
+// tooltip relies on), so this is a small state-driven tooltip portaled to the
+// body — it isn't clipped by the dropdown's overflow and opens on plain hover.
+export function UsagePolicy() {
+ const [anchor, setAnchor] = useState<{ top: number; left: number } | null>(null);
+
+ return (
+ <span
+ onMouseEnter={(event) => {
+ const rect = event.currentTarget.getBoundingClientRect();
+ setAnchor({ top: rect.top, left: rect.right });
+ }}
+ onMouseLeave={() => setAnchor(null)}
+ onClick={(event) => event.stopPropagation()}
+ className="flex cursor-default items-center gap-1 text-xs font-normal text-gray-400"
+ >
+ <Info className="h-3 w-3" />
+ Usage policy
+ {anchor && typeof document !== "undefined"
+ ? createPortal(
+ <div
+ role="tooltip"
+ // Positioned relative to the trigger; anchor coords are dynamic so
+ // stay inline. Everything else is Tailwind arbitrary values pointing
+ // at the @openuidev design tokens (same tokens globals.css uses for
+ // callouts/dialogs), so the tooltip is theme-aware and consistent.
+ style={{ position: "fixed", top: anchor.top - 8, left: anchor.left }}
+ className="z-[100000] w-[280px] -translate-x-full -translate-y-full rounded-[var(--openui-radius-l)] border border-[var(--openui-border-interactive)] bg-[var(--openui-foreground)] px-[var(--openui-space-s)] py-[var(--openui-space-xs)] text-left shadow-[var(--openui-shadow-m)]"
+ >
+ <p className="[font:var(--openui-text-body-sm)] tracking-[var(--openui-text-body-sm-letter-spacing)] text-[color:var(--openui-text-neutral-secondary)]">
+ Data from free models may be used for training. Rate limits apply.
+ </p>
+ </div>,
+ document.body,
+ )
+ : null}
+ </span>
+ );
+}
diff --git a/examples/openui-cloud/src/components/model-switcher/index.tsx b/examples/openui-cloud/src/components/model-switcher/index.tsx
new file mode 100644
index 000000000..eecb691ac
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/index.tsx
@@ -0,0 +1,90 @@
+"use client";
+
+import {
+ Select,
+ SelectContent,
+ SelectGroup,
+ SelectItem,
+ SelectLabel,
+ SelectSeparator,
+ SelectTrigger,
+} from "@openuidev/react-ui";
+import { useMemo } from "react";
+
+import { MODEL_OPTIONS } from "@/lib/models";
+
+import { ModelRow } from "./ModelRow";
+import { TriggerContent } from "./TriggerContent";
+import { UsagePolicy } from "./UsagePolicy";
+import { splitModels, useHydrated } from "./utils";
+
+interface ModelSwitcherProps {
+ selectedModel: string;
+ onModelChange: (model: string) => void;
+}
+
+export function ModelSwitcher({ selectedModel, onModelChange }: ModelSwitcherProps) {
+ const hydrated = useHydrated();
+ const selectedOption =
+ MODEL_OPTIONS.find((model) => model.id === selectedModel) ?? MODEL_OPTIONS[0];
+ const { paidGroups, freeModels } = useMemo(() => splitModels(MODEL_OPTIONS), []);
+
+ return (
+ <div className="min-w-0">
+ <Select value={selectedModel} onValueChange={onModelChange} size="sm">
+ <SelectTrigger
+ aria-label="Select model"
+ title={hydrated ? (selectedOption?.id ?? selectedModel) : undefined}
+ className="flex! h-9! w-auto! max-w-[240px]! items-center! justify-start! gap-1.5! rounded-lg! border! border-[var(--openui-border-interactive)]! bg-[var(--openui-foreground)]! px-2.5! text-sm! text-[color:var(--openui-text-neutral-primary)]! shadow-[var(--openui-shadow-s)]"
+ >
+ <TriggerContent
+ option={selectedOption}
+ fallbackLabel={selectedModel}
+ hydrated={hydrated}
+ />
+ </SelectTrigger>
+ <SelectContent
+ align="start"
+ className="max-h-[360px]! w-[min(360px,calc(100vw-32px))]! overflow-auto! rounded-[var(--openui-radius-xl)]!"
+ >
+ {paidGroups.map(([provider, providerModels], index) => (
+ <SelectGroup key={provider}>
+ {index > 0 ? <SelectSeparator /> : null}
+ {providerModels.map((model) => (
+ <SelectItem
+ key={model.id}
+ value={model.id}
+ showTick={false}
+ className="rounded-[var(--openui-radius-m)]!"
+ >
+ <ModelRow model={model} />
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ ))}
+ {freeModels.length > 0 ? (
+ <SelectGroup>
+ <SelectSeparator />
+ <SelectLabel className="flex items-center justify-between gap-2">
+ <span className="font-semibold text-[color:var(--openui-text-success-primary)]">
+ Free
+ </span>
+ <UsagePolicy />
+ </SelectLabel>
+ {freeModels.map((model) => (
+ <SelectItem
+ key={model.id}
+ value={model.id}
+ showTick={false}
+ className="rounded-[var(--openui-radius-m)]!"
+ >
+ <ModelRow model={model} />
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ ) : null}
+ </SelectContent>
+ </Select>
+ </div>
+ );
+}
diff --git a/examples/openui-cloud/src/components/model-switcher/utils.ts b/examples/openui-cloud/src/components/model-switcher/utils.ts
new file mode 100644
index 000000000..99323e005
--- /dev/null
+++ b/examples/openui-cloud/src/components/model-switcher/utils.ts
@@ -0,0 +1,58 @@
+import { useSyncExternalStore } from "react";
+
+import { type ModelOption } from "@/lib/models";
+
+// Order the paid provider groups the way the console lists them.
+export const PROVIDER_ORDER: ModelOption["provider"][] = ["Anthropic", "OpenAI", "Google"];
+// The model highlighted with a "Recommended" chip.
+export const RECOMMENDED_MODEL_ID = "anthropic/claude-sonnet-5";
+
+// Group paid models by provider (in PROVIDER_ORDER) and pull the free models
+// into their own list so the dropdown can render a dedicated "Free" section.
+export function splitModels(models: ModelOption[]): {
+ paidGroups: [string, ModelOption[]][];
+ freeModels: ModelOption[];
+} {
+ const freeModels: ModelOption[] = [];
+ const paid = new Map<string, ModelOption[]>();
+
+ for (const model of models) {
+ if (model.badge === "Free") {
+ freeModels.push(model);
+ continue;
+ }
+ const group = paid.get(model.provider) ?? [];
+ group.push(model);
+ paid.set(model.provider, group);
+ }
+
+ const paidGroups = PROVIDER_ORDER.filter((provider) => paid.has(provider)).map(
+ (provider) => [provider, paid.get(provider) as ModelOption[]] as [string, ModelOption[]],
+ );
+
+ return { paidGroups, freeModels };
+}
+
+export type ModelBadgeInfo = { label: string; kind: "recommended" | "free" };
+
+// Single source of truth for which chip a model gets (used by both the trigger
+// and the dropdown rows).
+export function getModelBadge(model: ModelOption): ModelBadgeInfo | null {
+ if (model.id === RECOMMENDED_MODEL_ID) return { label: "Recommended", kind: "recommended" };
+ if (model.badge === "Free") return { label: model.badge, kind: "free" };
+ return null;
+}
+
+// The persisted model lives in localStorage, so the server (and the first
+// client render) can only fall back to DEFAULT_MODEL. Showing that default and
+// then swapping to the stored model produces a visible flash on refresh. This
+// hook returns false on the server / during hydration and true once mounted, so
+// the trigger can render a neutral skeleton until the real value is known.
+const subscribeNoop = () => () => {};
+export function useHydrated(): boolean {
+ return useSyncExternalStore(
+ subscribeNoop,
+ () => true,
+ () => false,
+ );
+}
diff --git a/examples/openui-cloud/src/hooks/use-persisted-model.ts b/examples/openui-cloud/src/hooks/use-persisted-model.ts
new file mode 100644
index 000000000..3e773f02d
--- /dev/null
+++ b/examples/openui-cloud/src/hooks/use-persisted-model.ts
@@ -0,0 +1,45 @@
+"use client";
+
+import { useCallback, useEffect, useState } from "react";
+
+import { DEFAULT_MODEL, MODEL_OPTIONS } from "@/lib/models";
+
+// The chosen model is saved in localStorage so it survives a page refresh.
+const MODEL_STORAGE_KEY = "openui-cloud:selected-model";
+
+export function getPersistedModel(): string {
+ if (typeof window === "undefined") return DEFAULT_MODEL;
+ try {
+ const saved = window.localStorage.getItem(MODEL_STORAGE_KEY);
+ if (saved && MODEL_OPTIONS.some((option) => option.id === saved)) {
+ return saved;
+ }
+ } catch {
+ // Ignore storage failures (private mode, quota, disabled storage).
+ }
+ return DEFAULT_MODEL;
+}
+
+// Like useState, but the value is remembered across refreshes.
+export function usePersistedModel(): readonly [string, (model: string) => void] {
+
+ const [model, setModel] = useState(DEFAULT_MODEL);
+
+ useEffect(() => {
+
+ // eslint-disable-next-line react-hooks/set-state-in-effect
+ setModel(getPersistedModel());
+ }, []);
+
+ // Update the model and save the new choice to localStorage.
+ const selectModel = useCallback((next: string) => {
+ setModel(next);
+ try {
+ window.localStorage.setItem(MODEL_STORAGE_KEY, next);
+ } catch {
+ // Ignore storage failures (private mode, quota, disabled storage).
+ }
+ }, []);
+
+ return [model, selectModel] as const;
+}
diff --git a/examples/openui-cloud/src/lib/models.ts b/examples/openui-cloud/src/lib/models.ts
new file mode 100644
index 000000000..47a89f5c4
--- /dev/null
+++ b/examples/openui-cloud/src/lib/models.ts
@@ -0,0 +1,46 @@
+export const DEFAULT_MODEL = "google/gemini-3.6-flash-free";
+
+export interface ModelOption {
+ id: string;
+ name: string;
+ provider: "Anthropic" | "Google" | "OpenAI";
+ badge?: string;
+}
+
+export const MODEL_OPTIONS: ModelOption[] = [
+ { provider: "Google", id: "google/gemini-3.1-pro-free", name: "Gemini 3.1 Pro", badge: "Free" },
+ {
+ provider: "Google",
+ id: "google/gemini-3.1-flash-lite-free",
+ name: "Gemini 3.1 Flash Lite",
+ badge: "Free",
+ },
+ {
+ provider: "Google",
+ id: "google/gemini-3.6-flash-free",
+ name: "Gemini 3.6 Flash",
+ badge: "Free",
+ },
+ { provider: "Google", id: "google/gemini-3.6-flash", name: "Gemini 3.6 Flash" },
+ {
+ provider: "Google",
+ id: "google/gemini-3.5-flash-free",
+ name: "Gemini 3.5 Flash",
+ badge: "Free",
+ },
+ { provider: "Google", id: "google/gemini-3.5-flash", name: "Gemini 3.5 Flash" },
+ { provider: "Google", id: "google/gemini-3.1-pro-preview", name: "Gemini 3.1 Pro Preview" },
+ { provider: "OpenAI", id: "openai/gpt-5.5", name: "GPT-5.5" },
+ { provider: "OpenAI", id: "openai/gpt-5.4", name: "GPT-5.4" },
+ { provider: "OpenAI", id: "openai/gpt-5.4-mini", name: "GPT-5.4 mini" },
+ { provider: "OpenAI", id: "openai/gpt-5.2", name: "GPT-5.2" },
+ { provider: "OpenAI", id: "openai/gpt-5.1", name: "GPT-5.1" },
+ { provider: "OpenAI", id: "openai/gpt-5", name: "GPT-5" },
+ { provider: "Anthropic", id: "anthropic/claude-sonnet-5", name: "Claude Sonnet 5" },
+ { provider: "Anthropic", id: "anthropic/claude-sonnet-4.6", name: "Claude Sonnet 4.6" },
+ { provider: "Anthropic", id: "anthropic/claude-opus-4-7", name: "Claude Opus 4.7" },
+];
+
+export function resolveRequestedModel(model: unknown, fallback = DEFAULT_MODEL): string {
+ return typeof model === "string" && model.trim() ? model : fallback;
+}
diff --git a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ModelBadge.tsx b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ModelBadge.tsx
index 54559da25..cc67f17c9 100644
--- a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ModelBadge.tsx
+++ b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ModelBadge.tsx
@@ -2,17 +2,12 @@ import { type ModelOption } from "@/lib/models";
import { getModelBadge } from "./utils";
-// Trigger sits on a white pill; the dropdown row sits on the themed surface —
-// so the two contexts use different chip styles for the same badge.
-const BADGE_STYLES = {
- trigger: {
- recommended: "bg-indigo-100 text-indigo-700",
- free: "bg-green-100 text-green-700",
- },
- row: {
- recommended: "bg-indigo-500/15 text-indigo-400",
- free: "bg-green-500/15 text-green-400",
- },
+// Recommended = info (blue), Free = success (green), both from the @openuidev
+// design tokens. Labels use neutral primary text while the leading dot carries
+// the semantic color. Trigger and row differ only in shape/size.
+const BADGE_DOT_COLORS = {
+ recommended: "bg-[var(--openui-border-info-emphasis)]",
+ free: "bg-[var(--openui-border-success-emphasis)]",
} as const;
export function ModelBadge({
@@ -25,13 +20,24 @@ export function ModelBadge({
const badge = getModelBadge(model);
if (!badge) return null;
- const shape =
- variant === "trigger"
- ? "rounded-full px-2 py-0.5 text-[10px]"
- : "rounded-md px-2 py-0.5 text-xs";
+ if (variant === "trigger") {
+ return (
+ <span className="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-[var(--openui-border-default)] bg-transparent">
+ <span
+ aria-hidden="true"
+ className={`h-1.5 w-1.5 rounded-full ${BADGE_DOT_COLORS[badge.kind]}`}
+ />
+ <span className="sr-only">{badge.label}</span>
+ </span>
+ );
+ }
return (
- <span className={`shrink-0 font-semibold ${shape} ${BADGE_STYLES[variant][badge.kind]}`}>
+ <span className="absolute right-2 top-1/2 inline-flex -translate-y-1/2 shrink-0 items-center gap-1 rounded-full border border-[var(--openui-border-default)] bg-transparent px-2 py-0.5 text-xs font-normal text-[color:var(--openui-text-neutral-primary)]">
+ <span
+ aria-hidden="true"
+ className={`h-1.5 w-1.5 shrink-0 rounded-full ${BADGE_DOT_COLORS[badge.kind]}`}
+ />
{badge.label}
</span>
);
diff --git a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ProviderLogo.tsx b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ProviderLogo.tsx
index faa313564..d9d65c6d6 100644
--- a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ProviderLogo.tsx
+++ b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/ProviderLogo.tsx
@@ -4,25 +4,20 @@ import { useTheme } from "@/hooks/use-system-theme";
export function ProviderLogo({
provider,
- variant,
size = "md",
}: {
provider: string;
- // Force a mark variant regardless of app theme (the white trigger always
- // needs the light-background mark).
- variant?: "light" | "dark";
size?: "sm" | "md";
}) {
const mode = useTheme();
- const resolved = variant ?? mode;
const box = size === "sm" ? "h-5 w-5 rounded-md" : "h-7 w-7 rounded-lg";
const img = size === "sm" ? "h-3 w-3" : "h-4 w-4";
return (
<span
aria-hidden="true"
- className={`inline-flex shrink-0 items-center justify-center bg-black/[0.06] dark:bg-white/10 ${box}`}
+ className={`inline-flex shrink-0 items-center justify-center bg-[var(--openui-border-default)] ${box}`}
>
- <img src={`/logos/${provider.toLowerCase()}-${resolved}.svg`} alt="" className={img} />
+ <img src={`/logos/${provider.toLowerCase()}-${mode}.svg`} alt="" className={img} />
</span>
);
}
diff --git a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/TriggerContent.tsx b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/TriggerContent.tsx
index d6cc8bbeb..d952c600e 100644
--- a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/TriggerContent.tsx
+++ b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/TriggerContent.tsx
@@ -8,8 +8,14 @@ import { ProviderLogo } from "./ProviderLogo";
function TriggerSkeleton() {
return (
<>
- <span aria-hidden="true" className="h-5 w-5 shrink-0 animate-pulse rounded-md bg-gray-200" />
- <span aria-hidden="true" className="h-4 w-24 animate-pulse rounded bg-gray-200" />
+ <span
+ aria-hidden="true"
+ className="h-5 w-5 shrink-0 animate-pulse rounded-md bg-[var(--openui-border-default)]"
+ />
+ <span
+ aria-hidden="true"
+ className="h-4 w-24 animate-pulse rounded bg-[var(--openui-border-default)]"
+ />
</>
);
}
@@ -27,7 +33,7 @@ export function TriggerContent({
return (
<>
- {option ? <ProviderLogo provider={option.provider} variant="light" size="sm" /> : null}
+ {option ? <ProviderLogo provider={option.provider} size="sm" /> : null}
<span className="min-w-0 flex-1 truncate">{option?.name ?? fallbackLabel}</span>
{option ? <ModelBadge model={option} variant="trigger" /> : null}
</>
diff --git a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/UsagePolicy.tsx b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/UsagePolicy.tsx
new file mode 100644
index 000000000..74e9c2185
--- /dev/null
+++ b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/UsagePolicy.tsx
@@ -0,0 +1,46 @@
+"use client";
+
+import { Info } from "lucide-react";
+import { useState } from "react";
+import { createPortal } from "react-dom";
+
+// The Free-tier "Usage policy" hint. A Radix Tooltip does not open when nested
+// inside the Radix Select dropdown (the Select intercepts the pointer events the
+// tooltip relies on), so this is a small state-driven tooltip portaled to the
+// body — it isn't clipped by the dropdown's overflow and opens on plain hover.
+export function UsagePolicy() {
+ const [anchor, setAnchor] = useState<{ top: number; left: number } | null>(null);
+
+ return (
+ <span
+ onMouseEnter={(event) => {
+ const rect = event.currentTarget.getBoundingClientRect();
+ setAnchor({ top: rect.top, left: rect.right });
+ }}
+ onMouseLeave={() => setAnchor(null)}
+ onClick={(event) => event.stopPropagation()}
+ className="flex cursor-default items-center gap-1 text-xs font-normal text-gray-400"
+ >
+ <Info className="h-3 w-3" />
+ Usage policy
+ {anchor && typeof document !== "undefined"
+ ? createPortal(
+ <div
+ role="tooltip"
+ // Positioned relative to the trigger; anchor coords are dynamic so
+ // stay inline. Everything else is Tailwind arbitrary values pointing
+ // at the @openuidev design tokens (same tokens globals.css uses for
+ // callouts/dialogs), so the tooltip is theme-aware and consistent.
+ style={{ position: "fixed", top: anchor.top - 8, left: anchor.left }}
+ className="z-[100000] w-[280px] -translate-x-full -translate-y-full rounded-[var(--openui-radius-l)] border border-[var(--openui-border-interactive)] bg-[var(--openui-foreground)] px-[var(--openui-space-s)] py-[var(--openui-space-xs)] text-left shadow-[var(--openui-shadow-m)]"
+ >
+ <p className="[font:var(--openui-text-body-sm)] tracking-[var(--openui-text-body-sm-letter-spacing)] text-[color:var(--openui-text-neutral-secondary)]">
+ Data from free models may be used for training. Rate limits apply.
+ </p>
+ </div>,
+ document.body,
+ )
+ : null}
+ </span>
+ );
+}
diff --git a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/index.tsx b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/index.tsx
index 050c68999..eecb691ac 100644
--- a/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/index.tsx
+++ b/packages/openui-cli/src/templates/openui-cloud/src/components/model-switcher/index.tsx
@@ -15,6 +15,7 @@ import { MODEL_OPTIONS } from "@/lib/models";
import { ModelRow } from "./ModelRow";
import { TriggerContent } from "./TriggerContent";
+import { UsagePolicy } from "./UsagePolicy";
import { splitModels, useHydrated } from "./utils";
interface ModelSwitcherProps {
@@ -34,7 +35,7 @@ export function ModelSwitcher({ selectedModel, onModelChange }: ModelSwitcherPro
<SelectTrigger
aria-label="Select model"
title={hydrated ? (selectedOption?.id ?? selectedModel) : undefined}
- className="flex! h-8! w-auto! max-w-[240px]! items-center! justify-start! gap-1.5! rounded-lg! border! border-gray-200! bg-white! px-2.5! text-sm! text-gray-900! shadow-sm"
+ className="flex! h-9! w-auto! max-w-[240px]! items-center! justify-start! gap-1.5! rounded-lg! border! border-[var(--openui-border-interactive)]! bg-[var(--openui-foreground)]! px-2.5! text-sm! text-[color:var(--openui-text-neutral-primary)]! shadow-[var(--openui-shadow-s)]"
>
<TriggerContent
option={selectedOption}
@@ -44,13 +45,18 @@ export function ModelSwitcher({ selectedModel, onModelChange }: ModelSwitcherPro
</SelectTrigger>
<SelectContent
align="start"
- className="max-h-[360px]! w-[min(360px,calc(100vw-32px))]! overflow-auto!"
+ className="max-h-[360px]! w-[min(360px,calc(100vw-32px))]! overflow-auto! rounded-[var(--openui-radius-xl)]!"
>
{paidGroups.map(([provider, providerModels], index) => (
<SelectGroup key={provider}>
{index > 0 ? <SelectSeparator /> : null}
{providerModels.map((model) => (
- <SelectItem key={model.id} value={model.id}>
+ <SelectItem
+ key={model.id}
+ value={model.id}
+ showTick={false}
+ className="rounded-[var(--openui-radius-m)]!"
+ >
<ModelRow model={model} />
</SelectItem>
))}
@@ -60,19 +66,18 @@ export function ModelSwitcher({ selectedModel, onModelChange }: ModelSwitcherPro
<SelectGroup>
<SelectSeparator />
<SelectLabel className="flex items-center justify-between gap-2">
- <span className="font-semibold text-green-400">Free</span>
- <a
- href="https://openui.com/docs"
- target="_blank"
- rel="noreferrer"
- onClick={(event) => event.stopPropagation()}
- className="text-xs font-normal text-gray-400 no-underline hover:underline"
- >
- Usage policy
- </a>
+ <span className="font-semibold text-[color:var(--openui-text-success-primary)]">
+ Free
+ </span>
+ <UsagePolicy />
</SelectLabel>
{freeModels.map((model) => (
- <SelectItem key={model.id} value={model.id}>
+ <SelectItem
+ key={model.id}
+ value={model.id}
+ showTick={false}
+ className="rounded-[var(--openui-radius-m)]!"
+ >
<ModelRow model={model} />
</SelectItem>
))}