MCPcopy Create free account
hub / github.com/Remocn/remocn / ToggleGroupExampleScene

Function ToggleGroupExampleScene

components/docs/examples/toggle-group-example.tsx:20–43  ·  view source on GitHub ↗
(_p: ToggleGroupExampleProps = {})

Source from the content-addressed store, hash-verified

18export const toggleGroupExampleControls = [] as const;
19
20export const ToggleGroupExampleScene = (_p: ToggleGroupExampleProps = {}) => {
21 // Cursor: park → ease to "Yearly" → click → ease to "Monthly" → click.
22 const cursorStyle = useCursorPath([
23 { at: 0, x: 80, y: 60 },
24 { at: 32, x: YEARLY_X, y: TOGGLE_Y, duration: 28 },
25 { at: 44, x: YEARLY_X, y: TOGGLE_Y, click: true, duration: 0 },
26 { at: 80, x: MONTHLY_X, y: TOGGLE_Y, duration: 20 },
27 { at: 90, x: MONTHLY_X, y: TOGGLE_Y, click: true, duration: 0 },
28 ]);
29
30 // Toggle: starts on "Monthly", slides to "Yearly" on first click, back on second.
31 const toggleStyle = useToggleGroupTransition([
32 { at: 46, state: "Yearly", duration: 14 },
33 { at: 92, state: "Monthly", duration: 14 },
34 ]);
35
36 return (
37 <div style={{ position: "relative", width: "100%", height: "100%" }}>
38 {/* ToggleGroup renders position:absolute;inset:0 — it centers itself. */}
39 <ToggleGroup style={toggleStyle} />
40 <Cursor style={cursorStyle} variant="pointer" />
41 </div>
42 );
43};
44
45export const toggleGroupExampleCode = (
46 _values: Record<string, unknown> = {},

Callers

nothing calls this directly

Calls 2

useCursorPathFunction · 0.90
useToggleGroupTransitionFunction · 0.90

Tested by

no test coverage detected