> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# QueryRulesCustomData

> Shows custom data from applied index rules.

<Note>
  This is the **React InstantSearch v7** documentation.
  If you're upgrading from v6, see the [upgrade guide](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-v6-to-react-instantsearch-v7).
  If you were using React InstantSearch Hooks,
  this v7 documentation applies—just check for [necessary changes](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-hooks-to-react-instantsearch-v7).
  To continue using v6, you can find the [archived documentation](https://algolia.com/old-docs/deprecated/instantsearch/react/v6/api-reference/instantsearch/).
</Note>

## About this widget

This widget displays custom data from [Rules](/doc/guides/managing-results/rules/detecting-intent).

**The `<QueryRulesCustomData>` widget isn't part of React InstantSearch**,
but you can make a custom version with [`useQueryRules`](/doc/api-reference/widgets/query-rules/react).

## Examples

<CodeGroup>
  ```jsx JavaScript theme={"system"}
  import { useQueryRules } from "react-instantsearch";

  export function QueryRulesCustomData(props) {
    const { items } = useQueryRules(props);

    return (
      <>
        {items.map(({ title, link, banner }) => (
          <section key={title}>
            <h2>{title}</h2>
            <a href={link}>
              <img src={banner} alt="" />
            </a>
          </section>
        ))}
      </>
    );
  }
  ```

  ```tsx TypeScript theme={"system"}
  import { useQueryRules, useQueryRulesProps } from "react-instantsearch";

  export function QueryRulesCustomData(props: useQueryRulesProps) {
    const { items } = useQueryRules(props);

    return (
      <>
        {items.map(({ title, link, banner }) => (
          <section key={title}>
            <h2>{title}</h2>
            <a href={link}>
              <img src={banner} alt="" />
            </a>
          </section>
        ))}
      </>
    );
  }
  ```
</CodeGroup>
