
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@ibsheet/react
Advanced tools
A React wrapper component for IBSheet, providing a seamless integration of IBSheet spreadsheet functionality into React applications.
A React wrapper component for IBSheet, providing a seamless integration of IBSheet spreadsheet functionality into React applications.
Make sure you have IBSheet library loaded in your project before using this component.
Using npm:
npm install @ibsheet/react
Using yarn:
yarn add @ibsheet/react
import { IBSheetReact, type IBSheetInstance, type IBSheetOptions } from '@ibsheet/react';
function App() {
let mySheet: IBSheetInstance;
const options: IBSheetOptions = {
// Your IBSheet configuration options
Cfg: {
SearchMode: 2,
HeaderMerge: 3
},
Cols: [
{ Header: "ID", Type: "Text", Name: "sId" },
{ Header: "Name", Type: "Text", Name: "name" },
{ Header: "Age", Type: "Int", Name: "age" }
]
};
const data = [
{ sId: "1", name: "John Doe", age: 30 },
{ sId: "2", name: "Jane Smith", age: 25 }
];
const getInstance = (sheet) => {
mySheet = sheet;
};
return (
<div>
<IBSheetReact
options={options}
data={data}
instance={getInstance}
/>
</div>
);
}
export default App;
Example: https://stackblitz.com/edit/vitejs-vite-ejncmlbw
import {
IBSheetReact,
IB_Preset,
type IBSheetInstance,
type IBSheetOptions,
type IBSheetEvents
} from '@ibsheet/react';
const handleAfterChange: IBSheetEvents['onAfterChange'] = (param) => {
// The type of the parameter is automatically inferred.
console.log('Data changed value:', param.val);
};
function App() {
let mySheet: IBSheetInstance;
const options: IBSheetOptions = {
// Your IBSheet configuration options
Cfg: {
SearchMode: 2,
HeaderMerge: 3
},
Cols: [
{ Header: "ID", Type: "Text", Name: "sId" },
{ Header: "Name", Type: "Text", Name: "name" },
{ Header: "Age", Type: "Int", Name: "age" },
{ Header: "Ymd", Name: "sDate_Ymd", Extend: IB_Preset.YMD, Width: 110 }
],
Events: {
onAfterChange: handleAfterChange
}
}
const data = [
// Your data
{ sId: '1', name: 'John Doe', age: 30, sDate_Ymd:'20250923' },
{ sId: '2', name: 'Jane Smith', age: 25, sDate_Ymd:'20251002' }
];
const getInstance = (sheet: IBSheetInstance) => {
// You can store the sheet instance or perform initial operations
mySheet = sheet;
};
const handleAddRow = () => {
if (mySheet) {
mySheet.addRow();
}
};
const handleExportExcel = () => {
if (mySheet) {
// exportData method requires the jsZip library
// When checking for the jsZip library, if it hasn't been loaded separately, the file at ./plugins/jszip.min.js (relative to ibsheet.js) will be loaded automatically.
mySheet.exportData({fileName:'ibsheet_react_export_example.xlsx'})
}
};
const customStyle = {
width: '100%',
height: '600px',
border: '1px solid #ccc'
};
return (
<div>
<div>
<button onClick={handleAddRow}>Add Row</button>
<button onClick={handleExportExcel}>Export Excel</button>
</div>
<IBSheetReact
options={options}
data={data}
style={customStyle}
instance={getInstance}
/>
</div>
);
}
Example: https://stackblitz.com/edit/vitejs-vite-bsfserm2
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
options | IBSheetOptions | ✅ | - | IBSheet configuration options |
data | any[] | ❌ | [] | Initial data for the spreadsheet |
sync | boolean | ❌ | false | Enable data synchronization |
style | React.CSSProperties | ❌ | { width: '100%', height: '800px' } | Container styling |
instance | (sheet: IBSheetInstance) => void | ❌ | - | Callback when sheet instance is created |
exgSheet | IBSheetInstance | ❌ | - | Existing IBSheet instance to reuse |
const App: React.FC = () => {
existingSheet?: IBSheetInstance;
useEffect(() => {
// Reuse IBSheet instances created elsewhere
this.existingSheet = someExistingSheetInstance;
}, []);
});
<IBSheetReact
options={options}
exgSheet={existingSheet}
The component includes TypeScript definitions. Make sure to define your IBSheetOptions interface:
interface IBSheetOptions {
Cfg?: IBSheetProperties
Def?: object
Cols?: IBCol[]
LeftCols?: IBCol[]
RightCols?: IBCol[]
Head?: any[]
Foot?: any[]
Solid?: any[]
Filter?: any[]
Events?: IBSheetEvents
}
IBSheet interface: https://www.npmjs.com/package/@ibsheet/interface
The component includes built-in error handling:
options prop is providedThe component applies default dimensions of 100% width and 800px height.
options prop contains valid IBSheet configuration[initializeIBSheet] IBSheet Initialization Failed: Maximum Retry Exceeded
sync: false for large datasetsSolutions:
index.htmlUsing Including External Script
ex) in index.html
<link rel="stylesheet" href="ibsheet_path/css/default/main.css" />
<script src="ibsheet_path/ibsheet.js"></script>
<script src="ibsheet_path/locale/ko.js"></script>
<script src="ibsheet_path/plugins/ibsheet-common.js"></script>
<script src="ibsheet_path/plugins/ibsheet-dialog.js"></script>
<script src="ibsheet_path/plugins/ibsheet-excel.js"></script>
Using IBSheetLoader
root/public directory or a subdirectory within root/publicibsheet_pathbaseUrlhttps://docs.ibsheet.com/ibsheet/v8/manual/#docs/intro/1introduce
FAQs
A React wrapper component for IBSheet, providing a seamless integration of IBSheet spreadsheet functionality into React applications.
The npm package @ibsheet/react receives a total of 14 weekly downloads. As such, @ibsheet/react popularity was classified as not popular.
We found that @ibsheet/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.