### Start SolidStart Development Server
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/README.md
After installing dependencies, use `npm run dev` to start the development server. Add `-- --open` to automatically open the app in a new browser tab.
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
--------------------------------
### Install Package
Source: https://github.com/kobaltedev/solidbase/blob/main/dev/src/routes/pm.mdx
Installs the specified package.
```package-install
@kobalte/solidbase
```
--------------------------------
### Install @kobalte/solidbase
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/src/routes/guide/(1)add-to-existing.mdx
Run this command in your project's root directory to install the SolidBase package.
```bash
npm install @kobalte/solidbase
# or
yarn add @kobalte/solidbase
# or
pnpm add @kobalte/solidbase
```
--------------------------------
### Install Development Package
Source: https://github.com/kobaltedev/solidbase/blob/main/dev/src/routes/pm.mdx
Installs a package for development purposes.
```package-install-dev
dev
```
--------------------------------
### F# Console Logging Example
Source: https://github.com/kobaltedev/solidbase/blob/main/dev/src/routes/ec.mdx
Demonstrates F# code for logging a value to the console using Fable.Core. This example includes line number and collapse directives.
```fsharp
namespace FSharpBetter
open Fable.Core
let ``don't look at that`` value = JS.console.log value
"please" |> ``don't look at that``
```
--------------------------------
### Tab Group with Content
Source: https://github.com/kobaltedev/solidbase/blob/main/dev/src/routes/ec.mdx
Example of a tab group containing simple text content for different tabs.
```markdown
::::tab-group[key]
::: [a.tsx]
Hey I'm A
:::
::: [b.tsx]
Hi this is B
:::
::::
```
--------------------------------
### SolidBaseApp with Twoslash Type Checking
Source: https://github.com/kobaltedev/solidbase/blob/main/dev/src/routes/ec.mdx
Example demonstrating Twoslash type checking within a SolidJS component.
```tsx
const test: 4 | 44 | 444 = 4;
```
--------------------------------
### Preview Accordion Example
Source: https://github.com/kobaltedev/solidbase/blob/main/dev/src/routes/preview.mdx
Renders a preview of the Accordion component. This snippet is used within the 'Preview With Code Tabs' section.
```tsx
import { Accordion } from "@kobalte/core/accordion";
import { ChevronDownIcon } from "some-icon-library";
import "./style.css";
function App() {
return (
Is it accessible?
Yes. It adheres to the WAI-ARIA design pattern.
Is it unstyled?
Yes. It's unstyled by default, giving you freedom over the look and feel.
Can it be animated?
Yes! You can animate the Accordion with CSS or JavaScript.
);
}
```
--------------------------------
### SolidBase Routes Configuration Helpers
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/src/routes/reference/runtime-api.mdx
Provides helpers for accessing and manipulating route configurations based on the current 'routes' selection. Includes functions to get current selection, construct paths, and retrieve valid options for a given axis.
```typescript
function useSolidBaseRoutes(): {
routes: SolidBaseRoutesConfig | undefined;
current: Accessor;
path(selection: Partial): `/${string}` | undefined;
options(
axis: string,
selection?: Partial,
): SolidBaseRouteOption[];
};
type SolidBaseRouteSelection = Record;
type SolidBaseRouteOption = {
name: string;
axis: string;
path?: string;
href?: string;
isExternal: boolean;
selection?: SolidBaseRouteSelection;
meta: SolidBaseRouteValueConfig;
};
```
--------------------------------
### Get Current Theme
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/src/routes/reference/runtime-api.mdx
Returns the current theme ('light' or 'dark') as determined by the theme cookie and system preferences.
```typescript
function getTheme(): "light" | "dark";
```
--------------------------------
### Get Theme Variant
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/src/routes/reference/runtime-api.mdx
Indicates whether the current theme is being derived from system preferences. Useful for theme switchers.
```typescript
function getThemeVariant(): "light" | "dark" | "system";
```
--------------------------------
### Get Locale Root Path
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/src/routes/reference/runtime-api.mdx
Returns the root path for a specified locale. This is the base URL for a given language.
```typescript
function getLocaleLink(locale: ResolvedLocale): `/${string}`;
```
--------------------------------
### Preview with Thematic Break and Code Tabs
Source: https://github.com/kobaltedev/solidbase/blob/main/docs/src/routes/guide/features/(0)markdown.mdx
Incorporate a thematic break (`---`) within a `preview` directive to add a lower panel for supporting content, such as code examples in tabs. This allows for a more comprehensive presentation of components and their associated code.
```mdx
:::preview
---
```tsx tab title="index.tsx"
export function PreviewCard() {
return (