table-state
하는 일
이 스킬은 페이지네이션 같은 테이블 상태의 각 부분을 테이블이 제어할지 내 코드가 제어할지 정하는 방법을 설명합니다. 테이블과 앱이 그 값에 대해 합의해야 하는 개발자를 위한 것입니다.
사용하는 경우
- ✓테이블을 직접 제어하지 않고 페이지 크기 같은 시작 상태만 정하고 싶을 때.
- ✓특정 상태 항목을 직접 제어하면서 그 변경을 테이블에 다시 전달해야 할 때.
- ✓테이블 상태 변경이 기대한 대로 유지되거나 초기화되지 않을 때.
스킬 링크
https://github.com/TanStack/table/blob/main/packages/table-core/skills/table-state/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“테이블이 페이지 크기 25로 시작하되 페이지는 스스로 바꿀 수 있게 하려면 어떻게 설정하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
테이블이 소유하는 항목은 초기 값을 설정하는 방법, 제어되는 항목은 값과 변경 콜백을 모두 받는 방법, 테이블의 함수로 상태를 초기화하는 방법을 보여줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Shared table state
Read core first for stable model inputs and feature-gated types. State repair in an existing table can start here without adapter setup guidance.
Start with internal ownership
Omit state, atoms, and on<Slice>Change for slices that Table should own. Use initialState only to customize their initial values.
import {
constructTable,
createColumnHelper,
rowPaginationFeature,
tableFeatures,
} from '@tanstack/table-core'
import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
type Person = { id: string; name: string }
const features = tableFeatures({
coreReactivityFeature: storeReactivityBindings(),
rowPaginationFeature,
})
const helper = createColumnHelper<typeof features, Person>()
const columns = helper.columns([helper.accessor('name', {})])
const data: Person[] = [{ id: '1', name: 'Ada' }]
const table = constructTable({
features,
columns,
data,
initialState: { pagination: { pageIndex: 0, pageSize: 25 } },
})
table.setPageSize(50)
console.log(table.atoms.pagination.get().pageSize)
table.resetPagination()
console.log(table.atoms.pagination.get().pageSize)
This example demonstrates state only. A pagination row-model slot is needed when Table should also slice the data.
Choose one owner per slice
| Owner | Configuration | Update path |
|---|---|---|
| Table | Omit external values; optionally provide initialState.<slice> |
Feature setter or interaction handler |
| Framework state | Current state.<slice> plus matching on<Slice>Change |
Callback applies the updater and the adapter receives the fresh value |
| External atom | Stable writable atoms.<slice> |
Feature setters write directly to that atom; no matching callback is needed |
Prefer the smallest set of externally owned slices. Load the adapter's table-state skill before selecting framework state or an external atom package. Native signals, runes, refs, tracked properties, and Store atoms have different adapter wiring.
An updater can be a value or a function of the previous value. In a custom callback, use functionalUpdate(updater, previousValue) from @tanstack/table-core and write the result to the owner. Supplying only on<Slice>Change replaces the internal updater without returning a current controlled value; supplying only state.<slice> leaves no effective external update path.
If both atoms.<slice> and state.<slice> are supplied, the external atom wins. Choose one owner deliberately; writing an internal base atom cannot change a slice resolved from an external atom.
Distinguish state reads and writes
table.baseAtomscontains internal writable atoms created from resolved initial state. Prefer feature setters; direct base-atom writes bypass feature-specific behavior.table.atomscontains readonly resolved atoms per registered slice.table.atoms.pagination.get()reads whichever owner supplies pagination.table.storeis the readonly flat combination of resolved slices.table.store.statereads its current snapshot.table.state, where an adapter exposes it, is adapter-selected state. Its presence and subscription behavior are not shared core contracts.
A feature must be registered before its state appears in initialState, state, atoms, baseAtoms, or store. Let the concrete feature registry infer TableState; import a slice type such as PaginationState for an external owner instead of widening the complete state.
A direct atom/store read is not a portable framework subscription. Its tracking depends on the adapter and the scope of the read. For reactive UI, load intent load <package>#table-state using the installed adapter package, for example intent load @tanstack/react-table#table-state. Use that skill's supported read and subscription APIs.
Initialization and resets
initialState resolves at construction. Changing the supplied object later does not reset the table. Keep the registered features and external atom identities stable for the instance lifetime.
Feature resets such as `r
자주 묻는 질문
상태를 항상 직접 제어해야 하나요?
아닙니다. 테이블이 소유해야 하는 항목은 상태를 생략하고, initialState는 시작 값으로만 쓰라고 이 스킬은 설명합니다.
한 상태 항목에 소유자가 둘일 수 있나요?
아닙니다. 항목마다 소유자를 하나만 정해야 한다고 설명합니다.
이 스킬이 프레임워크별 반응형 읽기도 다루나요?
아닙니다. 공통 소유 규칙을 다루며, 반응형 읽기는 어댑터의 상태 스킬을 참고하라고 안내합니다.
상세 정보
작성자의 원본 설명
Choose Table v9 state ownership, atoms, initialization, updates, and resets. Load for controlled slices or state coordination; use the adapter state skill for reactive reads.
repo: TanStack/table
인기도
- GitHub 스타
- 29k
- 순위
- #9838
- 라이선스
- MIT
- 업데이트
- 2026. 10. 21.
댓글
- …
이 저장소의 다른 스킬
getting-started
29k에이전트가 Alpine.js에서 TanStack Table로 데이터 표를 만들고 표시하는 방법을 가르칩니다. 설정, 반응형 데이터, 행 렌더링을 다룹니다.
table-state
29k에이전트가 Alpine.js에서 현재 페이지 같은 표의 상태를 읽고 제어하도록 가르칩니다. 상태가 바뀌면 화면도 함께 업데이트됩니다.
devtools
29k에이전트가 Angular 표를 TanStack Devtools 패널에 등록하는 방법을 가르칩니다. 개발자가 앱을 만드는 동안 각 표를 점검할 수 있게 합니다.
getting-started
29k에이전트가 Angular에서 TanStack 표를 만들고 표시하는 방법을 가르칩니다. injectTable 설정, 템플릿 렌더링, 행 데이터 업데이트를 다룹니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.