一键导入
origin
Use when building UI with @lightsparkdev/origin design system components. Covers setup, component APIs, icons, tokens, and patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when building UI with @lightsparkdev/origin design system components. Covers setup, component APIs, icons, tokens, and patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | origin |
| description | Use when building UI with @lightsparkdev/origin design system components. Covers setup, component APIs, icons, tokens, and patterns. |
Origin is a Figma-first React component library built on Base UI. It ships as raw TypeScript + SCSS source and requires a Next.js consumer with transpilePackages.
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
transpilePackages: ['@lightsparkdev/origin'],
};
export default nextConfig;
import "@lightsparkdev/origin/styles.css";
If you need Origin mixins in your own SCSS files, enable Sass package imports:
import type { NextConfig } from "next";
import * as sass from "sass";
const nextConfig: NextConfig = {
transpilePackages: ['@lightsparkdev/origin'],
sassOptions: {
importers: [new sass.NodePackageImporter()],
},
};
export default nextConfig;
If adding a resolve.alias for @lightsparkdev/origin, always use the exact-match $ suffix:
config.resolve.alias['@lightsparkdev/origin$'] = '/path/to/src/index.ts';
Without $, the alias hijacks subpath imports and breaks @lightsparkdev/origin/styles.css.
Copy fonts from the package into your app's public directory:
cp -r node_modules/@lightsparkdev/origin/public/fonts/ public/fonts/
The @font-face declarations expect fonts served at /fonts/. Includes Suisse Intl (Regular 400, Book 450, Medium 500) and Suisse Int'l Mono.
npm install @lightsparkdev/origin sass
sass is required (not optional) — every component imports SCSS modules.
All components are exported from the package root:
import { Button, Dialog, CentralIcon, Tabs } from '@lightsparkdev/origin';
These use dot notation for sub-components:
<Dialog.Root>
<Dialog.Trigger>Open</Dialog.Trigger>
<Dialog.Portal>
<Dialog.Backdrop />
<Dialog.Popup>
<Dialog.Title>Title</Dialog.Title>
<Dialog.Description>Body text</Dialog.Description>
<Dialog.Close>Close</Dialog.Close>
</Dialog.Popup>
</Dialog.Portal>
</Dialog.Root>
Compound components: Accordion, AlertDialog, Autocomplete, Breadcrumb, Card, Checkbox, Combobox, Command, ContextMenu, Dialog, Field, Fieldset, InputGroup, Menu, Menubar, Meter, NavigationMenu, Pagination, PhoneInput, Popover, Progress, Radio, Select, Sidebar, Table, Tabs, TextareaGroup, Toast, Tooltip.
<Button variant="filled" size="default" leadingIcon={<CentralIcon name="IconPlusSmall" size={16} />}>
Create
</Button>
Simple components: ActionBar, Alert, Avatar, Badge, Button, ButtonGroup, Chip, ChipFilter, Form, Input, Item, Loader, Logo, Separator, Shortcut, Switch, Textarea, Toggle, ToggleGroup, VisuallyHidden.
import { Chart } from '@lightsparkdev/origin';
<Chart.Line data={data} series={series} />
<Chart.Bar data={data} series={series} />
<Chart.Pie segments={segments} />
<Chart.Sparkline data={data} />
<Chart.StackedArea data={data} series={series} />
<Chart.Composed data={data} series={series} />
<Chart.Live data={data} />
<Chart.Gauge value={75} />
<Chart.BarList items={items} />
interface ButtonProps {
variant?: 'filled' | 'secondary' | 'outline' | 'ghost' | 'critical' | 'link';
size?: 'default' | 'compact' | 'dense';
loading?: boolean;
loadingIndicator?: ReactNode;
leadingIcon?: ReactNode;
trailingIcon?: ReactNode;
iconOnly?: boolean;
}
Use CentralIcon with a name prop. All icon names are typed via CentralIconName.
import { CentralIcon } from '@lightsparkdev/origin';
<CentralIcon name="IconArrowRight" size={24} color="currentColor" />
<CentralIcon name="IconCircleCheckFilled" size={16} />
Props: name (required), size (default 24), color (default "currentColor"), className, style.
Strokes scale proportionally with size (1.5px stroke at 24px becomes ~1px at 16px).
Common icon names by category:
Tokens are CSS custom properties defined in _variables.scss. Use them via var():
--spacing-xs (8px), --spacing-sm (12px), --spacing-md (16px), --spacing-lg (20px), --spacing-xl (24px), --spacing-2xl (32px)--corner-radius-xs, --corner-radius-sm (6px), --corner-radius-md, --corner-radius-lg, --corner-radius-full--surface-primary, --surface-secondary, --surface-hover, --text-primary, --text-secondary, --text-tertiary, --border-primary, --border-secondary, --border-critical--font-size-base (14px), --font-family-sans, --font-weight-book, --font-weight-medium, --font-weight-boldAvailable via @use 'pkg:@lightsparkdev/origin/tokens/mixins' as *;:
@include smooth-corners($radius) — border-radius with future squircle support@include surface-with-hover($base) — background with hover overlay@include input-focus — standard input focus state (border + shadow)@include input-critical — error state (red border + pink shadow)@include button-reset — strip default button styles@include visually-hidden — accessible screen-reader-only content@include text-label — standard label text style'use client' — they are client components@base-ui/react primitives.module.scss files) with SCSS