npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

use-prop-house

v0.1.4

Published

React hooks for Nouns Prop House

Downloads

4

Readme

use-prop-house

A collection of React Hooks to streamline data retrieval from the Nouns Prop House API.

Some to fetch specific items:

  • useHouse
  • useRound
  • useProposal

And some to fetch groups of items:

  • usePropHouses
  • useRoundsbyHouse
  • useRoundsByStatus
  • useProposalsByRound
  • useVotesByRound

Installation

# npm
npm i use-prop-house
# yarn
yarn add use-prop-house

Hooks


useHouse - A hook for fetching a given house.

Config object

| key | value | | ----------- | -------- | | id? | number | | contract? | string |

Requires either id or contract. Priority is given to id when both are present.

Usage

import { useHouse } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useHouse({
    id: 21, // or
    contract: '0xdf9b7d26c8fc806b1ae6273684556761ff02d422',
  });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <div>
      <img src={data.imageUrl} alt="" />
      <a href={data.url}>{data.name}</a>
      <p>{data.description}</p>
      <p>Total proposals: {data.totalProposals}</p>
    </div>
  );
}


useRound - A hook for fetching a given funding round.

Config object

| key | value | | ---- | -------- | | id | number |

Usage

import { useRound } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useRound({ id: 21 });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <div>
      <a href={data?.url}>
        {data?.house.name}: {data?.name}
      </a>
      <p>{data?.description}</p>

      <ul>
        {data?.proposals.map((prop) => {
          return (
            <li key={prop.id}>
              <a href={prop.url}>
                <p>{prop.title}</p>
                <p>{prop.summary}</p>
              </a>
            </li>
          );
        })}
      </ul>
    </div>
  );
}


useProposal - A hook for fetching a given proposal.

Config object

| key | value | | ---- | -------- | | id | number |

Usage

import { useProposal } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useProposal({ id: 65 });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <div>
      <a href={data?.url}>{data?.title}</a>
      <p>Proposed by: {data.proposer}</p>
      <p>{data?.content}</p>
    </div>
  );
}


usePropHouses - A hook for fetching summary data for each house.

Usage

import { usePropHouses } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = usePropHouses();

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <div>
      {data.map((house) => {
        return (
          <div key={house.id}>
            <img src={house.imageUrl} alt="" />
            <a href={house.url}>{house.name}</a>
            <p>Contract: {house.contract}</p>
          </div>
        );
      })}
    </div>
  );
}


useRoundsbyHouse - A hook for fetching rounds from a given house.

Config object

| key | value | | --------- | ----------------------------------------------------------------------- | | houseId | number | | status? | string or string[] - values: upcoming, open, voting, closed |

Usage

import { useRoundsByHouse } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useRoundsByHouse({
    houseId: 1,
    status: ['open', 'voting'], // omit to include all statuses
  });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <>
      {data.map((round) => {
        return (
          <div key={round.id}>
            <a href={round?.url}>
              {round?.house.name}: {round?.name}
            </a>
            <p>{round?.description}</p>

            <ul>
              {round?.proposals.map((prop) => {
                return (
                  <li key={prop.id}>
                    <a href={prop.url}>
                      <p>{prop.title}</p>
                      <p>{prop.summary}</p>
                    </a>
                  </li>
                );
              })}
            </ul>
          </div>
        );
      })}
    </>
  );
}


useRoundsByStatus - A hook for fetching rounds by status.

Config object

| key | value | | --------- | --------------------------------------------------------- | | status | string - values: upcoming, open, voting, closed | | limit? | number - default: 10 | | offset? | number - default: 0 |

Usage

import { useRoundsByStatus } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useRoundsByStatus({
    status: 'open',
    limit: 5,
    offset: 0,
  });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <>
      {data.map((round) => {
        return (
          <div key={round.id}>
            <a href={round?.url}>
              {round?.house.name}: {round?.name}
            </a>
            <p>{round?.description}</p>

            <ul>
              {round?.proposals.map((prop) => {
                return (
                  <li key={prop.id}>
                    <a href={prop.url}>
                      <p>{prop.title}</p>
                      <p>{prop.summary}</p>
                    </a>
                  </li>
                );
              })}
            </ul>
          </div>
        );
      })}
    </>
  );
}


useProposalsByRound - A hook for fetching proposals from a given round.

Config object

| key | value | | --------- | -------- | | roundId | number |

Usage

import { useProposalsByRound } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useProposalsByRound({ roundId: 2 });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <>
      {data?.map((prop) => {
        return (
          <div key={prop.id}>
            <a href={prop?.url}>{prop?.title}</a>
            <p>Proposed by: {prop.proposer}</p>
            <p>{prop?.content}</p>
          </div>
        );
      })}
    </>
  );
}


useVotesByRound - A hook for fetching votes from a given round.

Config object

| key | value | | --------- | -------- | | roundId | number |

Usage

import { useVotesByRound } from 'use-prop-house';

export default function App() {
  const { data, error, isLoading } = useVotesByRound({ roundId: 97 });

  if (isLoading) return <p>Loading data...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <>
      {data.map((vote, i) => {
        return (
          <div key={i}>
            <p>Voter: {vote.voter}</p>
            <p>votes: {vote.weight}</p>
            <a href={vote.proposal.url}>prop: {vote.proposal.title}</a>
          </div>
        );
      })}
    </>
  );
}