Skip to content
プロジェクト

概要

SolidJS向けのヘッドレスUI

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
0
7日間
-1
15日間
-1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Terracotta

Headless UI components for SolidJS. Terracotta handles state, keyboard interaction, focus and ARIA wiring. It adds no styles and no class names. Component state reaches your CSS through tc- attributes.

The components follow the WAI-ARIA Authoring Practices.

Install

pnpm add terracotta
# or
npm i terracotta
# or
yarn add terracotta

Terracotta 2 targets Solid 2 (^2.0.0). solid-js and @solidjs/web are peer dependencies. For Solid 1, install terracotta@1 from the 1.x branch.

Usage

Every component has its own entry point and is built from parts you compose:

import { Disclosure, DisclosureButton, DisclosurePanel } from 'terracotta/disclosure';

function Details() {
  return (
    <Disclosure defaultOpen={false}>
      <DisclosureButton class="trigger">Details</DisclosureButton>
      <DisclosurePanel class="panel">Everything worth knowing.</DisclosurePanel>
    </Disclosure>
  );
}

Style it by selecting on state:

.trigger[tc-expanded] {
  font-weight: 600;
}

Documentation

Components

Accordion Dialog Spinbutton
Alert Disclosure Splitter
AlertDialog Feed Switch
Breadcrumb Grid Tabs
Button Listbox Toast
Checkbox Menu Toggle
ColorScheme Meter Toolbar
Combobox Popover Tooltip
Command RadioGroup Transition
CommandBar Select Tree
ContextMenu Slider TreeGrid

Claude Code plugin

The repository is also a Claude Code plugin marketplace. Its skill teaches an agent the component parts, imports, state and styling attributes:

/plugin marketplace add lxsmnsyc/terracotta
/plugin install terracotta@terracotta

Development

The documentation site in docs/ uses the library from the workspace, so build the library first:

pnpm install
pnpm --filter terracotta build
pnpm --filter @terracotta/docs dev

FAQ

Is this the official Headless UI for SolidJS?

No. Terracotta started as a port of Headless UI, but it is not an official port, and it has since grown to cover the WAI-ARIA widgets that Headless UI does not.

Is it API-compatible with Headless UI?

No. SolidJS and React work differently, so the component APIs differ, and some Headless UI features have no equivalent here.

License

MIT © lxsmnsyc

関連プロジェクトを探す

読み込み中…