다른 컴포넌트 보기
COMPONENT / 레이아웃
Table
정렬할 수 있는 데이터 표.
| Paper | 120 | 3,000원 |
| Ink | 8 | 12,000원 |
| Ember | 45 | 7,500원 |
PLAYGROUND미리보기 안의 요소를 직접 조작해 보세요.
사용 코드
import * as W from 'woosign-system';
// ThemeProvider와 ToastProvider 안에서 렌더링하세요.
export function Example() {
return (
<W.Table
caption="팔레트 재고"
style={{ width: '100%', maxWidth: 520 }}
rowKey={(row) => row.name}
data={[
{ name: 'Paper', stock: 120, price: 3000 },
{ name: 'Ink', stock: 8, price: 12000 },
{ name: 'Ember', stock: 45, price: 7500 },
]}
columns={[
{ key: 'name', header: '이름', sortable: true },
{ key: 'stock', header: '재고', align: 'right', sortable: true },
{
key: 'price',
header: '가격',
align: 'right',
sortable: true,
render: (row) => `${row.price.toLocaleString('ko-KR')}원`,
},
]}
/>
);
}
API
타입 정의 ↗| Prop | Type | 필수 |
|---|---|---|
columns | readonly TableColumn<T>[] | ● |
data | readonly T[] | ● |
rowKey | (row: T, index: number) => string | ● |
caption | string | ● |
hideCaption | boolean | — |
emptyText | string | — |
striped | boolean | — |
sort | TableSort | null | — |
defaultSort | TableSort | null | — |
onSortChange | (sort: TableSort) => void | — |
공통 API 기준입니다. 플랫폼별 style, className 및 세부 타입은 타입 정의에서 확인하세요.
← 전체 컴포넌트로 돌아가기