Skip to content
Frontend
Hook

Hooks

What fluid-functionalism runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
fluid-functionalism
1.2k1 skill4 hooks

Claude Code

$ npx -y skills add mickadesign/fluid-functionalism --agent claude-code

Where it lives

  • hooks/use-fluid-hover.tsGitHub
    Read the script
    "use client";
    
    // The site's copy of `@/hooks/use-fluid-hover`, which every registry
    // component imports. It runs both implementations and hands the component
    // the one the Hover setting picks: fluid (`registry/default`) or standard
    // (`registry/standard`), the file an install from `r/standard/` gets. Both
    // are always called so the hook order never changes when the setting flips;
    // rows register with both, the pointer only drives the active one.
    
    import { useCallback, useEffect, type RefObject } from "react";
    import * as Fluid from "@/registry/default/hooks/use-fluid-hover";
    import * as Standard from "@/registry/standard/hooks/use-fluid-hover";
    import { useHoverMode } from "@/lib/docs/hover-mode";
    
    export {
      useRegisterFluidHoverItem,
      useFluidHoverSelect,
      ACTIVE_ATTR,
      ACTIVE_INDEX_ATTR,
      pickNearest,
      isOwnEvent,
    } from "@/registry/default/hooks/use-fluid-hover";
    export type { FluidHoverActiveStore, ItemRect, PickNearestInput, UseFluidHoverReturn, UseFluidHoverOptions } from "@/registry/default/hooks/use-fluid-hover";
    
    export function useFluidHover<T extends HTMLElement>(
      containerRef: RefObject<T | null>,
      options: Fluid.UseFluidHoverOptions = {}
    ): Fluid.UseFluidHoverReturn {
      const fluid = Fluid.useFluidHover(containerRef, options);
      const standard = Standard.useFluidHover(containerRef, options);
      const mode = useHoverMode();
      const active = mode === "standard" ? standard : fluid;
    
      // The idle one lets go of its highlight, so only the active one marks a row.
      const { setActiveIndex: clearFluid } = fluid;
      const { setActiveIndex: clearStandard } = standard;
      useEffect(() => {
        (mode === "standard" ? clearFluid : clearStandard)(null);
      }, [mode, clearFluid, clearStandard]);
    
      const { registerItem: registerFluid, remeasure: remeasureFluid, measureItems: measureFluid } = fluid;
      const {
        registerItem: registerStandard,
        remeasure: remeasureStandard,
        measureItems: measureStandard,
      } = standard;
      const registerItem = useCallback(
        (index: number, element: HTMLElement | null) => {
          registerFluid(index, element);
          registerStandard(index, element);
        },
        [registerFluid, registerStandard]
      );
      const remeasure = useCallback(() => {
        remeasureFluid();
        remeasureStandard();
      }, [remeasureFluid, remeasureStandard]);
      const measureItems = useCallback(() => {
        measureFluid();
        measureStandard();
      }, [measureFluid, measureStandard]);
    
      return { ...active, registerItem, remeasure, measureItems };
    }
    
  • hooks/use-keyboard-nav-gate.tsGitHub
    Read the script
    export { useKeyboardNavGate } from "@/registry/default/hooks/use-keyboard-nav-gate";
    
  • hooks/use-merge-split.tsGitHub
    Read the script
    export {
      useMergeSplitBlocks,
      useSelectionRuns,
      SelectionBackgrounds,
    } from "@/registry/default/hooks/use-merge-split";
    export type { Run, SelBlock } from "@/registry/default/hooks/use-merge-split";
    
  • hooks/use-touch-primary.tsGitHub
    Read the script
    export { useTouchPrimary } from "@/registry/default/hooks/use-touch-primary";
    

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

@mickadesign
Ships withfluid-functionalism

Refined UI components with satisfying hover. A shadcn/ui registry of components, the systems they share, and blocks that compose them.

Stars on GitHub

Momentum

stars in total
1.2k
Star history of mickadesign/fluid-functionalism on GitHub, a chart by star-history.com

More plugins that ship hooks.

8bitcn-ui

8bitcn-ui

Accessible retro components that you can copy and paste into your apps.Free. Open Source. Built on shadcn/ui. Documentation · Components · Blocks · Themes · Discord.

23 skills4 hooks2.1k
@theorcdev@theorcdev
Install Plugin

Questions about the hooks in fluid-functionalism.

Which coding agents can use the hooks in fluid-functionalism?
The hooks in fluid-functionalism install in Claude Code and Cursor: each runs Claude Code hooks from .claude/settings.json, so copy the hooks there.