### Start Playground
Source: https://github.com/kobaltedev/kobalte/blob/main/CONTRIBUTING.md
Starts the local development server for the Kobalte playground.
```bash
pnpm dev:core
```
--------------------------------
### Basic Context Menu Example
Source: https://github.com/kobaltedev/kobalte/blob/main/apps/docs/src/routes/docs/core/components/context-menu.mdx
Demonstrates the basic structure and usage of the Context Menu component. Includes standard items, disabled items, submenus, checkboxes, radio groups, and custom styling via CSS classes. Ensure 'some-icon-library' is installed for icons.
```tsx
import { ContextMenu } from "@kobalte/core/context-menu";
import { createSignal } from "solid-js";
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "some-icon-library";
import "./style.css";
function App() {
const [showGitLog, setShowGitLog] = createSignal(true);
const [showHistory, setShowHistory] = createSignal(false);
const [branch, setBranch] = createSignal("main");
return (
);
}
```
--------------------------------
### Install @kobalte/utils
Source: https://github.com/kobaltedev/kobalte/blob/main/packages/utils/README.md
Install the @kobalte/utils package using npm, yarn, or pnpm.
```bash
npm install @kobalte/utils
# or
yarn add @kobalte/utils
# or
pnpm add @kobalte/utils
```
--------------------------------
### Start Documentation Server
Source: https://github.com/kobaltedev/kobalte/blob/main/CONTRIBUTING.md
Starts the local development server for the Kobalte documentation.
```bash
pnpm dev:docs
```
--------------------------------
### Basic Combobox Example
Source: https://github.com/kobaltedev/kobalte/blob/main/apps/docs/src/routes/docs/core/components/combobox.mdx
Demonstrates a basic Combobox with a list of fruits. It includes input for searching and displays a checkmark for selected items. Ensure you have an icon library like 'some-icon-library' installed for the icons to render.
```tsx
import { Combobox } from "@kobalte/core/combobox";
import { CaretSortIcon, CheckIcon } from "some-icon-library";
import { createSignal } from "solid-js";
import "./style.css";
const ALL_OPTIONS = ["Apple", "Banana", "Blueberry", "Grapes", "Pineapple"];
function App() {
return (
(
{props.item.rawValue}
)} >
);
}
```
```css
.combobox__control {
display: inline-flex;
justify-content: space-between;
width: 200px;
border-radius: 6px;
font-size: 16px;
line-height: 1;
outline: none;
background-color: white;
border: 1px solid hsl(240 6% 90%);
color: hsl(240 4% 16%);
transition: border-color 250ms, color 250ms;
}
.combobox__control[data-invalid] {
border-color: hsl(0 72% 51%);
color: hsl(0 72% 51%);
}
.combobox__control_multi {
width: 100%;
min-width: 200px;
max-width: 300px;
}
.combobox__input {
appearance: none;
display: inline-flex;
min-width: 0;
min-height: 40px;
padding-left: 16px;
font-size: 16px;
background: transparent;
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
outline: none;
}
.combobox__input::placeholder {
color: hsl(240 4% 46%);
}
.combobox__trigger {
appearance: none;
display: inline-flex;
justify-content: center;
align-items: center;
width: auto;
outline: none;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
padding: 0 10px;
background-color: hsl(240 5% 96%);
border-left: 1px solid hsl(240 6% 90%);
color: hsl(240 4% 16%);
font-size: 16px;
line-height: 0;
transition: 250ms background-color;
}
.combobox__icon {
height: 20px;
width: 20px;
flex: 0 0 20px;
}
.combobox__description {
margin-top: 8px;
color: hsl(240 5% 26%);
font-size: 12px;
user-select: none;
}
.combobox__error-message {
margin-top: 8px;
color: hsl(0 72% 51%);
font-size: 12px;
user-select: none;
}
.combobox__content {
background-color: white;
border-radius: 6px;
border: 1px solid hsl(240 6% 90%);
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
transform-origin: var(--kb-combobox-content-transform-origin);
animation: contentHide 250ms ease-in forwards;
}
.combobox__content[data-expanded] {
animation: contentShow 250ms ease-out;
}
.combobox__listbox {
overflow-y: auto;
max-height: 360px;
padding: 8px;
}
.combobox__listbox:focus {
outline: none;
}
.combobox__item {
font-size: 16px;
line-height: 1;
color: hsl(240 4% 16%);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 8px;
position: relative;
user-select: none;
outline: none;
}
.combobox__item[data-disabled] {
color: hsl(240 5% 65%);
opacity: 0.5;
pointer-events: none;
}
.combobox__item[data-highlighted] {
outline: none;
background-color: hsl(200 98% 39%);
color: white;
}
.combobox__section {
padding: 8px 0 0 8px;
font-size: 14px;
line-height: 32px;
color: hsl(240 4% 46%);
}
.combobox__item-indicator {
height: 20px;
}
```
--------------------------------
### Basic Menubar Example
Source: https://github.com/kobaltedev/kobalte/blob/main/apps/docs/src/routes/docs/core/components/menubar.mdx
Demonstrates the basic structure of a Menubar with nested submenus, checkboxes, and radio groups. Ensure you have an icon library like 'some-icon-library' installed for icons like CheckIcon, ChevronRightIcon, and DotFilledIcon. The CSS classes like 'menubar__root', 'menubar__item', etc., are used for styling and should be defined in './style.css'.
```tsx
import { Menubar } from "@kobalte/core/menubar";
import { createSignal } from "solid-js";
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "some-icon-library";
import "./style.css";
function App() {
const [showGitLog, setShowGitLog] = createSignal(true);
const [showHistory, setShowHistory] = createSignal(false);
const [branch, setBranch] = createSignal("main");
return (