LiftDesign System
Beta
English 시작하기
  1. Components
  2. Product
  3. BarChart

Components / Product

BarChart — 구현

범주별 값 비교

Context
Product
콘텐츠
원본 발췌
사용 가능성
implemented
검증
static-only 2026-11-18
기준 revision
Lift 1.2.3 6f50499aa095…
원문 언어
KO
barchart.md ↗

지원 환경

Lift 1.2.3 의 참조 구현은 React 18 함수 컴포넌트다. 스타일은 인라인이고 색은 Product 토큰(hsl(var(--*)))을 참조하므로 styles.product.css 가 로드돼 있어야 한다. npm 패키지와의 대응은 이 저장소에서 확인하지 못했다.

API

components/_types.d.ts 의 BarChartProps 를 그대로 옮겼다.

proptypedefaultdoc
dataBarDatum[]—
orientation"vertical" | "horizontal"—
palette"brand" | "categorical"—기본 "brand" — 브랜드 스케일 한 계열(--chart-brand-1…5). 계열이 다른 항목만 "categorical".
heightnumber—
maxnumber—
unitstring—
titlestring—
valueFormat(value: number) => string—
showValuesboolean—
styleReact.CSSProperties—

BarDatum

fieldtypedefaultdoc
label requiredstring—
value requirednumber—
colorstring—

코드

가져오기 한 줄과 사용 지침 원문의 예시 코드다.

jsx · import
import { BarChart } from "./components/data/BarChart.jsx";
jsx · BarChart.prompt.md
<BarChart title="모델별 정확도" unit="%" data={[{label:"solar-pro3",value:92.4},{label:"solar-pro2",value:88.1}]} />
<BarChart orientation="horizontal" title="문서 유형 분포" palette="categorical" data={rows} />
tsx · BarChart.prompt.md
// ✗ Recharts 기본 툴팁. 항목 글자가 계열 색(라임)이다
<Tooltip />
// ✓ 항목과 제목 글자를 중립 토큰으로 덮는다. 앱 공통 프리셋 하나로 모든 차트에 적용한다
<Tooltip itemStyle={{ color: "hsl(var(--popover-foreground))" }} labelStyle={{ color: "hsl(var(--popover-foreground))" }} />

토큰 연결

구현 파일이 var() 로 직접 참조하는 토큰. 조건에 따라 이름을 조립하는 토큰(예: --state-${tone}-fg)은 빠진다.

--border, --chart-, --chart-brand-, --duration-normal, --ease-decelerate, --font-sans, --foreground, --muted, --muted-foreground

출처