logo

S2

  • Manual
  • API
  • Examples
  • Playground
  • ChangeLog
  • Productsantv logo arrow
  • 2.x
  • Introduction
  • Quick Start
  • Basic Tutorial
    • Base Concept
    • Sheet Type
      • Pivot Mode
        Updated
      • Table Mode
    • Conditions
      Updated
    • Totals
    • Sort
      • Custom Sort
        Updated
      • Group Sort
        Updated
    • Theme
      Updated
    • Tooltip
      Updated
    • Internationalization
    • 数据格式化
      New
    • Multi Line
      New
    • Pagination
      New
  • Advanced Tutorial
    • Advanced Tutorial
      • Link
      • Render Chart In Cell
      • Draw Chart With @antv/g2
    • Custom
      • Customize Hook
        Updated
      • Customize Tree
        New
      • Customize Icon
      • Customize Cell Alignment
      • Customize Cell Size
        Updated
      • Customize Order
      • Custom Collapse/Expand Nodes
    • Interaction
      • Basic Interaction
      • Custom Interaction
      • Hide Columns
      • Cell Resize
      • Merge Cell
      • Scroll
      • Copy
        New
      • Highlight and select cell
        New
    • Analyze Component
      • Introduction
        New
      • Advanced Sort
        Updated
      • Switcher
      • Export
        Updated
      • Pagination
      • Drill Down
    • Sheet Component
      • Editable Mode
      • Strategy Sheet
        Updated
    • HD Adapter
    • Get Instance
    • Get Cell Data
      Updated
    • Table adaptive
    • AntV/G Plugins
      New
    • Pivot Chart
      Experimental
    • Vue 3.0
  • Extended Reading
    • Data Process
      • Pivot
      • Table
    • Layout
      • Pivot
      • Table
    • Performance
      Updated
  • Contribution
  • FAQ
  • S2 2.0 Migration Guide

Customize Hook

Previous
Draw Chart With @antv/g2
Next
Customize Tree

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Custom Hook allows developers to rewrite all elements of the table, and you can customize certain elements according to product needs, such as corner headers, column headers, row headers, cells, row header order, cell position, etc. If necessary, you can completely rewrite a pivot table that belongs to you!

layoutArrange

The order of rows and columns can be set manually, which is suitable for local adjustment and irregular adjustment. For example, specify a row at the beginning of the row, and specify a column at the end of the column. example .

layoutCoordinate

It is used to change the size (length, width) and coordinates (x, y) of row and column leaf nodes, such as changing row height and column width, etc. example .

layoutCellMeta

Dynamically change the positioning of data and revise the value of some grids. example .

layout Hierarchy

Special scenarios for manually controlling the addition and deletion of row and column structures. example .

headerActionIcons

Set the action point icon of the row header or column header, such as the trend pop-up window of the field, the drill-down of the field, etc. example .

customSVGIcons

Custom icons. When the icons provided by S2 do not meet the requirements, developers can define their own icons for the icon display on the pivot table. example

dataCell

To change the default implementation of data cells, you need to inherit from dataCell and override some methods, such as font style, background style, etc. example

rowCell

To change the default implementation of row header cells, you need to inherit from rowCell and override some methods, such as font style, background style, etc. example

colCell

To change the default implementation of column header cells, you need to inherit from colCell and override some methods, such as font style, background style, etc. example

cornerCell

To change the default implementation of corner cells, you need to inherit from cornerCell and override some methods, such as font style, background style, etc. example

cornerHeader

To change the default implementation of corner headers, you need to inherit from Group and override certain methods, such as rendering content replacement. example

frame

Modify the default implementation of the framework, such as modifying dividing lines, shadows, scroll bars, etc. example