Switch Network

This component also provides the same functionality as the one from Readymade Components. The only difference here is in the way of implementation.

Usage

"use client";
import { SwitchNetworkWrapper } from "@nazeeh2000/comp-kit";
import { arbitrum, mainnet, polygon } from "viem/chains";

export default function Home() {
  return (
    <>
     <SwitchNetworkWrapper style={{ background: "cyan" }}>
        <SwitchNetworkWrapper.Option
          style={{ border: "2px solid cyan", background: "red" }}
          value={mainnet}
        >
          mainnet
        </SwitchNetworkWrapper.Option>
        <SwitchNetworkWrapper.Option css={{ color: "blue" }} value={arbitrum}>
          arbitrum
        </SwitchNetworkWrapper.Option>
        <SwitchNetworkWrapper.Option
          css={{ color: "blue" }}
          value={polygon}
        >
          Polygon
        </SwitchNetworkWrapper.Option>
      </SwitchNetworkWrapper>
    </>
  );
}

Note: Make sure your app is wrapped with the necessary provider KitProvider.

Last updated