-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.tsx
More file actions
27 lines (24 loc) · 858 Bytes
/
Copy pathindex.tsx
File metadata and controls
27 lines (24 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { GridStackOptions } from "gridstack";
import { useState } from "react";
import { defaultGridOptions } from "../../default-grid-options";
import { GridStackItem } from "../../lib";
import { GridStackContainer } from "../../lib/grid-stack-container";
export function Simple0() {
const [uncontrolledInitialOptions] = useState<GridStackOptions>(() => ({
...defaultGridOptions,
children: [
{ id: "000-item1", h: 2, w: 2, x: 0, y: 0 },
{ id: "000-item2", h: 2, w: 2, x: 2, y: 0 },
],
}));
return (
<GridStackContainer initialOptions={uncontrolledInitialOptions}>
<GridStackItem id="000-item1">
<div style={{ color: "yellow" }}>hello</div>
</GridStackItem>
<GridStackItem id="000-item2">
<div style={{ color: "blue" }}>grid</div>
</GridStackItem>
</GridStackContainer>
);
}