Requirements
Kobalte 2 requires Solid 2.0. Install solid-js and @solidjs/web at version ^2.0.0 and point your JSX import source at @solidjs/web:
{ "compilerOptions": { "jsx": "preserve", "jsxImportSource": "@solidjs/web" }}Using Solid 1.x? Stay on Kobalte 0.13.x. Upgrading from Kobalte 0.13? See the v2.0.x changelog.
Installation
Install Kobalte by running:
npm i @kobalte/core solid-js @solidjs/webpnpm add @kobalte/core solid-js @solidjs/webyarn add @kobalte/core solid-js @solidjs/webbun add @kobalte/core solid-js @solidjs/webdeno add npm:@kobalte/core solid-js @solidjs/webUsing the components
The example below demonstrate how to create a Popover component with Kobalte.
import { Popover } from "@kobalte/core/popover";import { CrossIcon } from "some-icon-library";import "./style.css";
function App() { return ( <Popover> <Popover.Trigger class="popover__trigger">Learn more</Popover.Trigger> <Popover.Portal> <Popover.Content class="popover__content"> <Popover.Arrow /> <div class="popover__header"> <Popover.Title class="popover__title">About Kobalte</Popover.Title> <Popover.CloseButton class="popover__close-button"> <CrossIcon /> </Popover.CloseButton> </div> <Popover.Description class="popover__description"> A UI toolkit for building accessible web apps and design systems with SolidJS. </Popover.Description> </Popover.Content> </Popover.Portal> </Popover> );}.popover__trigger { appearance: none; display: inline-flex; justify-content: center; align-items: center; height: 40px; width: auto; outline: none; border: none; border-radius: 6px; padding: 0 16px; background-color: hsl(200 98% 39%); color: white; font-size: 16px; line-height: 0; transition: 250ms background-color;}
.popover__trigger:hover { background-color: hsl(201 96% 32%);}
.popover__trigger:focus-visible { outline: 2px solid hsl(200 98% 39%); outline-offset: 2px;}
.popover__trigger:active { background-color: hsl(201 90% 27%);}
.popover__content { z-index: 50; max-width: min(calc(100vw - 16px), 380px); border: 1px solid hsl(240 5% 84%); border-radius: 6px; padding: 12px; background-color: white; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);}
.popover__header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px;}
.popover__close-button { height: 16px; width: 16px; color: hsl(240 5% 34%);}
.popover__title { font-size: 16px; font-weight: 500; color: hsl(240 6% 10%);}
.popover__description { font-size: 14px; color: hsl(240 5% 26%);}In a few lines of code, we've implemented a fully accessible Popover component that:
- Adheres to WAI-ARIA Dialog design pattern.
- Can be controlled or uncontrolled.
- Optionally render a pointing arrow.
- Has focus fully managed and customizable.
Last updated: 11/28/26, 4:40 PM